lkml.org 
[lkml]   [2011]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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


\
 
 \ /
  Last update: 2011-06-20 00:33    [W:2.644 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site