From ec3f6df9cfb4dd2ae03a5abba61edbdaca6fbcaa Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 4 Dec 2018 10:44:55 +0100 Subject: [PATCH 01/27] missing: move several network related entries to missing_network.h --- src/basic/missing.h | 13 ------------- src/basic/missing_network.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index e3ee46bcce..0f4605cb21 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -116,10 +116,6 @@ struct sockaddr_vm { #define SOL_NETLINK 270 #endif -#ifndef NETLINK_LIST_MEMBERSHIPS -#define NETLINK_LIST_MEMBERSHIPS 9 -#endif - #ifndef SOL_SCTP #define SOL_SCTP 132 #endif @@ -252,15 +248,6 @@ struct sockaddr_vm { #define BPF_XOR 0xa0 #endif -/* Note that LOOPBACK_IFINDEX is currently not exported by the - * kernel/glibc, but hardcoded internally by the kernel. However, as - * it is exported to userspace indirectly via rtnetlink and the - * ioctls, and made use of widely we define it here too, in a way that - * is compatible with the kernel's internal definition. */ -#ifndef LOOPBACK_IFINDEX -#define LOOPBACK_IFINDEX 1 -#endif - #ifndef MAX_AUDIT_MESSAGE_LENGTH #define MAX_AUDIT_MESSAGE_LENGTH 8970 #endif diff --git a/src/basic/missing_network.h b/src/basic/missing_network.h index cba236b64d..2dfbe26882 100644 --- a/src/basic/missing_network.h +++ b/src/basic/missing_network.h @@ -116,6 +116,11 @@ #define NET_NAME_RENAMED 4 #endif +/* netlink.h */ +#ifndef NETLINK_LIST_MEMBERSHIPS /* b42be38b2778eda2237fc759e55e3b698b05b315 (4.2) */ +#define NETLINK_LIST_MEMBERSHIPS 9 +#endif + /* rtnetlink.h */ #ifndef RTA_PREF #define RTA_PREF 20 @@ -128,3 +133,12 @@ #ifndef RTA_EXPIRES #define RTA_EXPIRES 23 #endif + +/* Note that LOOPBACK_IFINDEX is currently not exported by the + * kernel/glibc, but hardcoded internally by the kernel. However, as + * it is exported to userspace indirectly via rtnetlink and the + * ioctls, and made use of widely we define it here too, in a way that + * is compatible with the kernel's internal definition. */ +#ifndef LOOPBACK_IFINDEX +#define LOOPBACK_IFINDEX 1 +#endif From 666a84eacae2af1407862b624bf1f1b1472e5f20 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:22:50 +0100 Subject: [PATCH 02/27] macro: include errno.h As several macros touch errno. --- src/basic/macro.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic/macro.h b/src/basic/macro.h index 3b7971fe84..1971e912db 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -2,6 +2,7 @@ #pragma once #include +#include #include #include #include From 9cb6c6ecb0881045a60f2f490223835cdbca195e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:24:20 +0100 Subject: [PATCH 03/27] missing: use integer types used by kernel By using them, we can decrease included headers except linux/types.h. --- src/basic/missing_input.h | 7 ++++--- src/basic/missing_stat.h | 40 +++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/basic/missing_input.h b/src/basic/missing_input.h index 93cdf9a310..b91ccb6485 100644 --- a/src/basic/missing_input.h +++ b/src/basic/missing_input.h @@ -2,6 +2,7 @@ #pragma once #include +#include /* linux@c7dc65737c9a607d3e6f8478659876074ad129b8 (3.12) */ #ifndef EVIOCREVOKE @@ -11,9 +12,9 @@ /* linux@06a16293f71927f756dcf37558a79c0b05a91641 (4.4) */ #ifndef EVIOCSMASK struct input_mask { - uint32_t type; - uint32_t codes_size; - uint64_t codes_ptr; + __u32 type; + __u32 codes_size; + __u64 codes_ptr; }; #define EVIOCGMASK _IOR('E', 0x92, struct input_mask) diff --git a/src/basic/missing_stat.h b/src/basic/missing_stat.h index 85f98e2690..5116206a2e 100644 --- a/src/basic/missing_stat.h +++ b/src/basic/missing_stat.h @@ -11,32 +11,32 @@ /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ #if !HAVE_STRUCT_STATX struct statx_timestamp { - int64_t tv_sec; - uint32_t tv_nsec; - uint32_t __reserved; + __s64 tv_sec; + __u32 tv_nsec; + __s32 __reserved; }; struct statx { - uint32_t stx_mask; - uint32_t stx_blksize; - uint64_t stx_attributes; - uint32_t stx_nlink; - uint32_t stx_uid; - uint32_t stx_gid; - uint16_t stx_mode; - uint16_t __spare0[1]; - uint64_t stx_ino; - uint64_t stx_size; - uint64_t stx_blocks; - uint64_t stx_attributes_mask; + __u32 stx_mask; + __u32 stx_blksize; + __u64 stx_attributes; + __u32 stx_nlink; + __u32 stx_uid; + __u32 stx_gid; + __u16 stx_mode; + __u16 __spare0[1]; + __u64 stx_ino; + __u64 stx_size; + __u64 stx_blocks; + __u64 stx_attributes_mask; struct statx_timestamp stx_atime; struct statx_timestamp stx_btime; struct statx_timestamp stx_ctime; struct statx_timestamp stx_mtime; - uint32_t stx_rdev_major; - uint32_t stx_rdev_minor; - uint32_t stx_dev_major; - uint32_t stx_dev_minor; - uint64_t __spare2[14]; + __u32 stx_rdev_major; + __u32 stx_rdev_minor; + __u32 stx_dev_major; + __u32 stx_dev_minor; + __u64 __spare2[14]; }; #endif From 8f8495702ed6e17acba738430d710c820196ab8e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:27:51 +0100 Subject: [PATCH 04/27] missing: move one more network related definition to missing_network.h --- src/basic/missing.h | 5 ----- src/basic/missing_network.h | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index 0f4605cb21..a057d06277 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -264,10 +263,6 @@ struct sockaddr_vm { #define KCMP_FILE 0 #endif -#ifndef ETHERTYPE_LLDP -#define ETHERTYPE_LLDP 0x88cc -#endif - #ifndef SOL_ALG #define SOL_ALG 279 #endif diff --git a/src/basic/missing_network.h b/src/basic/missing_network.h index 2dfbe26882..d9c73c54a9 100644 --- a/src/basic/missing_network.h +++ b/src/basic/missing_network.h @@ -3,6 +3,7 @@ #include #include +#include #include "missing_ethtool.h" #include "missing_fib_rules.h" @@ -142,3 +143,8 @@ #ifndef LOOPBACK_IFINDEX #define LOOPBACK_IFINDEX 1 #endif + +/* Not exposed yet. Similar values are defined in net/ethernet.h */ +#ifndef ETHERTYPE_LLDP +#define ETHERTYPE_LLDP 0x88cc +#endif From 49f610337549324e88504f2364b637ff00ba8c26 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:29:22 +0100 Subject: [PATCH 05/27] missing: drop old OOM related definitions These are exposed earlier than linux-3.11. Let's just include linux/oom.h. --- src/basic/missing.h | 9 --------- src/basic/parse-util.c | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index a057d06277..f7ab2859a4 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -87,14 +86,6 @@ struct sockaddr_vm { #define IP_FREEBIND 15 #endif -#ifndef OOM_SCORE_ADJ_MIN -#define OOM_SCORE_ADJ_MIN (-1000) -#endif - -#ifndef OOM_SCORE_ADJ_MAX -#define OOM_SCORE_ADJ_MAX 1000 -#endif - #ifndef AUDIT_SERVICE_START #define AUDIT_SERVICE_START 1130 /* Service (daemon) start */ #endif diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index 5b4e94c134..87724af693 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include From bd0937ddb37291ea97c7ba4cb70d04c4bf6a3a0f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:30:19 +0100 Subject: [PATCH 06/27] random-util: drop duplicated linux/random.h --- src/basic/random-util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 4a36ad5119..f7decf60b6 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include From 851d66fac2cbfe6801703451b3d84426421a895a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:32:41 +0100 Subject: [PATCH 07/27] missing: move syscall related definitions to missing_syscall.h --- src/basic/missing.h | 9 --------- src/basic/missing_syscall.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index f7ab2859a4..6519131025 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -12,16 +12,11 @@ #include #include #include -#include #if HAVE_AUDIT #include #endif -#ifdef ARCH_MIPS -#include -#endif - #if HAVE_LINUX_VM_SOCKETS_H #include #else @@ -250,10 +245,6 @@ struct sockaddr_vm { #define RENAME_NOREPLACE (1 << 0) #endif -#ifndef KCMP_FILE -#define KCMP_FILE 0 -#endif - #ifndef SOL_ALG #define SOL_ALG 279 #endif diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index b009ea5bfa..d5d4b26acb 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -6,10 +6,20 @@ #include #include #include +#include + +#ifdef ARCH_MIPS +#include +#endif #include "missing_keyctl.h" #include "missing_stat.h" +/* linux/kcmp.h */ +#ifndef KCMP_FILE /* 3f4994cfc15f38a3159c6e3a4b3ab2e1481a6b02 (3.19) */ +#define KCMP_FILE 0 +#endif + #if !HAVE_PIVOT_ROOT static inline int missing_pivot_root(const char *new_root, const char *put_old) { return syscall(__NR_pivot_root, new_root, put_old); @@ -257,7 +267,7 @@ static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long i /* ======================================================================= */ #if !HAVE_KEYCTL -static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) { +static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { # ifdef __NR_keyctl return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5); # else From 0e7117d00161a96166e1e2e920c0f358ed19930f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:34:04 +0100 Subject: [PATCH 08/27] missing: move audit related definitions to missing_audit.h --- src/basic/meson.build | 1 + src/basic/missing.h | 22 +--------------------- src/basic/missing_audit.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 src/basic/missing_audit.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 153a38f9d0..4713c1d364 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -91,6 +91,7 @@ basic_sources = files(''' memfd-util.h mempool.c mempool.h + missing_audit.h missing_btrfs.h missing_btrfs_tree.h missing_capability.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 6519131025..da10b10a2e 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -6,17 +6,12 @@ #include #include #include -#include #include #include #include #include #include -#if HAVE_AUDIT -#include -#endif - #if HAVE_LINUX_VM_SOCKETS_H #include #else @@ -81,14 +76,6 @@ struct sockaddr_vm { #define IP_FREEBIND 15 #endif -#ifndef AUDIT_SERVICE_START -#define AUDIT_SERVICE_START 1130 /* Service (daemon) start */ -#endif - -#ifndef AUDIT_SERVICE_STOP -#define AUDIT_SERVICE_STOP 1131 /* Service (daemon) stop */ -#endif - #ifndef TIOCVHANGUP #define TIOCVHANGUP 0x5437 #endif @@ -233,14 +220,6 @@ struct sockaddr_vm { #define BPF_XOR 0xa0 #endif -#ifndef MAX_AUDIT_MESSAGE_LENGTH -#define MAX_AUDIT_MESSAGE_LENGTH 8970 -#endif - -#ifndef AUDIT_NLGRP_MAX -#define AUDIT_NLGRP_READLOG 1 -#endif - #ifndef RENAME_NOREPLACE #define RENAME_NOREPLACE (1 << 0) #endif @@ -280,6 +259,7 @@ struct sockaddr_vm { #define TASK_COMM_LEN 16 #endif +#include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" #include "missing_input.h" diff --git a/src/basic/missing_audit.h b/src/basic/missing_audit.h new file mode 100644 index 0000000000..b00d537be2 --- /dev/null +++ b/src/basic/missing_audit.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#if HAVE_AUDIT +#include +#endif + +#ifndef AUDIT_SERVICE_START +#define AUDIT_SERVICE_START 1130 /* Service (daemon) start */ +#endif + +#ifndef AUDIT_SERVICE_STOP +#define AUDIT_SERVICE_STOP 1131 /* Service (daemon) stop */ +#endif + +#ifndef MAX_AUDIT_MESSAGE_LENGTH +#define MAX_AUDIT_MESSAGE_LENGTH 8970 +#endif + +#ifndef AUDIT_NLGRP_MAX +#define AUDIT_NLGRP_READLOG 1 +#endif From 6c76de27ee06a02f9a68e94b1647d01eee70778b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:36:30 +0100 Subject: [PATCH 09/27] missing: move resource related definitions to missing_resource.h --- src/basic/meson.build | 1 + src/basic/missing.h | 9 +-------- src/basic/missing_resource.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 src/basic/missing_resource.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 4713c1d364..930226dd90 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -106,6 +106,7 @@ basic_sources = files(''' missing_magic.h missing_network.h missing_prctl.h + missing_resource.h missing_securebits.h missing_stat.h missing_syscall.h diff --git a/src/basic/missing.h b/src/basic/missing.h index da10b10a2e..6d17aa9cf6 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -29,13 +28,6 @@ struct sockaddr_vm { }; #endif /* !HAVE_LINUX_VM_SOCKETS_H */ -#ifndef RLIMIT_RTTIME -#define RLIMIT_RTTIME 15 -#endif - -/* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is */ -#define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : RLIMIT_NLIMITS) - #ifndef F_LINUX_SPECIFIC_BASE #define F_LINUX_SPECIFIC_BASE 1024 #endif @@ -266,6 +258,7 @@ struct sockaddr_vm { #include "missing_magic.h" #include "missing_network.h" #include "missing_prctl.h" +#include "missing_resource.h" #include "missing_type.h" #include "missing_syscall.h" diff --git a/src/basic/missing_resource.h b/src/basic/missing_resource.h new file mode 100644 index 0000000000..22ba8abfc6 --- /dev/null +++ b/src/basic/missing_resource.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#ifndef RLIMIT_RTTIME +#define RLIMIT_RTTIME 15 +#endif + +/* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is */ +#define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : RLIMIT_NLIMITS) From dea72eda9cdbfeedd24cbe8c734ad0639bf96cde Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:38:40 +0100 Subject: [PATCH 10/27] missing: move fcntl related definitions to missing_fcntl.h --- src/basic/meson.build | 1 + src/basic/missing.h | 58 +------------------------------------ src/basic/missing_fcntl.h | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 57 deletions(-) create mode 100644 src/basic/missing_fcntl.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 930226dd90..764c6c9bc6 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -96,6 +96,7 @@ basic_sources = files(''' missing_btrfs_tree.h missing_capability.h missing_ethtool.h + missing_fcntl.h missing_fib_rules.h missing_fou.h missing_if_bridge.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 6d17aa9cf6..3cf8d7c915 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -4,7 +4,6 @@ /* Missing glibc definitions to access certain kernel APIs */ #include -#include #include #include #include @@ -28,34 +27,6 @@ struct sockaddr_vm { }; #endif /* !HAVE_LINUX_VM_SOCKETS_H */ -#ifndef F_LINUX_SPECIFIC_BASE -#define F_LINUX_SPECIFIC_BASE 1024 -#endif - -#ifndef F_SETPIPE_SZ -#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) -#endif - -#ifndef F_GETPIPE_SZ -#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) -#endif - -#ifndef F_ADD_SEALS -#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) -#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) - -#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ -#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ -#define F_SEAL_GROW 0x0004 /* prevent file from growing */ -#define F_SEAL_WRITE 0x0008 /* prevent writes */ -#endif - -#ifndef F_OFD_GETLK -#define F_OFD_GETLK 36 -#define F_OFD_SETLK 37 -#define F_OFD_SETLKW 38 -#endif - #ifndef MFD_ALLOW_SEALING #define MFD_ALLOW_SEALING 0x0002U #endif @@ -148,10 +119,6 @@ struct sockaddr_vm { #define DM_DEFERRED_REMOVE (1 << 17) #endif -#ifndef MAX_HANDLE_SZ -#define MAX_HANDLE_SZ 128 -#endif - #if ! HAVE_SECURE_GETENV # if HAVE___SECURE_GETENV # define secure_getenv __secure_getenv @@ -184,30 +151,6 @@ struct sockaddr_vm { # define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) #endif -/* The precise definition of __O_TMPFILE is arch specific; use the - * values defined by the kernel (note: some are hexa, some are octal, - * duplicated as-is from the kernel definitions): - * - alpha, parisc, sparc: each has a specific value; - * - others: they use the "generic" value. - */ - -#ifndef __O_TMPFILE -#if defined(__alpha__) -#define __O_TMPFILE 0100000000 -#elif defined(__parisc__) || defined(__hppa__) -#define __O_TMPFILE 0400000000 -#elif defined(__sparc__) || defined(__sparc64__) -#define __O_TMPFILE 0x2000000 -#else -#define __O_TMPFILE 020000000 -#endif -#endif - -/* a horrid kludge trying to make sure that this will fail on old kernels */ -#ifndef O_TMPFILE -#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) -#endif - #ifndef BPF_XOR #define BPF_XOR 0xa0 #endif @@ -254,6 +197,7 @@ struct sockaddr_vm { #include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" +#include "missing_fcntl.h" #include "missing_input.h" #include "missing_magic.h" #include "missing_network.h" diff --git a/src/basic/missing_fcntl.h b/src/basic/missing_fcntl.h new file mode 100644 index 0000000000..5d1c6352f4 --- /dev/null +++ b/src/basic/missing_fcntl.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#ifndef F_LINUX_SPECIFIC_BASE +#define F_LINUX_SPECIFIC_BASE 1024 +#endif + +#ifndef F_SETPIPE_SZ +#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) +#endif + +#ifndef F_GETPIPE_SZ +#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) +#endif + +#ifndef F_ADD_SEALS +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) +#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) + +#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ +#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ +#define F_SEAL_GROW 0x0004 /* prevent file from growing */ +#define F_SEAL_WRITE 0x0008 /* prevent writes */ +#endif + +#ifndef F_OFD_GETLK +#define F_OFD_GETLK 36 +#define F_OFD_SETLK 37 +#define F_OFD_SETLKW 38 +#endif + +#ifndef MAX_HANDLE_SZ +#define MAX_HANDLE_SZ 128 +#endif + +/* The precise definition of __O_TMPFILE is arch specific; use the + * values defined by the kernel (note: some are hexa, some are octal, + * duplicated as-is from the kernel definitions): + * - alpha, parisc, sparc: each has a specific value; + * - others: they use the "generic" value. + */ + +#ifndef __O_TMPFILE +#if defined(__alpha__) +#define __O_TMPFILE 0100000000 +#elif defined(__parisc__) || defined(__hppa__) +#define __O_TMPFILE 0400000000 +#elif defined(__sparc__) || defined(__sparc64__) +#define __O_TMPFILE 0x2000000 +#else +#define __O_TMPFILE 020000000 +#endif +#endif + +/* a horrid kludge trying to make sure that this will fail on old kernels */ +#ifndef O_TMPFILE +#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) +#endif From 66ffbdf9338bb58470d4aecfa0e815afbfcdf6a5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:41:34 +0100 Subject: [PATCH 11/27] missing: move socket related definitions to missing_socket.h --- src/basic/meson.build | 1 + src/basic/missing.h | 55 +--------------------------------- src/basic/missing_socket.h | 60 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 54 deletions(-) create mode 100644 src/basic/missing_socket.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 764c6c9bc6..17282a9bef 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -109,6 +109,7 @@ basic_sources = files(''' missing_prctl.h missing_resource.h missing_securebits.h + missing_socket.h missing_stat.h missing_syscall.h missing_type.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 3cf8d7c915..8d12cb318d 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -7,26 +7,8 @@ #include #include #include -#include #include -#if HAVE_LINUX_VM_SOCKETS_H -#include -#else -#define VMADDR_CID_ANY -1U -struct sockaddr_vm { - unsigned short svm_family; - unsigned short svm_reserved1; - unsigned int svm_port; - unsigned int svm_cid; - unsigned char svm_zero[sizeof(struct sockaddr) - - sizeof(unsigned short) - - sizeof(unsigned short) - - sizeof(unsigned int) - - sizeof(unsigned int)]; -}; -#endif /* !HAVE_LINUX_VM_SOCKETS_H */ - #ifndef MFD_ALLOW_SEALING #define MFD_ALLOW_SEALING 0x0002U #endif @@ -35,26 +17,10 @@ struct sockaddr_vm { #define MFD_CLOEXEC 0x0001U #endif -#ifndef IP_FREEBIND -#define IP_FREEBIND 15 -#endif - #ifndef TIOCVHANGUP #define TIOCVHANGUP 0x5437 #endif -#ifndef IP_TRANSPARENT -#define IP_TRANSPARENT 19 -#endif - -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - -#ifndef SOL_SCTP -#define SOL_SCTP 132 -#endif - #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 #endif @@ -111,10 +77,6 @@ struct sockaddr_vm { #define MS_LAZYTIME (1<<25) #endif -#ifndef SCM_SECURITY -#define SCM_SECURITY 0x03 -#endif - #ifndef DM_DEFERRED_REMOVE #define DM_DEFERRED_REMOVE (1 << 17) #endif @@ -135,14 +97,6 @@ struct sockaddr_vm { # define TFD_TIMER_CANCEL_ON_SET (1 << 1) #endif -#ifndef SO_REUSEPORT -# define SO_REUSEPORT 15 -#endif - -#ifndef SO_PEERGROUPS -# define SO_PEERGROUPS 59 -#endif - #ifndef DRM_IOCTL_SET_MASTER # define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) #endif @@ -159,14 +113,6 @@ struct sockaddr_vm { #define RENAME_NOREPLACE (1 << 0) #endif -#ifndef SOL_ALG -#define SOL_ALG 279 -#endif - -#ifndef AF_VSOCK -#define AF_VSOCK 40 -#endif - #ifndef EXT4_IOC_RESIZE_FS # define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64) #endif @@ -203,6 +149,7 @@ struct sockaddr_vm { #include "missing_network.h" #include "missing_prctl.h" #include "missing_resource.h" +#include "missing_socket.h" #include "missing_type.h" #include "missing_syscall.h" diff --git a/src/basic/missing_socket.h b/src/basic/missing_socket.h new file mode 100644 index 0000000000..a5fd457244 --- /dev/null +++ b/src/basic/missing_socket.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#if HAVE_LINUX_VM_SOCKETS_H +#include +#else +#define VMADDR_CID_ANY -1U +struct sockaddr_vm { + unsigned short svm_family; + unsigned short svm_reserved1; + unsigned int svm_port; + unsigned int svm_cid; + unsigned char svm_zero[sizeof(struct sockaddr) - + sizeof(unsigned short) - + sizeof(unsigned short) - + sizeof(unsigned int) - + sizeof(unsigned int)]; +}; +#endif /* !HAVE_LINUX_VM_SOCKETS_H */ + +#ifndef AF_VSOCK +#define AF_VSOCK 40 +#endif + +#ifndef SO_REUSEPORT +#define SO_REUSEPORT 15 +#endif + +#ifndef SO_PEERGROUPS +#define SO_PEERGROUPS 59 +#endif + +#ifndef SOL_NETLINK +#define SOL_NETLINK 270 +#endif + +#ifndef SOL_ALG +#define SOL_ALG 279 +#endif + +/* Not exposed yet. Defined in include/linux/socket.h. */ +#ifndef SOL_SCTP +#define SOL_SCTP 132 +#endif + +/* Not exposed yet. Defined in include/linux/socket.h */ +#ifndef SCM_SECURITY +#define SCM_SECURITY 0x03 +#endif + +/* netinet/in.h */ +#ifndef IP_FREEBIND +#define IP_FREEBIND 15 +#endif + +#ifndef IP_TRANSPARENT +#define IP_TRANSPARENT 19 +#endif From d7330b60a96c6e7484bfc1f93eb28113482c0c2f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:43:12 +0100 Subject: [PATCH 12/27] missing: move timer related definition to missing_timerfd.h --- src/basic/meson.build | 1 + src/basic/missing.h | 5 +---- src/basic/missing_timerfd.h | 8 ++++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 src/basic/missing_timerfd.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 17282a9bef..f74bfb09d5 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -112,6 +112,7 @@ basic_sources = files(''' missing_socket.h missing_stat.h missing_syscall.h + missing_timerfd.h missing_type.h missing_vxcan.h mkdir-label.c diff --git a/src/basic/missing.h b/src/basic/missing.h index 8d12cb318d..79faeeb9cf 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -93,10 +93,6 @@ # define CIFS_MAGIC_NUMBER 0xFF534D42 #endif -#ifndef TFD_TIMER_CANCEL_ON_SET -# define TFD_TIMER_CANCEL_ON_SET (1 << 1) -#endif - #ifndef DRM_IOCTL_SET_MASTER # define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) #endif @@ -150,6 +146,7 @@ #include "missing_prctl.h" #include "missing_resource.h" #include "missing_socket.h" +#include "missing_timerfd.h" #include "missing_type.h" #include "missing_syscall.h" diff --git a/src/basic/missing_timerfd.h b/src/basic/missing_timerfd.h new file mode 100644 index 0000000000..6b0404453a --- /dev/null +++ b/src/basic/missing_timerfd.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#ifndef TFD_TIMER_CANCEL_ON_SET +#define TFD_TIMER_CANCEL_ON_SET (1 << 1) +#endif From c8a363eb15adce8f435933d0b9fa35ad4a210fd3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:44:47 +0100 Subject: [PATCH 13/27] missing: add memfd related definitions to missing_mman.h --- src/basic/meson.build | 1 + src/basic/missing.h | 9 +-------- src/basic/missing_mman.h | 12 ++++++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 src/basic/missing_mman.h diff --git a/src/basic/meson.build b/src/basic/meson.build index f74bfb09d5..3730930c7f 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -105,6 +105,7 @@ basic_sources = files(''' missing_input.h missing_keyctl.h missing_magic.h + missing_mman.h missing_network.h missing_prctl.h missing_resource.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 79faeeb9cf..cd873a43ad 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -9,14 +9,6 @@ #include #include -#ifndef MFD_ALLOW_SEALING -#define MFD_ALLOW_SEALING 0x0002U -#endif - -#ifndef MFD_CLOEXEC -#define MFD_CLOEXEC 0x0001U -#endif - #ifndef TIOCVHANGUP #define TIOCVHANGUP 0x5437 #endif @@ -142,6 +134,7 @@ #include "missing_fcntl.h" #include "missing_input.h" #include "missing_magic.h" +#include "missing_mman.h" #include "missing_network.h" #include "missing_prctl.h" #include "missing_resource.h" diff --git a/src/basic/missing_mman.h b/src/basic/missing_mman.h new file mode 100644 index 0000000000..7ff12f770b --- /dev/null +++ b/src/basic/missing_mman.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#ifndef MFD_ALLOW_SEALING +#define MFD_ALLOW_SEALING 0x0002U +#endif + +#ifndef MFD_CLOEXEC +#define MFD_CLOEXEC 0x0001U +#endif From 5ee668d2d12a3dd8a3c2897d64afe64847e711fe Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:46:33 +0100 Subject: [PATCH 14/27] missing: drop TIOCVHANGUP This is defined before linux-3.11. Also, its value depnends on architecture. So, it is not good to define in this form. --- src/basic/missing.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index cd873a43ad..850709baac 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -9,10 +9,6 @@ #include #include -#ifndef TIOCVHANGUP -#define TIOCVHANGUP 0x5437 -#endif - #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 #endif From b19bb11142214b68ba8c5a367fe97117a2f33e94 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:47:47 +0100 Subject: [PATCH 15/27] missing: move rand related definitions to missing_random.h --- src/basic/meson.build | 1 + src/basic/missing.h | 9 +-------- src/basic/missing_random.h | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/basic/missing_random.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 3730930c7f..8fc7665a91 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -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 diff --git a/src/basic/missing.h b/src/basic/missing.h index 850709baac..0651a397c9 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -9,14 +9,6 @@ #include #include -#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 @@ -133,6 +125,7 @@ #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 index 0000000000..2e76031b32 --- /dev/null +++ b/src/basic/missing_random.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if USE_SYS_RANDOM_H +# include +#else +# include +#endif + +#ifndef GRND_NONBLOCK +#define GRND_NONBLOCK 0x0001 +#endif + +#ifndef GRND_RANDOM +#define GRND_RANDOM 0x0002 +#endif From 470f348b97bf450d13d7bf4645331ae3d911834d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:49:18 +0100 Subject: [PATCH 16/27] missing: move definition of secure_getenv() to missing_stdlib.h --- src/basic/meson.build | 1 + src/basic/missing.h | 10 +--------- src/basic/missing_stdlib.h | 13 +++++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 src/basic/missing_stdlib.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 8fc7665a91..ca27d44be9 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -113,6 +113,7 @@ basic_sources = files(''' missing_securebits.h missing_socket.h missing_stat.h + missing_stdlib.h missing_syscall.h missing_timerfd.h missing_type.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 0651a397c9..15646eaaeb 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -6,7 +6,6 @@ #include #include #include -#include #include #ifndef FS_NOCOW_FL @@ -61,14 +60,6 @@ #define DM_DEFERRED_REMOVE (1 << 17) #endif -#if ! HAVE_SECURE_GETENV -# if HAVE___SECURE_GETENV -# define secure_getenv __secure_getenv -# else -# error "neither secure_getenv nor __secure_getenv are available" -# endif -#endif - #ifndef CIFS_MAGIC_NUMBER # define CIFS_MAGIC_NUMBER 0xFF534D42 #endif @@ -128,6 +119,7 @@ #include "missing_random.h" #include "missing_resource.h" #include "missing_socket.h" +#include "missing_stdlib.h" #include "missing_timerfd.h" #include "missing_type.h" diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h new file mode 100644 index 0000000000..188a8d4406 --- /dev/null +++ b/src/basic/missing_stdlib.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +/* stdlib.h */ +#if !HAVE_SECURE_GETENV +# if HAVE___SECURE_GETENV +# define secure_getenv __secure_getenv +# else +# error "neither secure_getenv nor __secure_getenv are available" +# endif +#endif From fec6661efd6ac820c7903c63f7467da6b826ca81 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:50:11 +0100 Subject: [PATCH 17/27] missing: drop DM_DEFERRED_REMOVE as we have dm-ioctl.h --- src/basic/missing.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index 15646eaaeb..6d50323520 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -56,10 +56,6 @@ #define MS_LAZYTIME (1<<25) #endif -#ifndef DM_DEFERRED_REMOVE -#define DM_DEFERRED_REMOVE (1 << 17) -#endif - #ifndef CIFS_MAGIC_NUMBER # define CIFS_MAGIC_NUMBER 0xFF534D42 #endif From 957c622b8601c93dfa3fc8312958e27b1365fc11 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:50:40 +0100 Subject: [PATCH 18/27] missing: drop BPF_XOR as we have linux/bpf_common.h --- src/basic/missing.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index 6d50323520..7653d7d17a 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -68,10 +68,6 @@ # define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) #endif -#ifndef BPF_XOR -#define BPF_XOR 0xa0 -#endif - #ifndef RENAME_NOREPLACE #define RENAME_NOREPLACE (1 << 0) #endif From dab28f09051445fe370466e767e31652e0804a0f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:12:26 +0100 Subject: [PATCH 19/27] missing: drop old drm related definitions These values are exposed earlier than linux-3.11. Let's use drm/drm.h. --- src/basic/missing.h | 8 -------- src/login/logind-session-device.c | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index 7653d7d17a..34afbddd10 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -60,14 +60,6 @@ # define CIFS_MAGIC_NUMBER 0xFF534D42 #endif -#ifndef DRM_IOCTL_SET_MASTER -# define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) -#endif - -#ifndef DRM_IOCTL_DROP_MASTER -# define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) -#endif - #ifndef RENAME_NOREPLACE #define RENAME_NOREPLACE (1 << 0) #endif diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index f358524ebc..0fcbe98c2a 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -3,9 +3,13 @@ #include #include #include +#include #include #include +/* Old drm.h may needs to be included after stdint.h and sys/types.h */ +#include + #include "sd-device.h" #include "alloc-util.h" From 22332e339b71d5fc26989f9b069934e9cedc9169 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:13:02 +0100 Subject: [PATCH 20/27] missing: move sched.h related definitions to missing_sched.h --- src/basic/meson.build | 1 + src/basic/missing.h | 16 +--------------- src/basic/missing_sched.h | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 src/basic/missing_sched.h diff --git a/src/basic/meson.build b/src/basic/meson.build index ca27d44be9..8a1fd37c5a 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -110,6 +110,7 @@ basic_sources = files(''' missing_prctl.h missing_random.h missing_resource.h + missing_sched.h missing_securebits.h missing_socket.h missing_stat.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 34afbddd10..00b903ac30 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -12,10 +12,6 @@ #define FS_NOCOW_FL 0x00800000 #endif -#ifndef CLONE_NEWCGROUP -#define CLONE_NEWCGROUP 0x02000000 -#endif - #ifndef MS_MOVE #define MS_MOVE 8192 #endif @@ -80,17 +76,6 @@ #define FALLOC_FL_PUNCH_HOLE 0x02 #endif -#ifndef PF_KTHREAD -#define PF_KTHREAD 0x00200000 -#endif - -/* The maximum thread/process name length including trailing NUL byte. This mimics the kernel definition of the same - * name, which we need in userspace at various places but is not defined in userspace currently, neither under this - * name nor any other. */ -#ifndef TASK_COMM_LEN -#define TASK_COMM_LEN 16 -#endif - #include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" @@ -102,6 +87,7 @@ #include "missing_prctl.h" #include "missing_random.h" #include "missing_resource.h" +#include "missing_sched.h" #include "missing_socket.h" #include "missing_stdlib.h" #include "missing_timerfd.h" diff --git a/src/basic/missing_sched.h b/src/basic/missing_sched.h new file mode 100644 index 0000000000..baa3913283 --- /dev/null +++ b/src/basic/missing_sched.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#ifndef CLONE_NEWCGROUP +#define CLONE_NEWCGROUP 0x02000000 +#endif + +/* Not exposed yet. Defined at include/linux/sched.h */ +#ifndef PF_KTHREAD +#define PF_KTHREAD 0x00200000 +#endif + +/* The maximum thread/process name length including trailing NUL byte. This mimics the kernel definition of the same + * name, which we need in userspace at various places but is not defined in userspace currently, neither under this + * name nor any other. */ +/* Not exposed yet. Defined at include/linux/sched.h */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif From 311c1a5d0a6f864c50d72904074d22d8be9e965e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:55:19 +0100 Subject: [PATCH 21/27] missing: drop falloc related definitions All these values are exposed earlier than linux-3.11. Let's drop them. --- src/basic/missing.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index 00b903ac30..eaf49f5369 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -5,7 +5,6 @@ #include #include -#include #include #ifndef FS_NOCOW_FL @@ -68,14 +67,6 @@ #define NS_GET_NSTYPE _IO(0xb7, 0x3) #endif -#ifndef FALLOC_FL_KEEP_SIZE -#define FALLOC_FL_KEEP_SIZE 0x01 -#endif - -#ifndef FALLOC_FL_PUNCH_HOLE -#define FALLOC_FL_PUNCH_HOLE 0x02 -#endif - #include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" From 503f480f8e4f66963900d0e58b9030c4a9387c41 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 06:57:27 +0100 Subject: [PATCH 22/27] missing: move fs or mount related definitions to missing_fs.h This also fixes errnous definition MS_REC -> MS_SLAVE. --- src/basic/meson.build | 1 + src/basic/missing.h | 61 +--------------------------------------- src/basic/missing_fs.h | 63 ++++++++++++++++++++++++++++++++++++++++++ src/nspawn/nspawn.c | 2 +- 4 files changed, 66 insertions(+), 61 deletions(-) create mode 100644 src/basic/missing_fs.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 8a1fd37c5a..a59b8ac928 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -99,6 +99,7 @@ basic_sources = files(''' missing_fcntl.h missing_fib_rules.h missing_fou.h + missing_fs.h missing_if_bridge.h missing_if_link.h missing_if_tunnel.h diff --git a/src/basic/missing.h b/src/basic/missing.h index eaf49f5369..a7ba9bf823 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -7,70 +7,11 @@ #include #include -#ifndef FS_NOCOW_FL -#define FS_NOCOW_FL 0x00800000 -#endif - -#ifndef MS_MOVE -#define MS_MOVE 8192 -#endif - -#ifndef MS_REC -#define MS_REC 16384 -#endif - -#ifndef MS_PRIVATE -#define MS_PRIVATE (1<<18) -#endif - -#ifndef MS_REC -#define MS_REC (1<<19) -#endif - -#ifndef MS_SHARED -#define MS_SHARED (1<<20) -#endif - -#ifndef MS_RELATIME -#define MS_RELATIME (1<<21) -#endif - -#ifndef MS_KERNMOUNT -#define MS_KERNMOUNT (1<<22) -#endif - -#ifndef MS_I_VERSION -#define MS_I_VERSION (1<<23) -#endif - -#ifndef MS_STRICTATIME -#define MS_STRICTATIME (1<<24) -#endif - -#ifndef MS_LAZYTIME -#define MS_LAZYTIME (1<<25) -#endif - -#ifndef CIFS_MAGIC_NUMBER -# define CIFS_MAGIC_NUMBER 0xFF534D42 -#endif - -#ifndef RENAME_NOREPLACE -#define RENAME_NOREPLACE (1 << 0) -#endif - -#ifndef EXT4_IOC_RESIZE_FS -# define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64) -#endif - -#ifndef NS_GET_NSTYPE -#define NS_GET_NSTYPE _IO(0xb7, 0x3) -#endif - #include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" #include "missing_fcntl.h" +#include "missing_fs.h" #include "missing_input.h" #include "missing_magic.h" #include "missing_mman.h" diff --git a/src/basic/missing_fs.h b/src/basic/missing_fs.h new file mode 100644 index 0000000000..48c1af0458 --- /dev/null +++ b/src/basic/missing_fs.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +/* linux/fs.h */ +#ifndef RENAME_NOREPLACE /* 0a7c3937a1f23f8cb5fc77ae01661e9968a51d0c (3.15) */ +#define RENAME_NOREPLACE (1 << 0) +#endif + +/* linux/fs.h or sys/mount.h */ +#ifndef MS_MOVE +#define MS_MOVE 8192 +#endif + +#ifndef MS_REC +#define MS_REC 16384 +#endif + +#ifndef MS_PRIVATE +#define MS_PRIVATE (1<<18) +#endif + +#ifndef MS_SLAVE +#define MS_SLAVE (1<<19) +#endif + +#ifndef MS_SHARED +#define MS_SHARED (1<<20) +#endif + +#ifndef MS_RELATIME +#define MS_RELATIME (1<<21) +#endif + +#ifndef MS_KERNMOUNT +#define MS_KERNMOUNT (1<<22) +#endif + +#ifndef MS_I_VERSION +#define MS_I_VERSION (1<<23) +#endif + +#ifndef MS_STRICTATIME +#define MS_STRICTATIME (1<<24) +#endif + +#ifndef MS_LAZYTIME +#define MS_LAZYTIME (1<<25) +#endif + +/* Not exposed yet. Defined at fs/ext4/ext4.h */ +#ifndef EXT4_IOC_RESIZE_FS +#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64) +#endif + +/* Not exposed yet. Defined at fs/cifs/cifsglob.h */ +#ifndef CIFS_MAGIC_NUMBER +#define CIFS_MAGIC_NUMBER 0xFF534D42 +#endif + +/* linux/nsfs.h */ +#ifndef NS_GET_NSTYPE /* d95fa3c76a66b6d76b1e109ea505c55e66360f3c (4.11) */ +#define NS_GET_NSTYPE _IO(0xb7, 0x3) +#endif diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 0fb42d1a74..03538d1c2f 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include #include #include From 3c94e50486a7613396c1ecaddb137e5d27c6a488 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:19:27 +0100 Subject: [PATCH 23/27] util: drop missing.h from time-util.c --- src/basic/time-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 12c1fc71df..557c75debc 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -20,7 +20,7 @@ #include "io-util.h" #include "log.h" #include "macro.h" -#include "missing.h" +#include "missing_timerfd.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" From ef118d00ebb8fc0b37bd5ba28b6d84874b47dec5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:20:07 +0100 Subject: [PATCH 24/27] util: drop missing.h from socket-util.h --- src/basic/missing.h | 4 ---- src/basic/socket-util.h | 11 ++++++----- src/fuzz/fuzz-ndisc-rs.c | 3 ++- src/libsystemd-network/sd-lldp.c | 1 + src/libsystemd-network/test-dhcp6-client.c | 1 + src/libsystemd/sd-bus/bus-dump.c | 2 ++ src/libsystemd/sd-bus/bus-objects.c | 1 + src/libsystemd/sd-bus/test-bus-benchmark.c | 1 + src/libsystemd/sd-device/sd-device.c | 1 + src/libsystemd/sd-resolve/test-resolve.c | 1 + src/machine/machine-dbus.c | 1 + src/network/networkd-link.c | 1 + src/network/networkd-lldp-tx.c | 1 + src/resolve/resolvectl.c | 2 +- src/resolve/resolved-bus.c | 1 + src/resolve/resolved-dns-stub.c | 1 + src/resolve/resolved-dns-synthesize.c | 1 + src/resolve/resolved-dnssd-bus.c | 1 + src/resolve/resolved-manager.c | 1 + src/shared/conf-parser.c | 3 ++- src/shared/nsflags.c | 2 +- src/test/test-socket-util.c | 1 + src/udev/udev-ctrl.c | 1 + 23 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index a7ba9bf823..7e14e0a2a4 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -3,10 +3,6 @@ /* Missing glibc definitions to access certain kernel APIs */ -#include -#include -#include - #include "missing_audit.h" #include "missing_btrfs_tree.h" #include "missing_capability.h" diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 37b1bca81a..574d2b73f5 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once +#include +#include +#include +#include #include #include #include @@ -8,13 +12,10 @@ #include #include #include -#include -#include -#include #include "macro.h" -#include "missing.h" -#include "util.h" +#include "missing_socket.h" +#include "sparse-endian.h" union sockaddr_union { /* The minimal, abstract version */ diff --git a/src/fuzz/fuzz-ndisc-rs.c b/src/fuzz/fuzz-ndisc-rs.c index 389b545ac2..3a1e60fc5d 100644 --- a/src/fuzz/fuzz-ndisc-rs.c +++ b/src/fuzz/fuzz-ndisc-rs.c @@ -1,7 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include #include +#include +#include #include "alloc-util.h" #include "icmp6-util.h" diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c index e5cd134d57..969fc71051 100644 --- a/src/libsystemd-network/sd-lldp.c +++ b/src/libsystemd-network/sd-lldp.c @@ -2,6 +2,7 @@ #include #include +#include #include "sd-lldp.h" diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index d88b018dc9..fa94b3cb75 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -20,6 +20,7 @@ #include "macro.h" #include "socket-util.h" #include "tests.h" +#include "util.h" #include "virt.h" static struct ether_addr mac_addr = { diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c index 506ed0d73c..38900cf718 100644 --- a/src/libsystemd/sd-bus/bus-dump.c +++ b/src/libsystemd/sd-bus/bus-dump.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include + #include "alloc-util.h" #include "bus-dump.h" #include "bus-internal.h" diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c index 7e90a56e67..d0538104ae 100644 --- a/src/libsystemd/sd-bus/bus-objects.c +++ b/src/libsystemd/sd-bus/bus-objects.c @@ -9,6 +9,7 @@ #include "bus-slot.h" #include "bus-type.h" #include "bus-util.h" +#include "missing_capability.h" #include "set.h" #include "string-util.h" #include "strv.h" diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c index 92624909e0..2dd3d41a30 100644 --- a/src/libsystemd/sd-bus/test-bus-benchmark.c +++ b/src/libsystemd/sd-bus/test-bus-benchmark.c @@ -10,6 +10,7 @@ #include "bus-util.h" #include "def.h" #include "fd-util.h" +#include "missing_resource.h" #include "time-util.h" #include "util.h" diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 39def1681e..d5583488f2 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -2,6 +2,7 @@ #include #include +#include #include #include "sd-device.h" diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c index 7748100210..bff2c4976b 100644 --- a/src/libsystemd/sd-resolve/test-resolve.c +++ b/src/libsystemd/sd-resolve/test-resolve.c @@ -14,6 +14,7 @@ #include "macro.h" #include "socket-util.h" #include "string-util.h" +#include "time-util.h" #define TEST_TIMEOUT_USEC (20*USEC_PER_SEC) diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 95489a3d94..285918b4cc 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -27,6 +27,7 @@ #include "local-addresses.h" #include "machine-dbus.h" #include "machine.h" +#include "missing_capability.h" #include "mkdir.h" #include "os-util.h" #include "path-util.h" diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 5296f687a7..3933655bfe 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -13,6 +13,7 @@ #include "env-file.h" #include "fd-util.h" #include "fileio.h" +#include "missing_network.h" #include "netlink-util.h" #include "network-internal.h" #include "networkd-ipv6-proxy-ndp.h" diff --git a/src/network/networkd-lldp-tx.c b/src/network/networkd-lldp-tx.c index 253308e36c..8fd6365e68 100644 --- a/src/network/networkd-lldp-tx.c +++ b/src/network/networkd-lldp-tx.c @@ -8,6 +8,7 @@ #include "env-file.h" #include "fd-util.h" #include "hostname-util.h" +#include "missing_network.h" #include "networkd-lldp-tx.h" #include "networkd-manager.h" #include "parse-util.h" diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 1e3fabc450..c4a712ddee 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -16,7 +16,7 @@ #include "gcrypt-util.h" #include "in-addr-util.h" #include "main-func.h" -#include "missing.h" +#include "missing_network.h" #include "netlink-util.h" #include "pager.h" #include "parse-util.h" diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 75702d593f..b9fd775526 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -4,6 +4,7 @@ #include "bus-common-errors.h" #include "bus-util.h" #include "dns-domain.h" +#include "missing_capability.h" #include "resolved-bus.h" #include "resolved-def.h" #include "resolved-dns-synthesize.h" diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index c8c4d829e8..015aabaf9b 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include "fd-util.h" +#include "missing_network.h" #include "resolved-dns-stub.h" #include "socket-util.h" diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c index 9a8ce7ae2d..f65116c3b4 100644 --- a/src/resolve/resolved-dns-synthesize.c +++ b/src/resolve/resolved-dns-synthesize.c @@ -3,6 +3,7 @@ #include "alloc-util.h" #include "hostname-util.h" #include "local-addresses.h" +#include "missing_network.h" #include "resolved-dns-synthesize.h" int dns_synthesize_ifindex(int ifindex) { diff --git a/src/resolve/resolved-dnssd-bus.c b/src/resolve/resolved-dnssd-bus.c index c2db31df0f..24bb37b35e 100644 --- a/src/resolve/resolved-dnssd-bus.c +++ b/src/resolve/resolved-dnssd-bus.c @@ -1,6 +1,7 @@ #include "alloc-util.h" #include "bus-util.h" +#include "missing_capability.h" #include "resolved-dnssd.h" #include "resolved-dnssd-bus.h" #include "resolved-link.h" diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 2174d660ff..23a7b87801 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -17,6 +17,7 @@ #include "fileio.h" #include "hostname-util.h" #include "io-util.h" +#include "missing_network.h" #include "netlink-util.h" #include "network-internal.h" #include "ordered-set.h" diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 8110b2cb16..8fe177990a 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -18,9 +18,11 @@ #include "fs-util.h" #include "log.h" #include "macro.h" +#include "missing.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" +#include "rlimit-util.h" #include "signal-util.h" #include "socket-util.h" #include "string-util.h" @@ -28,7 +30,6 @@ #include "syslog-util.h" #include "time-util.h" #include "utf8.h" -#include "rlimit-util.h" int config_item_table_lookup( const void *table, diff --git a/src/shared/nsflags.c b/src/shared/nsflags.c index a5beb9200f..8cc2d0873d 100644 --- a/src/shared/nsflags.c +++ b/src/shared/nsflags.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include +#include #include "alloc-util.h" #include "extract-word.h" diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index f902f500e0..07ff487834 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -13,6 +13,7 @@ #include "io-util.h" #include "log.h" #include "macro.h" +#include "missing_network.h" #include "process-util.h" #include "socket-util.h" #include "string-util.h" diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index f2238ae14e..d90ebb7259 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -24,6 +24,7 @@ #include "socket-util.h" #include "strxcpyx.h" #include "udev-ctrl.h" +#include "util.h" /* wire protocol magic must match */ #define UDEV_CTRL_MAGIC 0xdead1dea From 893829359a29273fb577c346f994721be00d055a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:23:23 +0100 Subject: [PATCH 25/27] nsflsgs: drop missing.h and use missing_sched.h --- src/shared/bus-unit-util.c | 1 + src/shared/nsflags.h | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 625bebbe35..e324a2ffc7 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -18,6 +18,7 @@ #include "ip-protocol-list.h" #include "list.h" #include "locale-util.h" +#include "missing_fs.h" #include "mountpoint-util.h" #include "nsflags.h" #include "parse-util.h" diff --git a/src/shared/nsflags.h b/src/shared/nsflags.h index 7cc26a441d..0aeb0bc891 100644 --- a/src/shared/nsflags.h +++ b/src/shared/nsflags.h @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once -#include - -#include "missing.h" +#include "missing_sched.h" /* The combination of all namespace flags defined by the kernel. The right type for this isn't clear. setns() and * unshare() expect these flags to be passed as (signed) "int", while clone() wants them as "unsigned long". The latter From 204f52e32d347d4d14d2f3febd2bce54ed13247c Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:30:35 +0100 Subject: [PATCH 26/27] lockfile: drop unnecessary headers from lockfile-util.h --- src/machine/image-dbus.c | 1 + src/machine/machined-dbus.c | 1 + src/nspawn/nspawn-network.c | 1 + src/portable/portabled-bus.c | 1 + src/portable/portabled-image-bus.c | 1 + src/shared/lockfile-util.h | 5 ----- src/shared/machine-image.c | 1 + 7 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c index a311ed9077..33a181e594 100644 --- a/src/machine/image-dbus.c +++ b/src/machine/image-dbus.c @@ -15,6 +15,7 @@ #include "io-util.h" #include "loop-util.h" #include "machine-image.h" +#include "missing_capability.h" #include "mount-util.h" #include "process-util.h" #include "raw-clone.h" diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index bbcfc626a1..d613414fde 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -21,6 +21,7 @@ #include "machine-image.h" #include "machine-pool.h" #include "machined.h" +#include "missing_capability.h" #include "path-util.h" #include "process-util.h" #include "stdio-util.h" diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c index 214fa40804..9d0f8a9956 100644 --- a/src/nspawn/nspawn-network.c +++ b/src/nspawn/nspawn-network.c @@ -11,6 +11,7 @@ #include "alloc-util.h" #include "ether-addr-util.h" #include "lockfile-util.h" +#include "missing_network.h" #include "netlink-util.h" #include "nspawn-network.h" #include "siphash24.h" diff --git a/src/portable/portabled-bus.c b/src/portable/portabled-bus.c index ec93838538..3cbdb0b0cc 100644 --- a/src/portable/portabled-bus.c +++ b/src/portable/portabled-bus.c @@ -7,6 +7,7 @@ #include "fd-util.h" #include "io-util.h" #include "machine-image.h" +#include "missing_capability.h" #include "portable.h" #include "portabled-bus.h" #include "portabled-image-bus.h" diff --git a/src/portable/portabled-image-bus.c b/src/portable/portabled-image-bus.c index 77eb2df118..1e618175c7 100644 --- a/src/portable/portabled-image-bus.c +++ b/src/portable/portabled-image-bus.c @@ -8,6 +8,7 @@ #include "fileio.h" #include "io-util.h" #include "machine-image.h" +#include "missing_capability.h" #include "portable.h" #include "portabled-bus.h" #include "portabled-image-bus.h" diff --git a/src/shared/lockfile-util.h b/src/shared/lockfile-util.h index c2abd9956f..e0eef34cdc 100644 --- a/src/shared/lockfile-util.h +++ b/src/shared/lockfile-util.h @@ -1,11 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once -#include - -#include "macro.h" -#include "missing.h" - typedef struct LockFile { char *path; int fd; diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index b39ff42b84..af06ab22e8 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include From e93672eeac655122f9a8d3348b2c73efc9795ea6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 07:41:52 +0100 Subject: [PATCH 27/27] tree-wide: drop missing.h from headers and use relevant missing_*.h --- src/core/bpf-firewall.c | 1 + src/core/execute.h | 2 +- src/network/netdev/fou-tunnel.h | 2 +- src/network/netdev/ipvlan.h | 2 +- src/nspawn/nspawn-settings.h | 2 +- src/udev/net/ethtool-util.h | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/bpf-firewall.c b/src/core/bpf-firewall.c index 946c0516e1..b9a611fd9e 100644 --- a/src/core/bpf-firewall.c +++ b/src/core/bpf-firewall.c @@ -20,6 +20,7 @@ #include "bpf-program.h" #include "fd-util.h" #include "ip-address-access.h" +#include "missing_syscall.h" #include "unit.h" enum { diff --git a/src/core/execute.h b/src/core/execute.h index 16124cf28c..fb8c752efa 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -16,7 +16,7 @@ typedef struct Manager Manager; #include "cgroup-util.h" #include "fdset.h" #include "list.h" -#include "missing.h" +#include "missing_resource.h" #include "namespace.h" #include "nsflags.h" diff --git a/src/network/netdev/fou-tunnel.h b/src/network/netdev/fou-tunnel.h index 9e4c1e9629..b8abed19bd 100644 --- a/src/network/netdev/fou-tunnel.h +++ b/src/network/netdev/fou-tunnel.h @@ -6,7 +6,7 @@ #endif #include "in-addr-util.h" -#include "missing.h" +#include "missing_fou.h" #include "netdev/netdev.h" typedef enum FooOverUDPEncapType { diff --git a/src/network/netdev/ipvlan.h b/src/network/netdev/ipvlan.h index b60587f2b6..fb426d37e5 100644 --- a/src/network/netdev/ipvlan.h +++ b/src/network/netdev/ipvlan.h @@ -3,7 +3,7 @@ #include -#include "missing.h" +#include "missing_if_link.h" #include "netdev/netdev.h" typedef enum IPVlanMode { diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h index cb082d1635..a63aa32e90 100644 --- a/src/nspawn/nspawn-settings.h +++ b/src/nspawn/nspawn-settings.h @@ -8,7 +8,7 @@ #include "conf-parser.h" #include "macro.h" -#include "missing.h" +#include "missing_resource.h" #include "nspawn-expose-ports.h" #include "nspawn-mount.h" diff --git a/src/udev/net/ethtool-util.h b/src/udev/net/ethtool-util.h index 93d4ea4d3f..e4bc5161d5 100644 --- a/src/udev/net/ethtool-util.h +++ b/src/udev/net/ethtool-util.h @@ -5,7 +5,7 @@ #include #include "conf-parser.h" -#include "missing.h" +#include "missing_network.h" struct link_config;