Article View: comp.bugs.4bsd
Article #1083Re: fcntl does not perform as stated in man page
From: Joe Boykin
Date: Wed, 20 Jul 1988 13:10
Date: Wed, 20 Jul 1988 13:10
26 lines
1417 bytes
1417 bytes
In article <405@oravax.UUCP> cammie@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@multimax.arpa
Technical Details
Message-ID:
<3374@encore.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!necntc!encore!boykinReferences:
<405@oravax.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!necntc!encore!boykin From: boykin@encore.UUCP (Joe Boykin) Newsgroups: comp.bugs.4bsd Subject: Re: fcntl does not perform as stated in man page Summary: Not a bug, just a misreading of the man page Keywords: fcntl F_SETFL Message-ID: <3374@encore.UUCP> Date: 20 Jul 88 13:10:11 GMT References: <405@oravax.UUCP> Reply-To: boykin@encore.UUCP (Joe Boykin) Organization: Encore Computer Corp, Marlboro, MA Lines: 25