Subject: Re: Not beer, or why is the pipe so small?
To: Viktor Dukhovni <viktor@dukhovni.org>
From: Andrew Brown <atatat@atatdot.net>
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" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."