public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Patrick McLean <patrickm-aTCcZBytkHbQT0dZR+AlfA@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	David Coles <coles.david-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Roderick Colenbrander
	<roderick-aTCcZBytkHbQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] document FIONREAD on pipe
Date: Sun, 25 Sep 2016 12:10:28 +0200	[thread overview]
Message-ID: <453f4338-96aa-63de-339f-ce53a44bebd3@gmail.com> (raw)
In-Reply-To: <CAE2NFgU-hfRvNBxDBhN9=QpZ2AVwmNxx-kCXNajcRv0wfrwYPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hello Patrick

On 09/24/2016 12:17 AM, Patrick McLean wrote:
> The FIONREAD ioctl can be used on a pipe to get the current amount of
> data in the pipe. This ioctl is currently only documented in tty_ioctl
> (4). This adds a blurb to the pipe(7) man page about this ioctl.

Thanks for the patch. In the end, I wrote something more extensive.
See below.

Cheers,

Michael

diff --git a/man7/pipe.7 b/man7/pipe.7
index 9977acc..b6a3007 100644
--- a/man7/pipe.7
+++ b/man7/pipe.7
@@ -143,6 +143,21 @@ operations.
 See
 .BR fcntl (2)
 for more information.
+
+The following
+.BR ioctl (2)
+operation, which can be applied to a file descriptor
+that refers to either end of a pipe,
+places a count of the number of unread bytes in the pipe in the
+.I int
+buffer pointed to by the final argument of the call:
+
+    ioctl(fd, FIONREAD, &nbytes);
+
+The
+.B FIONREAD
+operation is not specified in any standard,
+but is provided on many implementations.

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-09-25 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 22:17 [PATCH] document FIONREAD on pipe Patrick McLean
     [not found] ` <CAE2NFgU-hfRvNBxDBhN9=QpZ2AVwmNxx-kCXNajcRv0wfrwYPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-25 10:10   ` Michael Kerrisk (man-pages) [this message]
     [not found]     ` <453f4338-96aa-63de-339f-ce53a44bebd3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-09-26 20:18       ` Patrick McLean

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=453f4338-96aa-63de-339f-ce53a44bebd3@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=coles.david-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=patrickm-aTCcZBytkHbQT0dZR+AlfA@public.gmane.org \
    --cc=roderick-aTCcZBytkHbQT0dZR+AlfA@public.gmane.org \
    /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