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

Tony Sweeney sweeney at addr.com
Sun Aug 31 09:44:39 UTC 2014

On 08/29/2014 11:23, Nils Philippsen wrote:
> On Fri, 2014-08-29 at 00:19 +0200, Alessandro Zummo wrote:
>> On Thu, 28 Aug 2014 17:58:52 +0200
>> Nils Philippsen <nils at tiptoe.de> wrote:
>>> I think we should at least default to using poll() (so LO and possibly
>>> OO don't crash if they use SANE and a networked scanner), but if we
>>> don't support platforms that don't have it it's much less clutter to
>>> ditch select() and replace it with poll() completely. Otherwise it's
>>> something that should maybe be abstracted away in sanei.
>>> What's your opinion?
>>   Well, I'd add a check to the select call.
> I thought about that, too, but what then? I mean failing if FD > 1024 is
> better than crashing the whole program, but I guess it could confuse
> people a good deal if they couldn't scan from their networked scanner
> only in LO, but not other apps which are a bit more frugal in their
> consumption of FDs.
>>   But if you have a working patch with poll() I'll gladly check it ;)
> I wanted to sound out what would be acceptable -- I for myself would
> just drop select() for poll() wholesale to be on the safe side, but as I
> said, I'm not sure if we are supporting platforms that don't have
> poll().

It looks like all of the BSDs have poll() as well as select().


> Nils

More information about the sane-devel mailing list