Skip to content

Commit fb2ae15

Browse files
committed
add a specific configure check for sys/random.h (closes python#28932)
1 parent 6165d55 commit fb2ae15

5 files changed

Lines changed: 8 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Release date: TBA
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #28932: Do not include <sys/random.h> if it does not exist.
14+
1315
- Issue #28147: Fix a memory leak in split-table dictionaries: setattr()
1416
must not convert combined table into split table.
1517

Python/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# ifdef HAVE_LINUX_RANDOM_H
1010
# include <linux/random.h>
1111
# endif
12-
# if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
12+
# ifdef HAVE_SYS_RANDOM_H
1313
# include <sys/random.h>
1414
# endif
1515
# if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7714,7 +7714,7 @@ unistd.h utime.h \
77147714
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
77157715
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
77167716
sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
7717-
sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
7717+
sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
77187718
sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
77197719
sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
77207720
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ unistd.h utime.h \
19461946
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
19471947
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
19481948
sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
1949-
sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
1949+
sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
19501950
sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
19511951
sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
19521952
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,9 @@
10051005
/* Define to 1 if you have the <sys/poll.h> header file. */
10061006
#undef HAVE_SYS_POLL_H
10071007

1008+
/* Define to 1 if you have the <sys/random.h> header file. */
1009+
#undef HAVE_SYS_RANDOM_H
1010+
10081011
/* Define to 1 if you have the <sys/resource.h> header file. */
10091012
#undef HAVE_SYS_RESOURCE_H
10101013

0 commit comments

Comments
 (0)