1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 # if __GNUC__ >= 3
18 @PRAGMA_SYSTEM_HEADER@
19 # endif
20 @PRAGMA_COLUMNS@
21
22 #ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
23
24 #if @HAVE_SYS_RANDOM_H@
25
26
27
28
29 # ifndef __GLIBC__
30 # include <stddef.h>
31 # endif
32
33
34
35 # if defined __APPLE__ && defined __MACH__
36 # include <sys/types.h>
37 # include <stdlib.h>
38 # endif
39
40
41 # @INCLUDE_NEXT@ @NEXT_SYS_RANDOM_H@
42
43 #endif
44
45 #ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
46 #define _@GUARD_PREFIX@_SYS_RANDOM_H
47
48
49 #if !_GL_CONFIG_H_INCLUDED
50 #error "Please include config.h first."
51 #endif
52
53 #include <sys/types.h>
54
55
56 #ifndef GRND_NONBLOCK
57 # define GRND_NONBLOCK 1
58 # define GRND_RANDOM 2
59 #endif
60
61
62
63
64
65
66
67
68
69
70
71 #if @GNULIB_GETRANDOM@
72
73 # if @REPLACE_GETRANDOM@
74 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
75 # undef getrandom
76 # define getrandom rpl_getrandom
77 # endif
78 _GL_FUNCDECL_RPL (getrandom, ssize_t,
79 (void *buffer, size_t length, unsigned int flags)
80 _GL_ARG_NONNULL ((1)));
81 _GL_CXXALIAS_RPL (getrandom, ssize_t,
82 (void *buffer, size_t length, unsigned int flags));
83 # else
84 # if !@HAVE_GETRANDOM@
85 _GL_FUNCDECL_SYS (getrandom, ssize_t,
86 (void *buffer, size_t length, unsigned int flags)
87 _GL_ARG_NONNULL ((1)));
88 # endif
89 _GL_CXXALIAS_SYS (getrandom, ssize_t,
90 (void *buffer, size_t length, unsigned int flags));
91 # endif
92 # if __GLIBC__ + (__GLIBC_MINOR__ >= 25) > 2
93 _GL_CXXALIASWARN (getrandom);
94 # endif
95 #elif defined GNULIB_POSIXCHECK
96 # undef getrandom
97 # if HAVE_RAW_DECL_GETRANDOM
98 _GL_WARN_ON_USE (getrandom, "getrandom is unportable - "
99 "use gnulib module getrandom for portability");
100 # endif
101 #endif
102
103
104 #endif
105 #endif