chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ask-password: modernizations
[elogind.git]
/
src
/
shared
/
missing.h
diff --git
a/src/shared/missing.h
b/src/shared/missing.h
index 3142306e35c2375382c2539ea81787cb674d4ad9..bc0fcd56afbf5430aa8ff25668d17b272f021110 100644
(file)
--- a/
src/shared/missing.h
+++ b/
src/shared/missing.h
@@
-32,6
+32,7
@@
#include <linux/oom.h>
#include <linux/input.h>
#include <linux/if_link.h>
#include <linux/oom.h>
#include <linux/input.h>
#include <linux/if_link.h>
+#include <linux/loop.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
@@
-47,6
+48,9
@@
#define RLIMIT_RTTIME 15
#endif
#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
#ifndef F_LINUX_SPECIFIC_BASE
#define F_LINUX_SPECIFIC_BASE 1024
#endif
@@
-273,25
+277,17
@@
static inline pid_t gettid(void) {
#define MAX_HANDLE_SZ 128
#endif
#define MAX_HANDLE_SZ 128
#endif
-#if
defined __x86_64__
-# if
ndef __NR_name_to_handle_at
+#if
ndef __NR_name_to_handle_at
+# if
defined(__x86_64__)
# define __NR_name_to_handle_at 303
# define __NR_name_to_handle_at 303
-# endif
-#elif defined __i386__
-# ifndef __NR_name_to_handle_at
+# elif defined(__i386__)
# define __NR_name_to_handle_at 341
# define __NR_name_to_handle_at 341
-# endif
-#elif defined __arm__
-# ifndef __NR_name_to_handle_at
+# elif defined(__arm__)
# define __NR_name_to_handle_at 370
# define __NR_name_to_handle_at 370
-# endif
-#elif defined __powerpc__
-# ifndef __NR_name_to_handle_at
+# elif defined(__powerpc__)
# define __NR_name_to_handle_at 345
# define __NR_name_to_handle_at 345
-# endif
-#else
-# ifndef __NR_name_to_handle_at
-# error __NR_name_to_handle_at is not defined
+# else
+# error "__NR_name_to_handle_at is not defined"
# endif
#endif
# endif
#endif
@@
-311,7
+307,7
@@
static inline int name_to_handle_at(int fd, const char *name, struct file_handle
# ifdef HAVE___SECURE_GETENV
# define secure_getenv __secure_getenv
# else
# ifdef HAVE___SECURE_GETENV
# define secure_getenv __secure_getenv
# else
-# error
neither secure_getenv nor __secure_getenv are available
+# error
"neither secure_getenv nor __secure_getenv are available"
# endif
#endif
# endif
#endif
@@
-370,3
+366,15
@@
static inline int setns(int fd, int nstype) {
return syscall(__NR_setns, fd, nstype);
}
#endif
return syscall(__NR_setns, fd, nstype);
}
#endif
+
+#if !HAVE_DECL_LO_FLAGS_PARTSCAN
+#define LO_FLAGS_PARTSCAN 8
+#endif
+
+#ifndef LOOP_CTL_REMOVE
+#define LOOP_CTL_REMOVE 0x4C81
+#endif
+
+#ifndef LOOP_CTL_GET_FREE
+#define LOOP_CTL_GET_FREE 0x4C82
+#endif