From c35966b1258e1f12775ddc91a8020d3f9561b9d0 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 10 Nov 2016 21:24:35 +0100 Subject: [PATCH] getrandom.2: Note advantages of fact that getrandom() doesn't use file descriptors Inspired by Nikos Mavrogiannopoulos's post at http://nmav.gnutls.org/2016/10/random-generator-linux.html Signed-off-by: Michael Kerrisk --- man2/getrandom.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/man2/getrandom.2 b/man2/getrandom.2 index 32c55bde2..e662a2168 100644 --- a/man2/getrandom.2 +++ b/man2/getrandom.2 @@ -157,6 +157,23 @@ was introduced in version 3.17 of the Linux kernel. .SH CONFORMING TO This system call is Linux-specific. .SH NOTES +Unlike +.IR /dev/random +and +.IR /dev/random , +.BR getrandom () +does not involve the use of pathnames or file descriptors. +Thus, +.BR getrandom () +can be useful in cases where +.BR chroot (2) +makes +.I /dev +pathnames invisible, +and where an application (e.g., a daemon during start-up) +closes a file descriptor for one of these files +that was opened by a library. +.\" .SS Maximum number of bytes returned As of Linux 3.19 the following limits apply: .IP * 3