[Cialug] Select and poll

Brian Wood woodbrian77 at gmail.com
Thu Aug 30 14:09:39 UTC 2018


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 using poll() in this program:
https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/genz.cc

but decided I could do without it recently.  Part of my
decision was based on thinking that poll() suffered from
the same problem as select().   This problem with
select() has existed for years on LInux.  I'm not sure why
they don't fix it.  FreeBSD doesn't have this problem.

Also would like to mention that I recently learned that
GhostBSD doesn't have any firewall options apparently.
Recently I started using GhostBSD and have liked it, but
even more recently found this out.  One good thing about
TrueOS is they incorporate a firewall.


Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net


More information about the Cialug mailing list