]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: move missing_mman.h -> include/sys/mman.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Jun 2025 00:10:09 +0000 (09:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Jul 2025 03:27:27 +0000 (12:27 +0900)
This also makes memfd-util.h include sys/mman.h, as it is necessary for
specifying flags to memfd_create_wrapper() or memfd_new_full().

src/basic/include/sys/mman.h [moved from src/basic/missing_mman.h with 62% similarity]
src/basic/memfd-util.c
src/basic/memfd-util.h
src/home/homed-home.c
src/journal/journald-native.c
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-journal/journal-send.c
src/shared/data-fd-util.c
src/shared/serialize.c
src/test/test-memfd-util.c

similarity index 62%
rename from src/basic/missing_mman.h
rename to src/basic/include/sys/mman.h
index b3f79935fec4a2c3211a48ba51a9bf94221bb2d9..50b03bddf03dd06728ad5786b3051e58fab663b8 100644 (file)
@@ -1,20 +1,18 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/mman.h> /* IWYU pragma: export */
-
-#include "forward.h"
+#include_next <sys/mman.h>
 
 /* since glibc-2.38 */
 #ifndef MFD_NOEXEC_SEAL
 #  define MFD_NOEXEC_SEAL 0x0008U
 #else
-assert_cc(MFD_NOEXEC_SEAL == 0x0008U);
+_Static_assert(MFD_NOEXEC_SEAL == 0x0008U, "");
 #endif
 
 /* since glibc-2.38 */
 #ifndef MFD_EXEC
 #  define MFD_EXEC 0x0010U
 #else
-assert_cc(MFD_EXEC == 0x0010U);
+_Static_assert(MFD_EXEC == 0x0010U, "");
 #endif
index d3a1a8457e0b05f649f8cee013653afd0b5f758f..a7adab2bfa2cd87bed20956d87ad3eb6e90720f9 100644 (file)
@@ -9,7 +9,6 @@
 #include "errno-util.h"
 #include "fd-util.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "missing_sched.h"
 #include "string-util.h"
 #include "utf8.h"
index efa2f7c616bc18cab263706751f3d809dbd203c8..befe41ac436e642c8c50c3386abd7b9134436c08 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <sys/mman.h>           /* IWYU pragma: export */
+
 #include "forward.h"
 
 int memfd_create_wrapper(const char *name, unsigned mode);
index 90e3944f6bbe043a795c74ad0ce4be17c0b4d77b..d8683b82114122533eccf5a087907d842cd26a3e 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/mman.h>
 #include <sys/vfs.h>
 #include <unistd.h>
 
@@ -29,7 +28,6 @@
 #include "json-util.h"
 #include "log.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "mkdir.h"
 #include "ordered-set.h"
 #include "parse-util.h"
index a428108d1456079f9e38334f333067cf67a8efa1..4288bd4f3f5f5f0fa1a8018ae7cc5603ea331c65 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/mman.h>
 #include <sys/statvfs.h>
 #include <unistd.h>
 
index 22ae01204146c65a83cf7457e100bb01bfa10cdf..64f4f0e22389fed40a1e2be5815ca1efb9d52334 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/mman.h>
-
 #include "sd-bus.h"
 
 #include "alloc-util.h"
index 8a1e0b1fdf187ebef844af2a72bd7d35d689fe5a..e838e7e0d7c11855f03239196f28ff107c490995 100644 (file)
@@ -18,7 +18,6 @@
 #include "journal-send.h"
 #include "log.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "process-util.h"
 #include "socket-util.h"
 #include "stdio-util.h"
index a9b799bd610676dd0fcecce618aeed4f3298d9cb..c91d05614972bce74c4f1d9b5b025555295a5d46 100644 (file)
@@ -8,7 +8,6 @@
 #include "fd-util.h"
 #include "fs-util.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "tmpfile-util.h"
 
 /* When the data is smaller or equal to 64K, try to place the copy in a memfd */
index a0b41b281e51ecec7c0d814187a4fab433267697..f7d60ac0b75b48e87cf480e8671cabe5bdd80264 100644 (file)
@@ -17,7 +17,6 @@
 #include "image-policy.h"
 #include "log.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "parse-util.h"
 #include "pidref.h"
 #include "ratelimit.h"
index 2cfae57f66dbf2ad4a49e3ec0cf60409450b12e5..971a9a8dc0ac4dbf06527c04e9e058dfc7ce22e7 100644 (file)
@@ -5,7 +5,6 @@
 #include "errno-util.h"
 #include "fd-util.h"
 #include "memfd-util.h"
-#include "missing_mman.h"
 #include "tests.h"
 
 TEST(memfd_get_sealed) {