Re: No Bug: accept discards socket options/O_NONBLOCK

From: Matthias Andree (matthias.andree@stud.uni-dortmund.de)
Date: Fri Sep 15 2000 - 08:57:32 EST


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
this:

"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
flags.

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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:25 EST