• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 15263807472

26 May 2025 08:53PM UTC coverage: 72.046% (-0.002%) from 72.048%
15263807472

push

github

yuwata
src/core/manager.c: log preset activity on first boot

This gives us a little more information about what units were enabled
or disabled on that first boot and will be useful for OS developers
tracking down the source of unit state.

An example with this enabled looks like:

```
NET: Registered PF_VSOCK protocol family
systemd[1]: Applying preset policy.
systemd[1]: Unit /etc/systemd/system/dnsmasq.service is masked, ignoring.
systemd[1]: Unit /etc/systemd/system/systemd-repart.service is masked, ignoring.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir.mount' → '/etc/systemd/system/var-mnt-workdir.mount'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir\x2dtmp.mount' → '/etc/systemd/system/var-mnt-workdir\x2dtmp.mount'.
systemd[1]: Created symlink '/etc/systemd/system/afterburn-sshkeys.target.requires/afterburn-sshkeys@core.service' → '/usr/lib/systemd/system/afterburn-sshkeys@.service'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket' → '/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket' → '/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
systemd[1]: Populated /etc with preset unit settings.
```

Considering it only happens on first boot and not on every boot I think
the extra information is worth the extra verbosity in the logs just for
that boot.

5 of 6 new or added lines in 1 file covered. (83.33%)

5463 existing lines in 165 files now uncovered.

299151 of 415222 relevant lines covered (72.05%)

702386.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/basic/missing_syscall.h
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
#pragma once
3

4
/* Missing glibc definitions to access certain kernel APIs */
5

6
#include <signal.h>
7
#include <sys/syscall.h>
8
#include <unistd.h>
9

10
#ifdef ARCH_MIPS
11
#include <asm/sgidefs.h>
12
#endif
13

14
#include "forward.h"
15
#include "missing_keyctl.h"
16
#include "missing_sched.h"
17
#include "missing_syscall_def.h"
18

19
/* ======================================================================= */
20

21
#if !HAVE_FCHMODAT2
22
/* since kernel v6.6 (78252deb023cf0879256fcfbafe37022c390762b) */
23
static inline int missing_fchmodat2(int dirfd, const char *path, mode_t mode, int flags) {
20,668✔
24
        return syscall(__NR_fchmodat2, dirfd, path, mode, flags);
20,668✔
25
}
26

27
#  define fchmodat2 missing_fchmodat2
28
#endif
29

30
/* ======================================================================= */
31

32
#if !HAVE_PIVOT_ROOT
33
static inline int missing_pivot_root(const char *new_root, const char *put_old) {
2,224✔
34
        return syscall(__NR_pivot_root, new_root, put_old);
2,224✔
35
}
36

37
#  define pivot_root missing_pivot_root
38
#endif
39

40
/* ======================================================================= */
41

42
#if !HAVE_IOPRIO_GET
43
static inline int missing_ioprio_get(int which, int who) {
2,584✔
44
        return syscall(__NR_ioprio_get, which, who);
2,584✔
45
}
46

47
#  define ioprio_get missing_ioprio_get
48
#endif
49

50
/* ======================================================================= */
51

52
#if !HAVE_IOPRIO_SET
53
static inline int missing_ioprio_set(int which, int who, int ioprio) {
8✔
54
        return syscall(__NR_ioprio_set, which, who, ioprio);
8✔
55
}
56

57
#  define ioprio_set missing_ioprio_set
58
#endif
59

60
/* ======================================================================= */
61

62
#if !HAVE_KCMP
UNCOV
63
static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
×
UNCOV
64
        return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
×
65
}
66

67
#  define kcmp missing_kcmp
68
#endif
69

70
/* ======================================================================= */
71

72
#if !HAVE_KEYCTL
73
static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) {
18,444✔
74
        return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
18,444✔
75

76
#  define keyctl missing_keyctl
77
}
78

79
/* ======================================================================= */
80

81
static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
8,635✔
82
        return syscall(__NR_add_key, type, description, payload, plen, ringid);
8,635✔
83

84
#  define add_key missing_add_key
85
}
86

87
/* ======================================================================= */
88

89
static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
16✔
90
        return syscall(__NR_request_key, type, description, callout_info, destringid);
16✔
91

92
#  define request_key missing_request_key
93
}
94
#endif
95

96
/* ======================================================================= */
97

98
#if !HAVE_BPF
99
union bpf_attr;
100

101
static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
1,034✔
102
        return (int) syscall(__NR_bpf, cmd, attr, size);
1,034✔
103
}
104

105
#  define bpf missing_bpf
106
#endif
107

108
/* ======================================================================= */
109

110
#if !HAVE_SET_MEMPOLICY
111
enum {
112
        MPOL_DEFAULT,
113
        MPOL_PREFERRED,
114
        MPOL_BIND,
115
        MPOL_INTERLEAVE,
116
        MPOL_LOCAL,
117
};
118

119
static inline long missing_set_mempolicy(int mode, const unsigned long *nodemask,
17✔
120
                           unsigned long maxnode) {
121
        return syscall(__NR_set_mempolicy, mode, nodemask, maxnode);
17✔
122
}
123

124
#  define set_mempolicy missing_set_mempolicy
125
#endif
126

127
#if !HAVE_GET_MEMPOLICY
128
static inline long missing_get_mempolicy(int *mode, unsigned long *nodemask,
19✔
129
                           unsigned long maxnode, void *addr,
130
                           unsigned long flags) {
131
        return syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags);
19✔
132
}
133

134
#  define get_mempolicy missing_get_mempolicy
135
#endif
136

137
/* ======================================================================= */
138

139
#if !HAVE_PIDFD_SEND_SIGNAL
140
/* since kernel v5.1 (3eb39f47934f9d5a3027fe00d906a45fe3a15fad) */
141
static inline int missing_pidfd_send_signal(int fd, int sig, siginfo_t *info, unsigned flags) {
142
        return syscall(__NR_pidfd_send_signal, fd, sig, info, flags);
143
}
144

145
#  define pidfd_send_signal missing_pidfd_send_signal
146
#endif
147

148
/* ======================================================================= */
149

150
#if !HAVE_PIDFD_OPEN
151
/* since kernel v5.3 (7615d9e1780e26e0178c93c55b73309a5dc093d7) */
152
static inline int missing_pidfd_open(pid_t pid, unsigned flags) {
153
        return syscall(__NR_pidfd_open, pid, flags);
154
}
155

156
#  define pidfd_open missing_pidfd_open
157
#endif
158

159
/* ======================================================================= */
160

161
#if !HAVE_RT_TGSIGQUEUEINFO
UNCOV
162
static inline int missing_rt_tgsigqueueinfo(pid_t tgid, pid_t tid, int sig, siginfo_t *info) {
×
UNCOV
163
        return syscall(__NR_rt_tgsigqueueinfo, tgid, tid, sig, info);
×
164
}
165

166
#  define rt_tgsigqueueinfo missing_rt_tgsigqueueinfo
167
#endif
168

169
/* ======================================================================= */
170

171
#if !HAVE_EXECVEAT
172
/* since kernel v3.19 (51f39a1f0cea1cacf8c787f652f26dfee9611874) */
173
static inline int missing_execveat(int dirfd, const char *pathname,
174
                                   char *const argv[], char *const envp[],
175
                                   int flags) {
176
        return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags);
177
}
178

179
#  define execveat missing_execveat
180
#endif
181

182
/* ======================================================================= */
183

184
#if !HAVE_CLOSE_RANGE
185
/* since kernel v5.9 (9b4feb630e8e9801603f3cab3a36369e3c1cf88d) */
186
static inline int missing_close_range(unsigned first_fd, unsigned end_fd, unsigned flags) {
187
        /* Kernel-side the syscall expects fds as unsigned integers (just like close() actually), while
188
         * userspace exclusively uses signed integers for fds. glibc chose to expose it 1:1 however, hence we
189
         * do so here too, even if we end up passing signed fds to it most of the time. */
190
        return syscall(__NR_close_range,
191
                       first_fd,
192
                       end_fd,
193
                       flags);
194
}
195

196
#  define close_range missing_close_range
197
#endif
198

199
/* ======================================================================= */
200

201
#if !HAVE_SCHED_SETATTR
202
/* since kernel 3.14 (e6cfc0295c7d51b008999a8b13a44fb43f8685ea) */
203
static inline ssize_t missing_sched_setattr(pid_t pid, struct sched_attr *attr, unsigned int flags) {
204
        return syscall(__NR_sched_setattr, pid, attr, flags);
205
}
206

207
#  define sched_setattr missing_sched_setattr
208
#endif
209

210
/* ======================================================================= */
211

212
/* glibc does not provide clone() on ia64, only clone2(). Not only that, but it also doesn't provide a
213
 * prototype, only the symbol in the shared library (it provides a prototype for clone(), but not the
214
 * symbol in the shared library). */
215
#if defined(__ia64__)
216
int __clone2(int (*fn)(void *), void *stack_base, size_t stack_size, int flags, void *arg);
217
#define HAVE_CLONE 0
218
#else
219
/* We know that everywhere else clone() is available, so we don't bother with a meson check (that takes time
220
 * at build time) and just define it. Once the kernel drops ia64 support, we can drop this too. */
221
#define HAVE_CLONE 1
222
#endif
223

224
/* ======================================================================= */
225

226
#if !HAVE_QUOTACTL_FD
227
/* since kernel v5.14 (64c2c2c62f92339b176ea24403d8db16db36f9e6) */
228
static inline int missing_quotactl_fd(int fd, int cmd, int id, void *addr) {
624✔
229
        return syscall(__NR_quotactl_fd, fd, cmd, id, addr);
624✔
230
}
231

232
#  define quotactl_fd missing_quotactl_fd
233
#endif
234

235
/* ======================================================================= */
236

237
#if !HAVE_SETXATTRAT
238
/* since kernel v6.13 (6140be90ec70c39fa844741ca3cc807dd0866394) */
239
struct xattr_args {
240
        _align_(8) uint64_t value;
241
        uint32_t size;
242
        uint32_t flags;
243
};
244

245
static inline int missing_setxattrat(int fd, const char *path, int at_flags, const char *name, const struct xattr_args *args, size_t size) {
1✔
246
        return syscall(__NR_setxattrat, fd, path, at_flags, name, args, size);
1✔
247
}
248

249
#  define setxattrat missing_setxattrat
250
#endif
251

252
/* ======================================================================= */
253

254
#if !HAVE_REMOVEXATTRAT
255
/* since kernel v6.13 (6140be90ec70c39fa844741ca3cc807dd0866394) */
UNCOV
256
static inline int missing_removexattrat(int fd, const char *path, int at_flags, const char *name) {
×
UNCOV
257
        return syscall(__NR_removexattrat, fd, path, at_flags, name);
×
258
}
259

260
#  define removexattrat missing_removexattrat
261
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc