[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110619233225.17914c60@lxorguk.ukuu.org.uk>
Date: Sun, 19 Jun 2011 23:32:25 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Nemo Publius <nemo@...f-evident.org>
Cc: Bernd Petrovitsch <bernd@...rovitsch.priv.at>,
Eric Dumazet <eric.dumazet@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: Does Linux select() violate POSIX?
> And I got my answer, which is yes, Linux select() violates POSIX, and
> that decision is deliberate.
>
> But again, thank you so much for your valuable contribution to the discussion.
It's worth noting that the POSIX semantics are actually unimplementable
for some network protocols anyway particularly on send. TCP is a fine
example. A remote TCP isn't *supposed* to shrink its window but they can
do, and that that point the space select() saw for a send is closed down
again by the remote host.
All sorts of similar issues appear all over the place. There are also
interesting API corner cases such as the behaviour of
listen()
select
connection made
select returns
remote closes connection
accept
behaviour is not determinate
(and in general POSIX doens't address sockets well)
So for portable code always mix select and poll with non blocking I/O. It
doesn't matter what the specs say, the real world says drive defensively
8)
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists