X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fmissing.h;h=0d7c55952ee3f885ecf8c0cd3121c1dfd40ce374;hp=5b87e23eec311d6d34b3693de361a25a09c3055d;hb=45071fcaa03eafc27352987fa2277b2792725036;hpb=539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60 diff --git a/src/shared/missing.h b/src/shared/missing.h index 5b87e23ee..0d7c55952 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -74,7 +74,11 @@ #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 @@ -115,21 +119,15 @@ static inline int pivot_root(const char *new_root, const char *put_old) { } #endif -#ifdef __x86_64__ -# ifndef __NR_memfd_create +#ifndef __NR_memfd_create +# if defined __x86_64__ # define __NR_memfd_create 319 -# endif -#elif defined __arm__ -# ifndef __NR_memfd_create +# elif defined __arm__ # define __NR_memfd_create 385 -# endif -#elif defined _MIPS_SIM -# ifndef __NR_memfd_create +# elif defined _MIPS_SIM # warning "__NR_memfd_create not yet defined for MIPS" # define __NR_memfd_create 0xffffffff -# endif -#else -# ifndef __NR_memfd_create +# else # define __NR_memfd_create 356 # endif #endif @@ -142,7 +140,7 @@ static inline int memfd_create(const char *name, unsigned int flags) { #ifndef __NR_getrandom # if defined __x86_64__ -# define __NR_getrandom 278 +# define __NR_getrandom 318 # else # warning "__NR_getrandom unknown for your architecture" # define __NR_getrandom 0xffffffff @@ -155,6 +153,14 @@ static inline int getrandom(void *buffer, size_t count, unsigned flags) { } #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 @@ -426,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_MAX (__IFLA_BOND_MAX - 1) +#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) #endif #if !HAVE_DECL_IFLA_VLAN_PROTOCOL