fcntl does not perform as stated in man page
Joe Boykin
boykin at encore.UUCP
Wed Jul 20 23:10:11 AEST 1988
In article <405 at oravax.UUCP> cammie at oravax.UUCP (Cammie Howard) writes:
>As I understand the man (2) page for fcntl, the line
>
> fcntl(d,F_SETFL,FNDELAY)
>
>is supposed to make a "read" call on the file descriptor d and return
>a -1 if you're at the EOF of d.
>
>The results are that it returns a 0.
What this call does is to make sure that any *future* read call will
return -1 with errno set to EWOULDBLOCK. The fcntl call itself just
specifies that this is the specified behavior, rather than the normal
behavior of blocking until input is available. The return value of 0
indicates that the fcntl completed successfully, rather than (in this
case) EBADF stating that you passed it an invalid file descriptor (d).
----
Joe Boykin
Encore Computer Corp
Chairman, IEEE Computer Societies
Technical Committee on Operating Systems
UUCP: encore!boykin
ARPA: boykin at multimax.arpa
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list