Skip to content

Commit 14c72cc

Browse files
ltnikic
authored andcommitted
Fix check for linux getrandom syscall
1 parent 9ad3413 commit 14c72cc

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

ext/standard/config.m4

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,6 @@ dnl Check for arc4random on BSD systems
607607
dnl
608608
AC_CHECK_DECLS([arc4random_buf])
609609

610-
dnl
611-
dnl Check for getrandom on newer Linux kernels
612-
dnl
613-
AC_CHECK_DECLS([getrandom])
614-
615610
dnl
616611
dnl Setup extension sources
617612
dnl

ext/standard/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
9393
}
9494
#elif HAVE_DECL_ARC4RANDOM_BUF && ((defined(__OpenBSD__) && OpenBSD >= 201405) || (defined(__NetBSD__) && __NetBSD_Version__ >= 700000001))
9595
arc4random_buf(bytes, size);
96-
#elif HAVE_DECL_GETRANDOM
96+
#elif defined(__linux__) && defined(SYS_getrandom)
9797
/* Linux getrandom(2) syscall */
9898
size_t read_bytes = 0;
9999
size_t amount_to_read = 0;

0 commit comments

Comments
 (0)