diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2013-07-13 05:26:37 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-07-13 05:26:37 -0400 |
| commit | bb458c644a59dbba3a1fe59b27106c5e68e1c4bd (patch) | |
| tree | b0f3b51fc5cbd044b076cb0a1fec43ca62f2b7f5 /include/uapi/asm-generic | |
| parent | 4fbeb19d53cc3ef2da4bd1fd89a5dc9ac04add3a (diff) | |
Safer ABI for O_TMPFILE
[suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE;
that will fail on old kernels in a lot more cases than what I came up with.
And make sure O_CREAT doesn't get there...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/uapi/asm-generic')
| -rw-r--r-- | include/uapi/asm-generic/fcntl.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index 06632beaa6d5..05ac354e124d 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h | |||
| @@ -84,10 +84,14 @@ | |||
| 84 | #define O_PATH 010000000 | 84 | #define O_PATH 010000000 |
| 85 | #endif | 85 | #endif |
| 86 | 86 | ||
| 87 | #ifndef O_TMPFILE | 87 | #ifndef __O_TMPFILE |
| 88 | #define O_TMPFILE 020000000 | 88 | #define __O_TMPFILE 020000000 |
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | /* a horrid kludge trying to make sure that this will fail on old kernels */ | ||
| 92 | #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR) | ||
| 93 | #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE) | ||
| 94 | |||
| 91 | #ifndef O_NDELAY | 95 | #ifndef O_NDELAY |
| 92 | #define O_NDELAY O_NONBLOCK | 96 | #define O_NDELAY O_NONBLOCK |
| 93 | #endif | 97 | #endif |
