chiark / gitweb /
shared: missing.h should include btrfs.h, before redefining some of its definitions
[elogind.git] / src / shared / missing.h
index 4faff89b6c37c65c53b3e07fd40b28fff42c3539..c547479ad277651058a96d117742b153f572ba67 100644 (file)
 #include <linux/if_link.h>
 #include <linux/loop.h>
 #include <linux/audit.h>
+#include <linux/capability.h>
 
 #ifdef HAVE_AUDIT
 #include <libaudit.h>
 #endif
 
-#include "macro.h"
-
 #ifdef ARCH_MIPS
 #include <asm/sgidefs.h>
 #endif
 
+#ifdef HAVE_LINUX_BTRFS_H
+#include <linux/btrfs.h>
+#endif
+
+#include "macro.h"
+
 #ifndef RLIMIT_RTTIME
 #define RLIMIT_RTTIME 15
 #endif
@@ -135,8 +140,11 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
 #    if _MIPS_SIM == _MIPS_SIM_ABI64
 #      define __NR_memfd_create 5314
 #    endif
-#  else
+#  elif defined __i386__
 #    define __NR_memfd_create 356
+#  else
+#    warning "__NR_memfd_create unknown for your architecture"
+#    define __NR_memfd_create 0xffffffff
 #  endif
 #endif
 
@@ -563,6 +571,10 @@ static inline int setns(int fd, int nstype) {
 #  define NET_ADDR_RANDOM 1
 #endif
 
+#ifndef NET_NAME_UNKNOWN
+#  define NET_NAME_UNKNOWN 0
+#endif
+
 #ifndef NET_NAME_ENUM
 #  define NET_NAME_ENUM 1
 #endif
@@ -599,3 +611,27 @@ static inline int setns(int fd, int nstype) {
 #ifndef AUDIT_NLGRP_MAX
 #define AUDIT_NLGRP_READLOG 1
 #endif
+
+#ifndef CAP_MAC_OVERRIDE
+#define CAP_MAC_OVERRIDE 32
+#endif
+
+#ifndef CAP_MAC_ADMIN
+#define CAP_MAC_ADMIN 33
+#endif
+
+#ifndef CAP_SYSLOG
+#define CAP_SYSLOG 34
+#endif
+
+#ifndef CAP_WAKE_ALARM
+#define CAP_WAKE_ALARM 35
+#endif
+
+#ifndef CAP_BLOCK_SUSPEND
+#define CAP_BLOCK_SUSPEND 36
+#endif
+
+#ifndef CAP_AUDIT_READ
+#define CAP_AUDIT_READ 37
+#endif