Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / uapi / linux / random.h
blobc34f4490d025ff6802aca2ef6bd2237906f889b2
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3 * include/linux/random.h
5 * Include file for the random number generator.
6 */
8 #ifndef _UAPI_LINUX_RANDOM_H
9 #define _UAPI_LINUX_RANDOM_H
11 #include <linux/types.h>
12 #include <linux/ioctl.h>
13 #include <linux/irqnr.h>
15 /* ioctl()'s for the random number generator */
17 /* Get the entropy count. */
18 #define RNDGETENTCNT _IOR( 'R', 0x00, int )
20 /* Add to (or subtract from) the entropy count. (Superuser only.) */
21 #define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
23 /* Get the contents of the entropy pool. (Superuser only.) */
24 #define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
26 /*
27 * Write bytes into the entropy pool and add to the entropy count.
28 * (Superuser only.)
30 #define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
32 /* Clear entropy count to 0. (Superuser only.) */
33 #define RNDZAPENTCNT _IO( 'R', 0x04 )
35 /* Clear the entropy pool and associated counters. (Superuser only.) */
36 #define RNDCLEARPOOL _IO( 'R', 0x06 )
38 struct rand_pool_info {
39 int entropy_count;
40 int buf_size;
41 __u32 buf[0];
45 * Flags for getrandom(2)
47 * GRND_NONBLOCK Don't block and return EAGAIN instead
48 * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
50 #define GRND_NONBLOCK 0x0001
51 #define GRND_RANDOM 0x0002
53 #endif /* _UAPI_LINUX_RANDOM_H */