Path: utzoo!attcan!uunet!lll-winken!csd4.csd.uwm.edu!mailrus!purdue!tut.cis.ohio-state.edu!pt.cs.cmu.edu!cadre!pitt!amanue!oglvee!norm From: norm@oglvee.UUCP (Norman Joseph) Newsgroups: comp.unix.wizards Subject: Re: nonblocking I/O techniques for System V Message-ID: <498@oglvee.UUCP> Date: 24 Aug 89 13:26:28 GMT References: <17450@bellcore.bellcore.com> Organization: Oglevee Computer Systems, Connellsville, Pa Lines: 26 From article <17450@bellcore.bellcore.com>, by tr@madeleine (tom reingold): > What's the technique for nonblocking I/O for System V. In BSD, you use > select() which is very convenient and elegant. What's the equivalent. > I think I've heard that it requires several function calls. See your system's manual page for the open() system call, and look for the O_NDELAY flag. According to Rochkind in _Advanced_UNIX_Programming_, Sec. 2.6: When opening pipes, FIFOs, and communication-line special files, this flag determines whether open waits or returns immediately. Subsequent reads and writes are also affected. [...] O_NDELAY has no effect on ordinary files and directories. The drawback is that, if no data is waiting, a read() will return a zero count, just as if you had hit ^D. You may also consider supplementing your library with Rochkind's book (ISBN 0-13-011800-1), which contains a wealth of information on programming with UNIX system calls. Disclaimer: NOT a stockholder in Prentice-Hall, just a satisfied customer. -- Norm Joseph - Oglevee Computer System, Inc. UUCP: ...!{pitt,cgh}!amanue!oglvee!norm /* you are not expected to understand this */