]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/missing.h
util: introduce memcmp_safe()
[thirdparty/systemd.git] / src / basic / missing.h
index 9fe750ae2888d348d3e012572f57b567c6a8d499..477992fbcbad898bd7b4abda3a901ee6c10346e1 100644 (file)
@@ -1,12 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
-
 /* Missing glibc definitions to access certain kernel APIs */
 
 #include <errno.h>
@@ -21,7 +15,6 @@
 #include <linux/neighbour.h>
 #include <linux/oom.h>
 #include <linux/rtnetlink.h>
-#include <linux/stat.h>
 #include <net/ethernet.h>
 #include <stdlib.h>
 #include <sys/resource.h>
 #include <uchar.h>
 #include <unistd.h>
 
+#if WANT_LINUX_STAT_H
+#include <linux/stat.h>
+#endif
+
 #if HAVE_AUDIT
 #include <libaudit.h>
 #endif
@@ -329,7 +326,6 @@ struct btrfs_ioctl_search_header {
         __u32 len;
 };
 
-
 struct btrfs_ioctl_search_args {
         struct btrfs_ioctl_search_key key;
         char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
@@ -1187,9 +1183,7 @@ struct input_mask {
 #define KEY_ALS_TOGGLE 0x230
 #endif
 
-#if ! HAVE_KEY_SERIAL_T
 typedef int32_t key_serial_t;
-#endif
 
 #ifndef KEYCTL_JOIN_SESSION_KEYRING
 #define KEYCTL_JOIN_SESSION_KEYRING 1
@@ -1408,4 +1402,11 @@ struct statx {
 #define AT_STATX_DONT_SYNC 0x4000
 #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_syscall.h"