--- openssl-1.1.1-dev/crypto/rand/rand_unix.c.ori 2018-03-06 15:34:08.301218850 +0100 +++ openssl-1.1.1-dev/crypto/rand/rand_unix.c 2018-03-06 15:34:30.029191825 +0100 @@ -131,7 +131,29 @@ # endif # ifdef OPENSSL_RAND_SEED_GETRANDOM -# include +#include +#include + +#if !defined(__NR_getrandom) +#if defined(__powerpc__) || defined(__powerpc64__) +#define __NR_getrandom 236 +#elif defined(__sparc__) || defined(__sparc64__) +#define __NR_getrandom 347 +#elif defined(__x86_64__) +#define __NR_getrandom 318 +#elif defined (__i386__) +#define __NR_getrandom 355 +#elif defined (__s390__) || defined(__s390x__) +#define __NR_getrandom 249 +#endif /* $arch */ +#endif /* __NR_epoll_ctl */ +/* +static ossl_inline int getrandom(void *buf, size_t buflen, unsigned int flags) +{ + return syscall(__NR_getrandom, buf, buflen, flags); +} +*/ +#define getrandom(_b, _l, _f) syscall(__NR_getrandom, _b, _l, _f) # endif # if defined(OPENSSL_RAND_SEED_LIBRANDOM)