Re: sizeof PIPE_BUF

Laurent Bercot <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
> Note that the PIPE_BUF macro is not meant to indicate the size of the
> kernel's pipe buffer.  Check the SUS description of write() for the
> details of what PIPE_BUF means.  The buffer's size must be at least
> PIPE_BUF to satisfy those requirements, but it may be larger.

 Indeed. And as far as I know, there's no strictly user-space way of
knowing the size of the pipe buffer. When I needed to do this, I had
to look deep into the Linux kernel headers, and didn't find anything
either (even the kernel-space PIPE_SIZE macro is defined as PAGE_SIZE
which is 4096). The 65536 value is probably hardcoded somewhere, but
it's obviously not meant to be accessed by a userspace program.

 I guess it's one of the "the specific value is none of your business"
cases, and strictly Single Unix-speaking, it's true; but with the
introduction of the splice() family of system calls, it's still
interesting to know that value. If Felix agrees, maybe he could
suggest it on lkml.

-- 
 Laurent
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.