Description
Proposal Details
Currently when we set the random seed on Linux, the runtime's fallback path needs to open, read and then close "/dev/urandom". This requires 3 system calls. A single getrandom does the same thing and is simpler than using open() -> read() -> closefd()
.
#67001 Raised the minimum supported Linux kernel version to 3.17+, so that "getrandom(2)" can be used in the runtime package and we can do all the things in one system call now.
We can wrap getrandom with internal/runtime/syscall.Syscall6
so that the helper function readRandom
will no longer need to open and close "/dev/urandom".
Since Go 1.24 will only support Linux kernel 3.17+ (or 3.10+ with getrandom patches), I think a fallback is unnecessary (and a fallback can easily be added if someone needs it).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status