10-25-06 12:17 AM
On Tue, 24 Oct 2006 18:13:07 +0000, phil-news-nospam wrote:
> On Tue, 24 Oct 2006 13:53:02 +0200 "Nils O. Sel?sdal" <NOS@utel.no> wrote:
>
> | freegnu wrote:
> |> hi all, it strange, when i use open() to open a FIFO to write, but i
> |> find when i use
> |> open(Fifo,O_WRONLY | O_CREAT | O_TRUNC); it will block
O_CREAT and O_TRUNC are both nonsensical and dangerous to use with named
pipes.
> | Opening a fifo blocks until someone opens if for reading.
>
> So how to make a program that can listen on more than one fifo? EAGAIN?
open(Fifo, O_WRONLY | O_NONBLOCK);
Note that in Linux O_NONBLOCK only makes the open non-blocking, but I've
recently learned that in BSD it also makes all subsequent I/O operations
non-blocking.
[ Post a follow-up to this message ]
|