random: introduce getrandom(2) system call 79/229779/1
authorDongkyun Son <dongkyun.s@samsung.com>
Fri, 3 Apr 2020 08:28:16 +0000 (17:28 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Fri, 3 Apr 2020 08:34:55 +0000 (17:34 +0900)
(partially cherry-picked from c6e9d6f38894798696f23c8084ca7edbf16ee895)

Change-Id: Ic2733261ff3187df1744fee1d52a3124d63e63f1
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
usr/include/linux/random.h

index 80e6445..1f166ce 100644 (file)
@@ -40,11 +40,13 @@ struct rand_pool_info {
        __u32   buf[0];
 };
 
-struct rnd_state {
-       __u32 s1, s2, s3;
-};
-
-/* Exported functions */
-
+/*
+ * Flags for getrandom(2)
+ *
+ * GRND_NONBLOCK       Don't block and return EAGAIN instead
+ * GRND_RANDOM         Use the /dev/random pool instead of /dev/urandom
+ */
+#define GRND_NONBLOCK  0x0001
+#define GRND_RANDOM    0x0002
 
 #endif /* _LINUX_RANDOM_H */