Skip to content

Use getrandom system call on Linux instead of reading from /dev/urandom #59

@happy5214

Description

@happy5214

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");
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions