> I have tried this, but it gets even weirder then:
>
> - the call to open always succeeds right away (even when there are
> no threads on the write end of the fifo)
> - the immediately following call to read() also succeeds, returning
> 0 bytes as the number of bytes read.
>
>
> it gets worse -- when i change my loop to be:
>
> while (1) {
>
> fifo = open(fifoPath, O_RDONLY | O_NONBLOCK);
> cread = read(fifo, buf, sizeof(buf));
> if (cread > 0) do_something();
> close(fifo);
> usleep(100000);
> }
>
> anybody who tries to open the write end of the fifo ends up hanging
Set the FIFO blocking with fcntl(2) after you open it. I'll hack up my test
program to be sure that works.
Peter
--
Peter Dufault ([EMAIL PROTECTED]) Realtime development, Machine control,
HD Associates, Inc. Fail-Safe systems, Agency approval
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message