4 ms·
I may have to update my manual, which currently recommends getrandom() on Linux, and arc4random_buf() on BSD. https://monocypher.org/manual/#Random_number_gener
by loup-vaillant 9y ago
I may have to update my manual, which currently recommends getrandom() on Linux, and arc4random_buf() on BSD. https://monocypher.org/manual/#Random_number_generation https://monocypher.org/manual/#Random_number_generation
On which systems is getentropy() available? My Ubuntu 16.04 doesn't seem to have it.
- deleted 9y ago[deleted]
- justincormack 9y agoIt is getrandom(2) on Linux, similar to getentropy(2) on OpenBSD. It should be in 16.04, it is kernel 3.17+ although it was not added to glibc until recenrtly so you might have to use the syscall directly.
- deathanatos 9y agogetentropy(2) exists on Linux. I do not know when it was introduced, but my Arch system has it. (I feel as if your comment implies that it is the BSD equivalent to getrandom(2).)
- loeg 9y agoOpenBSD introduced getentropy(2). Since it is a subset of getrandom(2) functionality, glibc added a compatibility wrapper that provides the same ABI. (FreeBSD only recently added the getrandom(2) syscall and getentropy(3) libc wrapper functions in -CURRENT.)
- jwilk 9y agoThe getentropy() function first appeared in glibc 2.25. http://man7.org/linux/man-pages/man3/getentropy.3.html http://man7.org/linux/man-pages/man3/getentropy.3.html