random: Use poll instead of select

Werner Koch wk at gnupg.org
Mon Nov 2 17:22:59 CET 2015


On Mon,  2 Nov 2015 09:31, gniibe at fsij.org said:

> I'm trying to fix a bug in GnuPG 1.4 (caused by (a kind of bug in)
> duplicity which uses many file descriptors):

and doesn't close them before execing gpg?  That is a real bug in
duplicity and we should better not work around it but only detect it.

For Libgcrypt however, we can't limit the number of used file
descriptors.

> So, this is the version which keeps the original behavior; It simply
> replaces select by poll.  Note: poll uses millisecond for its timeout.
>
> I think that all Linux kernel nowadays support poll(2).

rndlinux is a misnomer these days because it is actually an access
module for /dev/random style devices as available on all kind of
platforms.  I am not sure whether whether poll is availabale on all
these platforms.  You should add a test for a working poll or use poll
only for linux (to simplify the configure test).


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gcrypt-devel mailing list