A question about read() system call!!
Shane Bouslough
shane at inferno.peri.com
Thu May 30 04:08:40 AEST 1991
>From article <1361 at anprda.atson.asahi-np.co.jp>
akira at atson.asahi-np.co.jp (Akira Takiguchi) speaks too soon:
>
>>If the file is not open yet, you can specify the O_NDELAY option when you
>>open the file.
>
> This has nothing to do with the problem. It makes open(2) non-blocking
> but not read(2).
BZZZZZZZZZZZ! <- game show buzzer
And the Manual looketh upon O_NDELAY and spake:
OPEN(2)
O_NDELAY This flag may affect subsequent reads and writes. See
read(2) and write(2).
READ(2)
When attempting to read from an empty pipe (or FIFO):
If O_NDELAY is set, the read will return a 0.
If O_NDELAY is clear, the read will block until data
is written to the file or the file is no longer
open for writing.
And the Manual saw that O_NDELAY was good.
> --
> | Akira Takiguchi at ATSON, Inc. (a subsidiary of the Asahi Shimbun)
> | WAKO GINZA bldg. 8-10-4 Ginza Chuo-ku Tokyo 104 Japan
> | Phone +81 3 3289 7051 Fax +81 3 3289 7066 SORRY, EMAIL NOT AVAILABLE
--
Shane Bouslough | ...!rutgers!mcdhup!inferno!shane 516-467-0500
Periphonics Corp. | Ride Bike!
4000 Veterans Hwy. | "We're talking Mega-Ecstasy-Bliss!!!"
Bohemia, NY 11716 | -David Lister, Red Dwarf
More information about the Comp.unix.questions
mailing list