[sane-devel] Use poll() instead of select() in backends

Nils Philippsen nils at tiptoe.de
Wed Sep 3 13:31:55 UTC 2014

Hey Allan, everybody,

On Fri, 2014-08-29 at 08:10 -0400, m. allan noah wrote:
> Given that poll() is reported to be flaky on certain versions of OSX,
> we need to at least keep select() as an option. saned.c has a private
> poll() implementation which uses select, perhaps it could be
> re-used/extended somewhere in sanei, for those platforms that need it?

I've experimentally pulled out the poll() implementation from saned into
its own source files for sanei and found something peculiar: With only
the code and macros from saned.c (i.e. without <sys/poll.h>), saned.c
doesn't compile (there are some POLL* macros missing). So I figure that
nobody ever built saned with IPv6 support since that was introduced in
2003 -- does that sound about right?

The IPv4-only version (the code previous to when IPv6 support landed)
seems to have a bunch of completely different implementations for some
functions (i.e. depending on a macro either one or the other function
gets used) and I'm slightly concerned that these older codepaths don't
get tested. 

Are there any people around who care for OS/X in the SANE project who
could give me a bit more details about how poll() works differently
there, and what if any differences are between versions of OS/X?

Nils Philippsen / Wilhelmstraße 22 / D-71229 Leonberg 
nils at tiptoe.de / nils at redhat.com
PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011
Ever noticed that common sense isn't really all that common?

More information about the sane-devel mailing list