Subject: Re: Not beer, or why is the pipe so small?
To: Viktor Dukhovni <>
From: Andrew Brown <>
List: tech-kern
Date: 02/25/2003 23:41:24
>> Does Posix say that?
>> I didn't see any refererence to PIPE_MAX in the posix select man page.
>Posix does not say it explicitly, but it does if you read "between the
>lines", since writes of PIPE_BUF bytes are atomic with pipes, and since a
>writable pipe should absorb *some* output when a non-blocking writer
>writes to it (the sender should not see EWOULDBLOCK), a writable pipe must
>have at least PIPE_BUF bytes free. Otherwise a non-blocking writer would
>wake up in a tight loop waiting for PIPE_BUF bytes to become available.

just to play the devil's advocate...

i can easily interpret what you say above:

	writes of PIPE_BUF bytes are atomic with pipes

to mean that "only writes of up to PIPE_BUF bytes are atomic with
pipes, and that larger writes may not be atomic".

that would allow both a write of one byte to succeed and be perfectly
correct, and for select()/poll() to return when room for one byte to
be written was available.

>So POSIX does not need to spell out the implications for poll()/select(),
>they follow from what is already said.

seems ambiguous to me.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."