Subject: kern/26950: O_NONBLOCK is inherited across accept() yet fcntl(, F_GETFL) doesn't know it
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <joe@manyfish.co.uk>
List: netbsd-bugs
Date: 09/14/2004 20:50:33
>Number:         26950
>Category:       kern
>Synopsis:       O_NONBLOCK is inherited across accept() yet fcntl(, F_GETFL) doesn't know it
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 14 20:51:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Joe Orton
>Release:        NetBSD 1.6
>Organization:
>Environment:
NetBSD spe143.testdrive.hp.com 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep  8 19:43:40 UTC 2002     autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386

>Description:
Compile this test case:

http://cvs.apache.org/~jorton/nonblock.c

the program reports on NetBSD that O_NONBLOCK is not inherited across accept(), which does not appear to be the case.  If you add a read() from the accepted socket, it will fail with EAGAIN.

fcntl(, F_GETFL) appears to be lying about the socket flags.

>How-To-Repeat:
as above
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: