[lkml]   [2000]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: No Bug: accept discards socket options/O_NONBLOCK
On Fri, 15 Sep 2000, David S. Miller wrote:

[accept not inheriting O_NONBLOCK]
> The socket(7) manpage is buggy, not the kernel.
> This has been this way forever, it is thus an API and it is not
> changing. Changing it would break existing programs. End of story.

I have been looking through the Single Unix Specification v7 and various
accept(2) man pages (NetBSD 1.3, SunOS 4.1.3, SunOS 5.7) and all go like

"creates a new socket with the same properties as s." "creates a new
file descriptor." - no mention if that has the same O_ flags as the
listening socket.

So it seems that BSD and Solaris 7 happen to copy the fd options as
well, and Linux happens to just create a new fd, and both are right.

Now, interpreting properties as "socket properties", and O_NONBLOCK
being a file descriptor property, it may be legal to not copy the fd

However, this makes Linux incompatible with *BSD and Solaris, so I'm
wondering what this "break existing programs" would be, portable
programs would most likely not break by the API change.

Break portability, that's what it actually does, regardless of who is
correct. *sigh*

Matthias Andree
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:38    [W:0.079 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site