Re: kern/13593: Problems with FIFO and select

1999-09-06 Thread Alex Povolotsky
> "Bruce" == Bruce Evans writes:

>>> Description:
>> Attempt to open FIFO file with O_WRONLY|O_NONBLOCK results in
>> Device not configured error.

Bruce> This is because there is no reader when the FIFO is opened for
Bruce> writing (O_WRONLY opens of FIFOs normally block waiting for a
Bruce> reader, but O_NONBLOCK gives an error instead).

Well, but how do I multiplex on FIFO opening? 

>> However, when FIFO is opened with O_RDWR and O_NONBLOCK, every
>> attempt to select(2) its handler for writing doesn't wait until
>> someone opens FIFO for reading, but instead FIFO is ready to write
>> at every select.

Bruce> This is because O_RDWR gives both a reader and a writer.

Well again, both things are reasonable, but I wanted to do the
following:

(1) open a control FIFO, for external commands
(2) open a status FIFO, for status reporting
(3) open several sockets for internal usage

and than select() on all of them, waiting for either command to
arrive, request for status, or (some internal event,
select()-multiplexable).

I can implement this using UNIX sockets and external programs, but can 
I make status reporting without external program?

-- 
Alexander B. Povolotsky[ICQ 18277558]
[2:5020/145]  [http://freebsd.svib.ru] [tark...@asteroid.svib.ru]


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message



Re: kern/13593: Problems with FIFO and select

1999-09-06 Thread Alex Povolotsky

> "Bruce" == Bruce Evans writes:

>>> Description:
>> Attempt to open FIFO file with O_WRONLY|O_NONBLOCK results in
>> Device not configured error.

Bruce> This is because there is no reader when the FIFO is opened for
Bruce> writing (O_WRONLY opens of FIFOs normally block waiting for a
Bruce> reader, but O_NONBLOCK gives an error instead).

Well, but how do I multiplex on FIFO opening? 

>> However, when FIFO is opened with O_RDWR and O_NONBLOCK, every
>> attempt to select(2) its handler for writing doesn't wait until
>> someone opens FIFO for reading, but instead FIFO is ready to write
>> at every select.

Bruce> This is because O_RDWR gives both a reader and a writer.

Well again, both things are reasonable, but I wanted to do the
following:

(1) open a control FIFO, for external commands
(2) open a status FIFO, for status reporting
(3) open several sockets for internal usage

and than select() on all of them, waiting for either command to
arrive, request for status, or (some internal event,
select()-multiplexable).

I can implement this using UNIX sockets and external programs, but can 
I make status reporting without external program?

-- 
Alexander B. Povolotsky[ICQ 18277558]
[2:5020/145]  [http://freebsd.svib.ru] [[EMAIL PROTECTED]]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message