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 -- block/return EWOULDBLOCK if still no-one is reading ?
Of course there's the work-around of lazily open()ing the fd before each write() call.