X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmissing.h;h=ac6f5bf6afdee84db171176f1618d340b0237d11;hb=c305c32580a1d7689a401e8cf673ec7936c12bbe;hp=4e62100030b0b58438f955cea102f406ba150328;hpb=65b3903ff576488eaabb51d3c4fbf9c73d867d7c;p=elogind.git diff --git a/src/shared/missing.h b/src/shared/missing.h index 4e6210003..ac6f5bf6a 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -324,6 +324,18 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle # define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) #endif -#ifndef TMP_MAX -# define TMP_MAX 238328 +#if defined(__i386__) || defined(__x86_64__) + +/* The precise definition of __O_TMPFILE is arch specific, so let's + * just define this on x86 where we know the value. */ + +#ifndef __O_TMPFILE +#define __O_TMPFILE 020000000 +#endif + +/* a horrid kludge trying to make sure that this will fail on old kernels */ +#ifndef O_TMPFILE +#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) +#endif + #endif