chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
memfd: always create our memfds with CLOEXEC set
[elogind.git]
/
src
/
shared
/
missing.h
diff --git
a/src/shared/missing.h
b/src/shared/missing.h
index 0cfb6fa4c3895e1740b78c0413b331fcc4792f2c..0d7c55952ee3f885ecf8c0cd3121c1dfd40ce374 100644
(file)
--- a/
src/shared/missing.h
+++ b/
src/shared/missing.h
@@
-74,7
+74,11
@@
#endif
#ifndef MFD_ALLOW_SEALING
#endif
#ifndef MFD_ALLOW_SEALING
-#define MFD_ALLOW_SEALING 0x0002ULL
+#define MFD_ALLOW_SEALING 0x0002U
+#endif
+
+#ifndef MFD_CLOEXEC
+#define MFD_CLOEXEC 0x0001U
#endif
#ifndef IP_FREEBIND
#endif
#ifndef IP_FREEBIND
@@
-136,7
+140,7
@@
static inline int memfd_create(const char *name, unsigned int flags) {
#ifndef __NR_getrandom
# if defined __x86_64__
#ifndef __NR_getrandom
# if defined __x86_64__
-# define __NR_getrandom
27
8
+# define __NR_getrandom
31
8
# else
# warning "__NR_getrandom unknown for your architecture"
# define __NR_getrandom 0xffffffff
# else
# warning "__NR_getrandom unknown for your architecture"
# define __NR_getrandom 0xffffffff
@@
-149,6
+153,14
@@
static inline int getrandom(void *buffer, size_t count, unsigned flags) {
}
#endif
}
#endif
+#ifndef GRND_NONBLOCK
+#define GRND_NONBLOCK 0x0001
+#endif
+
+#ifndef GRND_RANDOM
+#define GRND_RANDOM 0x0002
+#endif
+
#ifndef BTRFS_IOCTL_MAGIC
#define BTRFS_IOCTL_MAGIC 0x94
#endif
#ifndef BTRFS_IOCTL_MAGIC
#define BTRFS_IOCTL_MAGIC 0x94
#endif
@@
-420,7
+432,7
@@
static inline int setns(int fd, int nstype) {
#define IFLA_BOND_AD_INFO 23
#define __IFLA_BOND_MAX 24
#define IFLA_BOND_AD_INFO 23
#define __IFLA_BOND_MAX 24
-#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
+#define IFLA_BOND_MAX
(__IFLA_BOND_MAX - 1)
#endif
#if !HAVE_DECL_IFLA_VLAN_PROTOCOL
#endif
#if !HAVE_DECL_IFLA_VLAN_PROTOCOL