public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Tomi Salminen <tlsalmin@gmail.com>
Cc: mtk.manpages@gmail.com, linux-kernel@vger.kernel.org,
	linux-man@vger.kernel.org
Subject: Re: [patch] man2/fcntl.2: F_SETPIPE_SZ returns pipe size, not 0.
Date: Tue, 01 Jul 2014 11:43:22 +0200	[thread overview]
Message-ID: <53B282BA.6010309@gmail.com> (raw)
In-Reply-To: <CACV4sJ8mYEnozgDOmN7VODFrvw_51EYDgw2OxsPRq4s5fSh2Cg@mail.gmail.com>

On 07/01/2014 11:05 AM, Tomi Salminen wrote:
> Hello.
> 
> I was using F_SETPIPE_SZ and noticed that fcntl was returning the
> pipe size set to it and not zero on success. I checked the kernel
> source, which seemed to return nr_pages * PAGE_SIZE; I made a patch 
> to update the man-page of fcntl, since it specified only F_GETPIPE_SZ
> as returning the pipe size and others zero.
> 
> Attaching patch made on top of commit
> f070e9543a5a7cc600229ee6a3c725804c90de91

Thanks for spotting that, Tomi. I applied a more extensive patch, below.

Cheers,

Michael

--- a/man2/fcntl.2
+++ b/man2/fcntl.2
@@ -1257,9 +1257,7 @@ When allocating the buffer for the pipe,
 the kernel may use a capacity larger than
 .IR arg ,
 if that is convenient for the implementation.
-The
-.B F_GETPIPE_SZ
-operation returns the actual size used.
+The actual capacity that is set is returned as the function result.
 Attempting to set the pipe capacity smaller than the amount
 of buffer space currently used to store data produces the error
 .BR EBUSY .
@@ -1291,7 +1289,7 @@ for traditional
 .B SIGIO
 behavior.
 .TP
-.B F_GETPIPE_SZ
+.BR F_GETPIPE_SZ ", " F_SETPIPE_SZ
 The pipe capacity.
 .TP
 All other commands


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

           reply	other threads:[~2014-07-05  6:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CACV4sJ8mYEnozgDOmN7VODFrvw_51EYDgw2OxsPRq4s5fSh2Cg@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B282BA.6010309@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=tlsalmin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox