2 * include/linux/random.h
4 * Include file for the random number generator.
7 #ifndef _UAPI_LINUX_RANDOM_H
8 #define _UAPI_LINUX_RANDOM_H
10 #include <linux/types.h>
11 #include <linux/ioctl.h>
12 #include <linux/irqnr.h>
14 /* ioctl()'s for the random number generator */
16 /* Get the entropy count. */
17 #define RNDGETENTCNT _IOR( 'R', 0x00, int )
19 /* Add to (or subtract from) the entropy count. (Superuser only.) */
20 #define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
22 /* Get the contents of the entropy pool. (Superuser only.) */
23 #define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
26 * Write bytes into the entropy pool and add to the entropy count.
29 #define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
31 /* Clear entropy count to 0. (Superuser only.) */
32 #define RNDZAPENTCNT _IO( 'R', 0x04 )
34 /* Clear the entropy pool and associated counters. (Superuser only.) */
35 #define RNDCLEARPOOL _IO( 'R', 0x06 )
37 struct rand_pool_info
{
44 * Flags for getrandom(2)
46 * GRND_NONBLOCK Don't block and return EAGAIN instead
47 * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
49 #define GRND_NONBLOCK 0x0001
50 #define GRND_RANDOM 0x0002
52 #endif /* _UAPI_LINUX_RANDOM_H */