Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for FreeBSD's implementation of getrandom, so :func:`os.getrandom` works there too.
3 changes: 3 additions & 0 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
# include <sys/sysctl.h>
#endif

#ifdef HAVE_SYS_RANDOM_H
# include <sys/random.h> // GRND_RANDOM on FreeBSD and NetBSD
#endif
#ifdef HAVE_LINUX_RANDOM_H
# include <linux/random.h> // GRND_RANDOM
#endif
Expand Down
2 changes: 1 addition & 1 deletion Python/bootstrap_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# include <linux/random.h> // GRND_NONBLOCK
# endif
# if defined(HAVE_SYS_RANDOM_H) && (defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY))
# include <sys/random.h> // getrandom()
# include <sys/random.h> // getrandom(), GRND_NONBLOCK on FreeBSD and NetBSD
# endif
# if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)
# include <sys/syscall.h> // SYS_getrandom
Expand Down
2 changes: 1 addition & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7377,7 +7377,7 @@ AC_LINK_IFELSE(
#include <stddef.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/random.h>
#include <sys/random.h>
int main(void) {
char buffer[1];
Expand Down
Loading