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

2018-06-17 Thread David Holland
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 op

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

2018-06-17 Thread Edgar Fuß
> 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 o

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

2018-06-17 Thread David Holland
On Fri, Jun 15, 2018 at 01:35:17PM +0200, Edgar Fu? wrote: > I guess that's a rater silly/basic question, but ... > > Is there a way to open(.. O_WRONLY ..) an existing named pipe that > currently has no reader such that > -- the open() will neither block nor fail > -- subsequent write()s t

open()ing a named pipe with no current readers

2018-06-15 Thread Edgar Fuß
I guess that's a rater silly/basic question, but ... Is there a way to open(.. O_WRONLY ..) an existing named pipe that currently has no reader such that -- the open() will neither block nor fail -- subsequent write()s to that fd will -- succeeed if someone started reading in the meantime