]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add GRND_INSECURE from Linux 5.6 to sys/random.h
authorJoseph Myers <joseph@codesourcery.com>
Thu, 9 Apr 2020 21:21:16 +0000 (21:21 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 9 Apr 2020 21:21:16 +0000 (21:21 +0000)
This patch adds the GRND_INSECURE constant from Linux 5.6 to glibc's
sys/random.h.  This is also added to the documentation.  The constant
acts as a no-op for the Hurd implementation (as that doesn't check
whether the flags are known), which is semantically fine, while older
Linux kernels reject unknown flags with an EINVAL error.

Tested for x86_64.

manual/crypt.texi
stdlib/sys/random.h

index c41b911c8fb553ffdf4c61d69162ceccd2a7a5e2..af23dd7847ddd22a8349bf9eb98de31cf3fa5882 100644 (file)
@@ -301,6 +301,9 @@ booted and the randomness source has not yet been initialized.
 @item GRND_NONBLOCK
 Instead of blocking, return to the caller immediately if no data is
 available.
+
+@item GRND_INSECURE
+Write random data that may not be cryptographically secure.
 @end table
 
 Unlike @code{getentropy}, the @code{getrandom} function is a
index b351ef5c8c1549daf16c0d23b053052c2448d1c0..1df6e9b844601aadf0eaaafbcd1709acae1fef13 100644 (file)
@@ -25,6 +25,7 @@
 /* Flags for use with getrandom.  */
 #define GRND_NONBLOCK 0x01
 #define GRND_RANDOM 0x02
+#define GRND_INSECURE 0x04
 
 __BEGIN_DECLS