#include <sys/socket.h>
#include "af-list.h"
-#include "util.h"
+#include "macro.h"
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdint.h>
+#include <string.h>
+
#include "alloc-util.h"
+#include "macro.h"
#include "util.h"
void* memdup(const void *p, size_t l) {
***/
#include <alloca.h>
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "arphrd-list.h"
-#include "util.h"
+#include "macro.h"
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <pthread.h>
+#include <stddef.h>
#include <unistd.h>
#include "async.h"
#include "fd-util.h"
#include "log.h"
+#include "macro.h"
#include "util.h"
int asynchronous_job(void* (*func)(void *p), void *arg) {
***/
#include <errno.h>
+#include <linux/netlink.h>
#include <stdio.h>
+#include <sys/socket.h>
#include "alloc-util.h"
#include "audit-util.h"
#include "parse-util.h"
#include "process-util.h"
#include "user-util.h"
-#include "util.h"
int audit_session_from_pid(pid_t pid, uint32_t *id) {
_cleanup_free_ char *s = NULL;
#include "barrier.h"
#include "fd-util.h"
#include "macro.h"
-#include "util.h"
/**
* Barriers
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+#include <stdint.h>
#include <sys/types.h>
#include "macro.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "alloc-util.h"
#include "bitmap.h"
-#include "util.h"
+#include "hashmap.h"
+#include "macro.h"
struct Bitmap {
uint64_t *bitmaps;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
#include "hashmap.h"
#include "macro.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <linux/loop.h>
+#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/vfs.h>
+#include <sys/statfs.h>
+#include <sys/sysmacros.h>
+#include <unistd.h>
+
#ifdef HAVE_LINUX_BTRFS_H
#include <linux/btrfs.h>
#endif
#include "path-util.h"
#include "selinux-util.h"
#include "smack-util.h"
+#include "sparse-endian.h"
+#include "time-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "util.h"
#pragma once
#include <stdbool.h>
+#include <stdint.h>
#include <sys/types.h>
+#include "sd-id128.h"
+
#include "time-util.h"
typedef struct BtrfsSubvolInfo {
#include "bus-label.h"
#include "hexdecoct.h"
#include "macro.h"
-#include "util.h"
char *bus_label_escape(const char *s) {
char *r, *t;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <alloca.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include "alloc-util.h"
#include "calendarspec.h"
#include "fileio.h"
#include "parse-util.h"
+#include "macro.h"
#include "string-util.h"
#define BITS_WEEKDAYS 127
#include <stdbool.h>
+#include "time-util.h"
#include "util.h"
typedef struct CalendarComponent {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <string.h>
#include "cap-list.h"
#include "missing.h"
#include "parse-util.h"
+#include "macro.h"
#include "util.h"
static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
#include <errno.h>
#include <grp.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include <unistd.h>
***/
#include <stdbool.h>
+#include <stdint.h>
#include <sys/capability.h>
+#include <sys/types.h>
+#include "macro.h"
#include "util.h"
unsigned long cap_last_cap(void);
#include <dirent.h>
#include <errno.h>
#include <ftw.h>
+#include <limits.h>
#include <signal.h>
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
#include <sys/types.h>
#include <unistd.h>
#include "process-util.h"
#include "set.h"
#include "special.h"
+#include "def.h"
+#include "log.h"
+#include "missing.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
#include "unit-name.h"
#include "user-util.h"
-#include "util.h"
int cg_enumerate_processes(const char *controller, const char *path, FILE **_f) {
_cleanup_free_ char *fs = NULL;
***/
#include <dirent.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include "def.h"
#include "set.h"
+#include "hashmap.h"
+#include "macro.h"
/* An enum of well known cgroup controllers */
typedef enum CGroupController {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <linux/fs.h>
#include "chattr-util.h"
#include "fd-util.h"
-#include "util.h"
+#include "macro.h"
int chattr_fd(int fd, unsigned value, unsigned mask) {
unsigned old_attr, new_attr;
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <time.h>
#include <linux/rtc.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include "fd-util.h"
#include "macro.h"
#include "string-util.h"
-#include "util.h"
int clock_get_hwclock(struct tm *tm) {
_cleanup_close_ int fd = -1;
#include <dirent.h>
#include <errno.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/sendfile.h>
+#include <sys/stat.h>
#include <sys/xattr.h>
+#include <time.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "btrfs-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "io-util.h"
+#include "macro.h"
+#include "time-util.h"
#include "string-util.h"
#include "strv.h"
#include "umask-util.h"
-#include "util.h"
#include "xattr-util.h"
#define COPY_BUFFER_SIZE (16*1024)
#include <inttypes.h>
#include <stdbool.h>
+#include <stdint.h>
#include <sys/types.h>
int copy_file_fd(const char *from, int to, bool try_reflink);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stddef.h>
+#include <syslog.h>
+
#include "alloc-util.h"
#include "cpu-set-util.h"
#include "extract-word.h"
#include "parse-util.h"
+#include "log.h"
+#include "macro.h"
#include "string-util.h"
-#include "util.h"
cpu_set_t* cpu_set_malloc(unsigned *ncpus) {
cpu_set_t *c;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stdio.h>
+#include <string.h>
#include "device-nodes.h"
#include "utf8.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stddef.h>
#include <sys/types.h>
int encode_devnode_name(const char *str, char *str_enc, size_t len);
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
#include "dirent-util.h"
+#include "path-util.h"
#include "string-util.h"
int dirent_ensure_type(DIR *d, struct dirent *de) {
***/
#include <dirent.h>
+#include <errno.h>
+#include <stdbool.h>
#include "path-util.h"
+#include "macro.h"
int dirent_ensure_type(DIR *d, struct dirent *de);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "alloc-util.h"
-#include "def.h"
#include "env-util.h"
#include "parse-util.h"
+#include "extract-word.h"
+#include "macro.h"
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
-#include "util.h"
#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
***/
#include <stdbool.h>
+#include <stddef.h>
#include "macro.h"
#include <string.h>
#include "errno-list.h"
-#include "util.h"
+#include "macro.h"
static const struct errno_name* lookup_errno(register const char *str,
register unsigned int len);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "alloc-util.h"
#include "escape.h"
#include "hexdecoct.h"
-#include "string-util.h"
+#include "macro.h"
#include "utf8.h"
-#include "util.h"
size_t cescape_char(char c, char *buf) {
char * buf_old = buf;
***/
#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
+#include "string-util.h"
+
/* What characters are special in the shell? */
/* must be escaped outside and inside double-quotes */
#define SHELL_NEED_ESCAPE "\"\\`$"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <net/ethernet.h>
#include <stdio.h>
+#include <sys/types.h>
#include "ether-addr-util.h"
#include "macro.h"
#include <stdbool.h>
#include "set.h"
+#include "hashmap.h"
+#include "macro.h"
typedef enum ExitStatus {
/* EXIT_SUCCESS defined by libc */
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "alloc-util.h"
#include "escape.h"
#include "extract-word.h"
+#include "log.h"
+#include "macro.h"
#include "string-util.h"
#include "utf8.h"
-#include "util.h"
int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags) {
_cleanup_free_ char *s = NULL;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "dirent-util.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
#include "fd-util.h"
#include "parse-util.h"
#include "socket-util.h"
+#include "macro.h"
+#include "missing.h"
+#include "path-util.h"
#include "util.h"
int close_nointr(int fd) {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <alloca.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#include <stddef.h>
#include "sd-daemon.h"
-#include "dirent-util.h"
#include "fd-util.h"
#include "fdset.h"
#include "macro.h"
#include "parse-util.h"
#include "set.h"
-#include "util.h"
+#include "log.h"
+#include "path-util.h"
#define MAKE_SET(s) ((Set*) s)
#define MAKE_FDSET(s) ((FDSet*) s)
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
#include "set.h"
+#include "hashmap.h"
+#include "macro.h"
typedef struct FDSet FDSet;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/stat.h>
+
#include "fileio-label.h"
#include "selinux-util.h"
-#include "util.h"
+#include "fileio.h"
int write_string_file_atomic_label(const char *fn, const char *line) {
int r;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "random-util.h"
+#include "log.h"
+#include "macro.h"
+#include "time-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "strv.h"
#include "umask-util.h"
#include "utf8.h"
-#include "util.h"
int write_string_stream(FILE *f, const char *line, bool enforce_newline) {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+
#include "alloc-util.h"
#include "dirent-util.h"
#include "fd-util.h"
#include "mkdir.h"
#include "parse-util.h"
#include "path-util.h"
+#include "log.h"
+#include "macro.h"
+#include "missing.h"
+#include "time-util.h"
#include "string-util.h"
#include "strv.h"
#include "user-util.h"
#include <fcntl.h>
#include <limits.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <sys/inotify.h>
#include <sys/types.h>
#include <unistd.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <glob.h>
#include "glob-util.h"
-#include "string-util.h"
+#include "macro.h"
#include "strv.h"
-#include "util.h"
int glob_exists(const char *path) {
_cleanup_globfree_ glob_t g = {};
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
#include <string.h>
#include "macro.h"
* Copyright 2000, 2005 Red Hat, Inc.
*/
+#include <stdlib.h>
+
#include "gunicode.h"
#define unichar uint32_t
***/
#include <errno.h>
-#include <pthread.h>
+#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include "alloc-util.h"
#include "hashmap.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <limits.h>
#include <stdbool.h>
+#include <stddef.h>
#include "macro.h"
#include "siphash24.h"
***/
#include <ctype.h>
-#include <inttypes.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
#include "alloc-util.h"
#include "hexdecoct.h"
-#include "util.h"
+#include "macro.h"
char octchar(int x) {
return '0' + (x & 7);
***/
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
+#include <bits/local_lim.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
#include <sys/utsname.h>
+#include <unistd.h>
#include "fd-util.h"
#include "fileio.h"
#include "hostname-util.h"
+#include "macro.h"
#include "string-util.h"
-#include "util.h"
bool hostname_is_set(void) {
struct utsname u;
***/
#include <arpa/inet.h>
+#include <endian.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
#include "alloc-util.h"
#include "in-addr-util.h"
+#include "macro.h"
+#include "util.h"
int in_addr_is_null(int family, const union in_addr_union *u) {
assert(u);
***/
#include <netinet/in.h>
+#include <stddef.h>
+#include <sys/socket.h>
#include "macro.h"
#include "util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <limits.h>
#include <poll.h>
+#include <stdio.h>
+#include <time.h>
#include <unistd.h>
#include "io-util.h"
+#include "time-util.h"
int flush_fd(int fd) {
struct pollfd pollfd = {
***/
#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/uio.h>
+#include "macro.h"
#include "time-util.h"
int flush_fd(int fd);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <math.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "alloc-util.h"
***/
#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include "macro.h"
#include "util.h"
enum {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
#include "label.h"
#include "selinux-util.h"
#include "smack-util.h"
-#include "util.h"
+#include "macro.h"
int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
int r, q;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
#include <langinfo.h>
+#include <libintl.h>
#include <locale.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/mman.h>
+#include <sys/stat.h>
#include "dirent-util.h"
#include "fd-util.h"
#include "locale-util.h"
#include "path-util.h"
#include "set.h"
+#include "hashmap.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
-#include "util.h"
static int add_locales_from_archive(Set *locales) {
/* Stolen from glibc... */
***/
#include <errno.h>
-#include <limits.h>
-#include <stdbool.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
+#include <sys/stat.h>
#include "alloc-util.h"
#include "fd-util.h"
-#include "fileio.h"
#include "fs-util.h"
#include "lockfile-util.h"
#include "path-util.h"
-#include "util.h"
+#include "macro.h"
int make_lock_file(const char *p, int operation, LockFile *ret) {
_cleanup_close_ int fd = -1;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stddef.h>
+
#include "macro.h"
#include "missing.h"
#include <errno.h>
#include <fcntl.h>
-#include <printf.h>
+#include <inttypes.h>
+#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
+#include <string.h>
+#include <sys/signalfd.h>
#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/uio.h>
#include <sys/un.h>
+#include <time.h>
#include <unistd.h>
#include "sd-messages.h"
#include "process-util.h"
#include "signal-util.h"
#include "socket-util.h"
+#include "time-util.h"
#include "stdio-util.h"
#include "string-table.h"
#include "string-util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "def.h"
+#include <string.h>
+
#include "login-util.h"
#include "string-util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
#ifdef HAVE_LINUX_MEMFD_H
#include <linux/memfd.h>
#endif
#include "fd-util.h"
#include "memfd-util.h"
#include "missing.h"
+#include "macro.h"
#include "string-util.h"
#include "utf8.h"
-#include "util.h"
int memfd_new(const char *name) {
_cleanup_free_ char *g = NULL;
***/
#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
int memfd_new(const char *name);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdint.h>
+#include <stdlib.h>
+
#include "macro.h"
#include "mempool.h"
#include "util.h"
***/
#include <stdio.h>
+#include <sys/types.h>
#include <unistd.h>
#include "label.h"
***/
#include <errno.h>
+#include <stdbool.h>
#include <string.h>
+#include <sys/stat.h>
#include "fs-util.h"
#include "mkdir.h"
#include "path-util.h"
+#include "macro.h"
#include "stat-util.h"
#include "user-util.h"
-#include "util.h"
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) {
struct stat st;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
+#include <sys/stat.h>
#include <sys/statvfs.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "escape.h"
#include "parse-util.h"
#include "path-util.h"
#include "set.h"
+#include "hashmap.h"
#include "stdio-util.h"
#include "string-util.h"
-#include "util.h"
static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
#include <fcntl.h>
#include <mntent.h>
#include <stdbool.h>
+#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "missing.h"
+#include "macro.h"
int fd_is_mount_point(int fd, const char *filename, int flags);
int path_is_mount_point(const char *path, int flags);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <inttypes.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <xlocale.h>
+
#include "alloc-util.h"
#include "extract-word.h"
#include "parse-util.h"
+#include "macro.h"
#include "string-util.h"
-#include "util.h"
int parse_boolean(const char *v) {
assert(v);
***/
#include <inttypes.h>
+#include <limits.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
#include "macro.h"
***/
#include <errno.h>
-#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/statvfs.h>
+#include <sys/stat.h>
#include <unistd.h>
/* When we include libgen.h because we need dirname() we immediately
#undef basename
#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "fs-util.h"
#include "log.h"
#include "macro.h"
#include "missing.h"
-#include "parse-util.h"
#include "path-util.h"
+#include "extract-word.h"
+#include "time-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
-#include "util.h"
bool path_is_absolute(const char *p) {
return p[0] == '/';
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <alloca.h>
#include <stdbool.h>
+#include <stddef.h>
#include "macro.h"
#include "time-util.h"
* The underlying algorithm used in this implementation is a Heap.
*/
+#include <errno.h>
+#include <stdlib.h>
+
#include "alloc-util.h"
#include "prioq.h"
-#include "util.h"
+#include "hashmap.h"
struct prioq_item {
void *data;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
#include "hashmap.h"
+#include "macro.h"
typedef struct Prioq Prioq;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
#include "alloc-util.h"
#include "extract-word.h"
#include "fileio.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <ctype.h>
#include <errno.h>
+#include <limits.h>
+#include <linux/oom.h>
#include <sched.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/personality.h>
#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <syslog.h>
#include <unistd.h>
#include "alloc-util.h"
#include "log.h"
#include "process-util.h"
#include "signal-util.h"
+#include "macro.h"
+#include "missing.h"
#include "string-table.h"
#include "string-util.h"
#include "user-util.h"
#include <alloca.h>
#include <signal.h>
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <elf.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <sys/time.h>
#include <linux/random.h>
#include <stdint.h>
+
#ifdef HAVE_SYS_AUXV_H
#include <sys/auxv.h>
#endif
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <time.h>
#include "fd-util.h"
#include "io-util.h"
#include "missing.h"
#include "random-util.h"
#include "time-util.h"
-#include "util.h"
int dev_urandom(void *p, size_t n) {
static int have_syscall = -1;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stddef.h>
#include <stdint.h>
int dev_urandom(void *p, size_t n);
***/
+#include <sys/time.h>
+
#include "ratelimit.h"
+#include "macro.h"
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
+#include "time-util.h"
#include "util.h"
typedef struct RateLimit {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stddef.h>
+#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "macro.h"
#include "replace-var.h"
#include "string-util.h"
-#include "util.h"
/*
* Generic infrastructure for replacing @FOO@ style variables in
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <sys/resource.h>
+
#include "missing.h"
#include "rlimit-util.h"
+#include "macro.h"
#include "string-table.h"
-#include "util.h"
int setrlimit_closest(int resource, const struct rlimit *rlim) {
struct rlimit highest, fixed;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <unistd.h>
+
#include "btrfs-util.h"
#include "fd-util.h"
#include "mount-util.h"
#include "path-util.h"
#include "rm-rf.h"
+#include "log.h"
+#include "macro.h"
#include "stat-util.h"
#include "string-util.h"
-#include "util.h"
int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) {
_cleanup_closedir_ DIR *d = NULL;
#include <errno.h>
#include <malloc.h>
+#include <stddef.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
#include <sys/un.h>
+#include <syslog.h>
#ifdef HAVE_SELINUX
#include <selinux/context.h>
#include "alloc-util.h"
#include "path-util.h"
#include "selinux-util.h"
-#include "strv.h"
+#include "log.h"
+#include "macro.h"
+#include "time-util.h"
+#include "util.h"
#ifdef HAVE_SELINUX
DEFINE_TRIVIAL_CLEANUP_FUNC(security_context_t, freecon);
#define log_enforcing(...) log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG, __VA_ARGS__)
#endif
-bool mac_selinux_use(void) {
+bool mac_selinux_have(void) {
#ifdef HAVE_SELINUX
if (cached_use < 0)
cached_use = is_selinux_enabled() > 0;
#endif
}
+bool mac_selinux_use(void) {
+ if (!mac_selinux_have())
+ return false;
+
+ /* Never try to configure SELinux features if we aren't
+ * root */
+
+ return getuid() == 0;
+}
+
void mac_selinux_retest(void) {
#ifdef HAVE_SELINUX
cached_use = -1;
assert(exe);
assert(label);
- if (!mac_selinux_use())
+ if (!mac_selinux_have())
return -EOPNOTSUPP;
r = getcon_raw(&mycon);
assert(label);
#ifdef HAVE_SELINUX
- if (!mac_selinux_use())
+ if (!mac_selinux_have())
return -EOPNOTSUPP;
r = getcon_raw(label);
assert(exe);
assert(label);
- if (!mac_selinux_use())
+ if (!mac_selinux_have())
return -EOPNOTSUPP;
r = getcon_raw(&mycon);
if (!label)
return NULL;
- if (!mac_selinux_use())
+ if (!mac_selinux_have())
return NULL;
#include <stdbool.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include "macro.h"
bool mac_selinux_use(void);
+bool mac_selinux_have(void);
void mac_selinux_retest(void);
int mac_selinux_init(const char *prefix);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <signal.h>
+#include <stddef.h>
#include <sys/mman.h>
#include "macro.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+
#include "parse-util.h"
#include "signal-util.h"
+#include "macro.h"
#include "string-table.h"
#include "string-util.h"
-#include "util.h"
int reset_all_signal_handlers(void) {
static const struct sigaction sa = {
*/
#include "siphash24.h"
-#include "sparse-endian.h"
+#include "macro.h"
#include "unaligned.h"
-#include "util.h"
static inline uint64_t rotate_left(uint64_t x, uint8_t b) {
assert(b < 64);
#pragma once
#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
struct siphash {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
#include <sys/xattr.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "fileio.h"
#include "path-util.h"
#include "process-util.h"
#include "smack-util.h"
+#include "log.h"
+#include "macro.h"
#include "string-table.h"
-#include "util.h"
#include "xattr-util.h"
#ifdef HAVE_SMACK
***/
#include <stdbool.h>
+#include <sys/types.h>
#include "macro.h"
***/
#include <errno.h>
+#include <netinet/in.h>
+#include <stdbool.h>
#include <stddef.h>
#include <string.h>
+#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/un.h>
#include <unistd.h>
#include "alloc-util.h"
#include "mkdir.h"
#include "selinux-util.h"
#include "socket-util.h"
-#include "util.h"
+#include "log.h"
int socket_address_listen(
const SocketAddress *a,
#include <arpa/inet.h>
#include <errno.h>
+#include <limits.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/ip.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "socket-util.h"
+#include "log.h"
#include "string-table.h"
#include "string-util.h"
#include "user-util.h"
#include <netinet/ether.h>
#include <netinet/in.h>
+#include <stdbool.h>
+#include <stddef.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <sys/un.h>
#include <linux/netlink.h>
#include <linux/if_packet.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <errno.h>
#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <linux/magic.h>
#include <sys/statvfs.h>
#include <unistd.h>
***/
#include <stdbool.h>
+#include <stddef.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
#include <sys/types.h>
#include <sys/vfs.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "strbuf.h"
-#include "util.h"
/*
* Strbuf stores given strings in a single continuous allocated memory
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stddef.h>
#include <stdint.h>
+#include <sys/types.h>
struct strbuf {
char *buf;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "string-util.h"
#include "string-table.h"
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include "alloc-util.h"
#include "gunicode.h"
+#include "macro.h"
#include "string-util.h"
#include "utf8.h"
#include "util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <alloca.h>
#include <stdbool.h>
+#include <stddef.h>
#include <string.h>
#include "macro.h"
***/
#include <errno.h>
+#include <fnmatch.h>
#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "escape.h"
+#include "extract-word.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
#include <fnmatch.h>
#include <stdarg.h>
#include <stdbool.h>
+#include <stddef.h>
#include "extract-word.h"
+#include "alloc-util.h"
+#include "macro.h"
#include "util.h"
char *strv_find(char **l, const char *name) _pure_;
* Returns the * remaining size, and 0 if the string was truncated.
*/
+#include <stdarg.h>
#include <stdio.h>
#include <string.h>
***/
+#include <stddef.h>
+
#include "macro.h"
size_t strpcpy(char **dest, size_t size, const char *src);
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <string.h>
#include <syslog.h>
-#include "assert.h"
#include "hexdecoct.h"
+#include "macro.h"
#include "string-table.h"
#include "syslog-util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/inotify.h>
+#include <sys/socket.h>
+#include <sys/sysmacros.h>
+#include <sys/time.h>
#include <linux/kd.h>
#include <linux/tiocl.h>
#include <linux/vt.h>
#include <poll.h>
#include <signal.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <termios.h>
-#include <time.h>
#include <unistd.h>
#include "alloc-util.h"
#include "fs-util.h"
#include "io-util.h"
#include "parse-util.h"
-#include "path-util.h"
#include "process-util.h"
#include "socket-util.h"
+#include "log.h"
+#include "macro.h"
#include "stat-util.h"
#include "string-util.h"
#include "terminal-util.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
+#include <sys/types.h>
#include "macro.h"
#include "time-util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
#include <sys/timerfd.h>
#include <sys/timex.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "parse-util.h"
#include "path-util.h"
+#include "log.h"
+#include "macro.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
-#include "util.h"
usec_t now(clockid_t clock_id) {
struct timespec ts;
***/
#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <time.h>
***/
#include <errno.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "bus-label.h"
-#include "def.h"
#include "hexdecoct.h"
#include "path-util.h"
+#include "macro.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
-#include "util.h"
#define VALID_CHARS \
DIGITS LETTERS \
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <alloca.h>
+#include <errno.h>
+#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "macro.h"
#include "parse-util.h"
#include "path-util.h"
+#include "formats-util.h"
#include "string-util.h"
#include "user-util.h"
-#include "util.h"
bool uid_is_valid(uid_t uid) {
*/
#include <errno.h>
-#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "hexdecoct.h"
+#include "macro.h"
#include "utf8.h"
-#include "util.h"
bool unichar_is_valid(uint32_t ch) {
***/
#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
#include "macro.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
+#include <alloca.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <grp.h>
-#include <langinfo.h>
-#include <libintl.h>
-#include <limits.h>
-#include <linux/magic.h>
-#include <linux/oom.h>
-#include <linux/sched.h>
-#include <locale.h>
-#include <poll.h>
-#include <pwd.h>
#include <sched.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/personality.h>
#include <sys/prctl.h>
-#include <sys/stat.h>
-#include <sys/statvfs.h>
-#include <sys/time.h>
+#include <sys/statfs.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/vfs.h>
-#include <sys/wait.h>
-#include <syslog.h>
#include <unistd.h>
-/* When we include libgen.h because we need dirname() we immediately
- * undefine basename() since libgen.h defines it as a macro to the
- * POSIX version which is really broken. We prefer GNU basename(). */
-#include <libgen.h>
-#undef basename
-
-#ifdef HAVE_SYS_AUXV_H
-#include <sys/auxv.h>
-#endif
-
-/* We include linux/fs.h as last of the system headers, as it
- * otherwise conflicts with sys/mount.h. Yay, Linux is great! */
-#include <linux/fs.h>
-
#include "alloc-util.h"
#include "build.h"
#include "def.h"
-#include "device-nodes.h"
#include "dirent-util.h"
-#include "env-util.h"
-#include "escape.h"
-#include "exit-status.h"
#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
-#include "gunicode.h"
#include "hashmap.h"
-#include "hexdecoct.h"
#include "hostname-util.h"
-#include "ioprio.h"
#include "log.h"
#include "macro.h"
#include "missing.h"
-#include "mkdir.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
-#include "random-util.h"
#include "signal-util.h"
-#include "sparse-endian.h"
+#include "set.h"
+#include "time-util.h"
#include "stat-util.h"
-#include "string-table.h"
#include "string-util.h"
#include "strv.h"
-#include "terminal-util.h"
#include "user-util.h"
-#include "utf8.h"
#include "util.h"
-#include "virt.h"
/* Put this test here for a lack of better place */
assert_cc(EAGAIN == EWOULDBLOCK);
***/
#include <alloca.h>
+#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/inotify.h>
#include <sys/socket.h>
#include <sys/stat.h>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#include "log.h"
+#include "macro.h"
#include "string-util.h"
-#include "util.h"
#include "verbs.h"
int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) {
***/
#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
#include "fileio.h"
#include "process-util.h"
+#include "macro.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
-#include "util.h"
#include "virt.h"
static int detect_vm_cpuid(void) {
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
#include <sys/xattr.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "sparse-endian.h"
+#include "macro.h"
+#include "time-util.h"
#include "stdio-util.h"
-#include "util.h"
#include "xattr-util.h"
int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink) {
***/
#include <stdbool.h>
+#include <stddef.h>
#include <sys/types.h>
#include "time-util.h"
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stddef.h>
#include <string.h>
+#include "macro.h"
#include "string-util.h"
-#include "util.h"
#include "xml.h"
enum {
if (!arg_machine) {
r = cg_get_root_path(ret);
- if (r < 0)
+ if (r == -ENOEXEC)
+ return log_error_errno(r, "Failed to get root control group path: No cgroup filesystem mounted on /sys/fs/cgroup");
+ else if (r < 0)
return log_error_errno(r, "Failed to get root control group path: %m");
return 0;
return log_error_errno(errno, "SO_PASSCRED failed: %m");
#ifdef HAVE_SELINUX
- if (mac_selinux_use()) {
+ if (mac_selinux_have()) {
r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one));
if (r < 0)
log_warning_errno(errno, "SO_PASSSEC failed: %m");
}
#ifdef HAVE_SELINUX
- if (mac_selinux_use()) {
+ if (mac_selinux_have()) {
if (label) {
x = alloca(strlen("_SELINUX_CONTEXT=") + label_len + 1);
if (r < 0)
return log_error_errno(r, "Failed to determine peer credentials: %m");
- if (mac_selinux_use()) {
+ if (mac_selinux_have()) {
r = getpeersec(fd, &stream->label);
if (r < 0 && r != -EOPNOTSUPP)
(void) log_warning_errno(r, "Failed to determine peer security context: %m");
return log_error_errno(errno, "SO_PASSCRED failed: %m");
#ifdef HAVE_SELINUX
- if (mac_selinux_use()) {
+ if (mac_selinux_have()) {
r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one));
if (r < 0)
log_warning_errno(errno, "SO_PASSSEC failed: %m");
b->ucred_valid = getpeercred(b->input_fd, &b->ucred) >= 0;
/* Get the SELinux context of the peer */
- if (mac_selinux_use()) {
+ if (mac_selinux_have()) {
r = getpeersec(b->input_fd, &b->label);
if (r < 0 && r != -EOPNOTSUPP)
log_debug_errno(r, "Failed to determine peer security context: %m");
}
static int dns_query_candidate_next_search_domain(DnsQueryCandidate *c) {
- _cleanup_(dns_search_domain_unrefp) DnsSearchDomain *previous = NULL;
DnsSearchDomain *next = NULL;
assert(c);
assert(c->type == CONDITION_SECURITY);
if (streq(c->parameter, "selinux"))
- return mac_selinux_use();
+ return mac_selinux_have();
if (streq(c->parameter, "smack"))
return mac_smack_use();
if (streq(c->parameter, "apparmor"))
assert(a);
for (;;) {
- _cleanup_free_ char *t = NULL;
char label[DNS_LABEL_MAX];
int k;
# ifdef __cplusplus
# define _SD_BEGIN_DECLARATIONS \
extern "C" { \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# else
# define _SD_BEGIN_DECLARATIONS \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# endif
#endif
# ifdef __cplusplus
# define _SD_END_DECLARATIONS \
} \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_cpp_struct_to_allow_trailing_semicolon_
# else
# define _SD_END_DECLARATIONS \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# endif
#endif
if (*p) \
func(*p); \
} \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
#endif
condition_free(condition);
condition = condition_new(CONDITION_SECURITY, "selinux", false, true);
- assert_se(condition_test(condition) != mac_selinux_use());
+ assert_se(condition_test(condition) != mac_selinux_have());
condition_free(condition);
condition = condition_new(CONDITION_SECURITY, "ima", false, false);