hello!
I've got a program that creates a named pipe, and then spawns a
thread
which sits in a loop:
// error checking snipped.
//
while (1) {
int fifo = open(fifoPath, O_RDONLY); // this blocks
fprintf(stderr, "somebody opened the other end!\n");
If the first program calls open(2) before the second one calls
close(2) the former will not block because there's already a writer on
the pipe. A possible workaround would be to unlink and recreate the
fifo in program one, like so:
for (;;)
{
int fifo;
2 matches
Mail list logo