alarm and named pipes (a.k.a. FIFO)

Leslie Mikesell les at chinet.chi.il.us
Thu Nov 16 08:19:25 AEST 1989


In article <68 at zycor.UUCP> bill at 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 at chinet.chi.il.us



More information about the Comp.unix.wizards mailing list