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.
diff --git a/man7/pipe.7 b/man7/pipe.7 index 9977acc..d43671b 100644 --- a/man7/pipe.7 +++ b/man7/pipe.7 @@ -143,6 +143,17 @@ operations. See .BR fcntl (2) for more information. + +The current amount of data waiting in a pipe can be queried with the +.BR ioctl (2) +operation +.BR FIONREAD . +See +.BR ioctl (2) +and +.BR tty_ioctl (4) +for more information on usage of +.BR FIONREAD . .\" .SS PIPE_BUF POSIX.1 says that