tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: open()ing a named pipe with no current readers



On Sun, Jun 17, 2018 at 09:33:03PM +0200, Edgar Fu? wrote:
 > > Won't O_NONBLOCK cover this?
 > No. POSIX says:
 > O_NONBLOCK
 > 	When opening a FIFO with O_RDONLY or O_WRONLY set:
 > 		If O_NONBLOCK is set, an open() for reading-only shall
 >              return without delay. An open() for writing-only shall
 >              return an error if no process currently has the file
 >              open for reading.

That's annoying. There's probably no good way around it then and it's
probably time to fall back to hacks with alarm() or similar.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index