chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c441258
)
basic/random-util: add new header for getrandom()
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 19 Apr 2017 20:13:27 +0000
(16:13 -0400)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:51 +0000
(09:46 +0200)
There's some confusion: older man pages specify that linux/random.h
contains getrandom, but newer glibc has it in sys/random.h. Detect if
the newer header is available and include it. We still need the older
header for the flags.
src/basic/random-util.c
patch
|
blob
|
history
diff --git
a/src/basic/random-util.c
b/src/basic/random-util.c
index ad7b3eedf2c1d5ffb7ca92662bff43e070878872..b216be579d28c0fe2d250b263dfe0f49de2ef5fb 100644
(file)
--- a/
src/basic/random-util.c
+++ b/
src/basic/random-util.c
@@
-27,7
+27,13
@@
#include <stdint.h>
#ifdef HAVE_SYS_AUXV_H
-#include <sys/auxv.h>
+# include <sys/auxv.h>
+#endif
+
+#ifdef USE_SYS_RANDOM_H
+# include <sys/random.h>
+#else
+# include <linux/random.h>
#endif
#include "fd-util.h"