Kyle R . Burton on Wed, 19 Jun 2002 10:54:07 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Non-blocking FIFO I/O


> Reading from a FIFO:  I'm reading line-by-line, like a command queue,
> but I want the read call to return immediately if there is nothing
> waiting in the fifo.  Does the O_NDELAY option of open() do it?  I'd
> think so, but the man page is a bit unclear (it refers to opening
> non-blocking, not reads and writes non-blocking).  Thanks.

I think you might be looking for fcntl(2) with O_NONBLOCK, and select(2) 
( or poll(2) ).

Kyle



-- 

------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
        -- Christmas Humphreys
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug