]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: move missing_random.h -> include/sys/random.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Jun 2025 23:58:34 +0000 (08:58 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Jul 2025 03:24:32 +0000 (12:24 +0900)
src/basic/include/sys/random.h [moved from src/basic/missing_random.h with 60% similarity]
src/basic/random-util.c
src/random-seed/random-seed-tool.c

similarity index 60%
rename from src/basic/missing_random.h
rename to src/basic/include/sys/random.h
index 61b8c11ed0a0b710313cfc1d907759a91589ca29..c0d1197aa500041fb0bee44bd011c2cda9bbbe86 100644 (file)
@@ -1,13 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/random.h> /* IWYU pragma: export */
-
-#include "forward.h"
+#include_next <sys/random.h>
 
 /* Defined since glibc-2.32. */
 #ifndef GRND_INSECURE
 #  define GRND_INSECURE 0x0004
 #else
-assert_cc(GRND_INSECURE == 0x0004);
+_Static_assert(GRND_INSECURE == 0x0004, "");
 #endif
index 17268732374fdac26b9aff22914aa49546d13fe2..ece0e419437f57e44f6218b514e84163daed3578 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 #include <sys/auxv.h>
 #include <sys/ioctl.h>
+#include <sys/random.h>
 #include <threads.h>
 #include <unistd.h>
 
@@ -15,7 +16,6 @@
 #include "io-util.h"
 #include "iovec-util.h"
 #include "log.h"
-#include "missing_random.h"
 #include "parse-util.h"
 #include "pidfd-util.h"
 #include "process-util.h"
index a99df0e08e4de32056c3ca862cf6b3159d6661be..b539c1f654fb62a084a4c2b2b04e248b21c2d401 100644 (file)
@@ -3,6 +3,7 @@
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdlib.h>
+#include <sys/random.h>
 #include <sys/stat.h>
 #include <sys/xattr.h>
 #include <unistd.h>
@@ -17,7 +18,6 @@
 #include "io-util.h"
 #include "log.h"
 #include "main-func.h"
-#include "missing_random.h"
 #include "mkdir.h"
 #include "parse-util.h"
 #include "pretty-print.h"