---- libgcrypt-1.8.0/random/rndlinux.c.orig 2017-06-24 13:34:29.000000000 +0200
-+++ libgcrypt-1.8.0/random/rndlinux.c 2017-07-29 10:42:28.147643001 +0200
-@@ -32,6 +32,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
-+#include <poll.h>
- #if defined(__APPLE__) && defined(__MACH__)
- #include <Availability.h>
- #ifdef __MAC_10_11
-@@ -216,8 +217,7 @@
- return with something we will actually use 100ms. */
- while (length)
- {
-- fd_set rfds;
-- struct timeval tv;
-+ struct pollfd fds;
- int rc;
-
- /* If we have a modern operating system, we first try to use the new
-@@ -276,21 +276,11 @@
- any_need_entropy = 1;
- }
-
-- /* If the system has no limit on the number of file descriptors
-- and we encounter an fd which is larger than the fd_set size,
-- we don't use the select at all. The select code is only used
-- to emit progress messages. A better solution would be to
-- fall back to poll() if available. */
--#ifdef FD_SETSIZE
-- if (fd < FD_SETSIZE)
--#endif
- {
-- FD_ZERO(&rfds);
-- FD_SET(fd, &rfds);
-- tv.tv_sec = delay;
-- tv.tv_usec = delay? 0 : 100000;
-+ fds.fd = fd;
-+ fds.events = POLLIN;
- _gcry_pre_syscall ();
-- rc = select (fd+1, &rfds, NULL, NULL, &tv);
-+ rc = poll(&fds, 1, delay ? (delay*1000) : 100);
- _gcry_post_syscall ();
- if (!rc)
- {
-@@ -300,7 +290,7 @@
- }
- else if( rc == -1 )
- {
-- log_error ("select() error: %s\n", strerror(errno));
-+ log_error ("poll() error: %s\n", strerror(errno));
- if (!delay)
- delay = 1; /* Use 1 second if we encounter an error before
- we have ever blocked. */