[Cialug] Select and poll
    Brian Wood 
    woodbrian77 at gmail.com
       
    Thu Aug 30 15:36:00 UTC 2018
    
    
  
On Thu, Aug 30, 2018 at 9:08 AM Brian Wood <woodbrian77 at gmail.com> wrote:
> The docs for select() says:
>
>  Under Linux, select() may report a socket file descriptor as
> "ready for reading", while nevertheless a subsequent  read
> blocks.  This could for example happen when data has arrived
> but upon examination has wrong checksum and is discarded.
> There may be other circumstances in which a file descriptor is
> spuriously reported as ready.  Thus it may be safer to use
> O_NONBLOCK on sockets that should not block.
>
> I was thinking that poll() is also similarly afflicted on Linux, but
> the docs for poll() don't mention anything similar.  Does anyone
> know if poll() used to have the problem, but no longer does
> or if it does, but the docs fail to mention it?
>
I was looking at docs in the "3P" section on poll() -- I guess  the 'P'
may stand for Posix.  When I checked poll() in section 2, there's a
note referring you to select() spurious bugs.  So I believe this is
still a problem for poll().
I have another program where I'm still using poll() so I guess I'll
have to take some defensive measures related to this.
Brian
Ebenezer Enterprises
http://webEbenezer.net
    
    
More information about the Cialug
mailing list