I think this patch may cause issues on other operating systems, since getentropy() is normally defined in unistd.h Can I propose to include sys/random.h only on Solaris: #ifdef HAVE_GETENTROPY #if defined(__sun) && defined(__SVR4) #include <sys/random.h> #endif #endif