]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing: move rand related definitions to missing_random.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Dec 2018 05:47:47 +0000 (06:47 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Dec 2018 12:26:55 +0000 (13:26 +0100)
src/basic/meson.build
src/basic/missing.h
src/basic/missing_random.h [new file with mode: 0644]

index 3730930c7f61119d49d1b3abb42d5c823df8d76f..8fc7665a9132a925f44f3b7a7e263d4ea21b9b8d 100644 (file)
@@ -108,6 +108,7 @@ basic_sources = files('''
         missing_mman.h
         missing_network.h
         missing_prctl.h
+        missing_random.h
         missing_resource.h
         missing_securebits.h
         missing_socket.h
index 850709baace79972384ab1eaefce22ba7776a2a4..0651a397c94c6c56b968eb4f353adb0f1f88a85f 100644 (file)
@@ -9,14 +9,6 @@
 #include <stdlib.h>
 #include <sys/syscall.h>
 
-#ifndef GRND_NONBLOCK
-#define GRND_NONBLOCK 0x0001
-#endif
-
-#ifndef GRND_RANDOM
-#define GRND_RANDOM 0x0002
-#endif
-
 #ifndef FS_NOCOW_FL
 #define FS_NOCOW_FL 0x00800000
 #endif
 #include "missing_mman.h"
 #include "missing_network.h"
 #include "missing_prctl.h"
+#include "missing_random.h"
 #include "missing_resource.h"
 #include "missing_socket.h"
 #include "missing_timerfd.h"
diff --git a/src/basic/missing_random.h b/src/basic/missing_random.h
new file mode 100644 (file)
index 0000000..2e76031
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#if USE_SYS_RANDOM_H
+#  include <sys/random.h>
+#else
+#  include <linux/random.h>
+#endif
+
+#ifndef GRND_NONBLOCK
+#define GRND_NONBLOCK 0x0001
+#endif
+
+#ifndef GRND_RANDOM
+#define GRND_RANDOM 0x0002
+#endif