[comp.unix.wizards] alarm and named pipes

bill@zycor.UUCP (bill) (11/14/89)

A Sys V question...

If you set an alarm for, say, 3 seconds, then write to a named pipe
when there is no process reading from it, the alarm never kills the
read. Am I doing something wrong, or did I miss something in the FM?

-- 
Bill Mahoney
bill@zycor.UUCP
The holiday season: time to wonder if the Salvation Army has tanks...

les@chinet.chi.il.us (Leslie Mikesell) (11/16/89)

In article <68@zycor.UUCP> bill@zycor.UUCP (bill) writes:

>A Sys V question...

>If you set an alarm for, say, 3 seconds, then write to a named pipe
>when there is no process reading from it, the alarm never kills the
>read. Am I doing something wrong, or did I miss something in the FM?

Are you sure you actually got that far?  The open() should have blocked
waiting for a reading process unless you set O_NDELAY, in which case
write() should also return immediately with an error when the pipe
is full.  Depending on the application, you may find it useful to
have the writer open the FIFO in r/w mode (but never do a read()).
This allows writing until the pipe buffer fills regardless of the
reading process which sounds like what you are trying to do, but
it prevents you from knowing if the reader is running.

Les Mikesell
 les@chinet.chi.il.us