For Linux only, the Linux man pages recommend using the getrandom() system call (found in sys/random.h and introduced in kernel version 3.17) instead of reading from /dev/urandom directly. Reasons include the possibility of /dev being hidden by chroot and the function generally being safer. /dev/urandom is read from in
|
FILE* rand_device = fopen("/dev/urandom", "r"); |
.
For Linux only, the Linux
manpages recommend using thegetrandom()system call (found insys/random.hand introduced in kernel version 3.17) instead of reading from/dev/urandomdirectly. Reasons include the possibility of/devbeing hidden bychrootand the function generally being safer./dev/urandomis read from inyafu/ytools/util.c
Line 217 in abc4c09