But I don't wanna do non-blocking I/O...

Conor P. Cahill cpcahil at virtech.uucp
Wed Jun 13 06:32:45 AEST 1990


In article <397 at minya.UUCP> jc at minya.UUCP (John Chambers) writes:
>
>  [story of program where fgets() returns EOF on first read deleted]
>
>calling a shell.  The open() does include F_NDELAY, but
                                           ^^^^^^^^  I assume you mean O_NDELAY
>this is supposed to apply only to the open; it shouldn't
>set non-blocking I/O permanently for the file (I hope ;-).

You should RTFM (specifically the read(2) man page). Therein you should
find a paragraph similar to the following:

	When attempting to read a file associated with a tty that has no data
	currently available:

		If O_NDELAY is set, the read will return 0.
		If O_NDELAY is clear, the read will block until data becomes
		available.

If you don't want this behavior, you should use the fcntl(2) to change turn
off the O_NDELAY once the open has returned.

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.wizards mailing list