summaryrefslogtreecommitdiff
path: root/src/basic/missing.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-08-30 09:47:25 +0200
committerGitHub <noreply@github.com>2016-08-30 09:47:25 +0200
commit4a13100c6a5a0a4b793e90bd43d21c3696c42d46 (patch)
treea2a901acb79f830805b4b15817602b0e92aa78be /src/basic/missing.h
parent3e2b21089402e7ae0ce855f1e7be4585ff330150 (diff)
parent1d9ed171788821c21ca900a921833a8e41bf22f3 (diff)
Merge pull request #4052 from yann-morin-1998/yem/o-tmpfile
importd: fix build failure with missing O_TMPFILE (branch yem/o-tmpfile)
Diffstat (limited to 'src/basic/missing.h')
-rw-r--r--src/basic/missing.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index f8e096605e..13ff51cd35 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -537,12 +537,21 @@ struct btrfs_ioctl_quota_ctl_args {
# define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f)
#endif
-#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. */
+/* The precise definition of __O_TMPFILE is arch specific; use the
+ * values defined by the kernel (note: some are hexa, some are octal,
+ * duplicated as-is from the kernel definitions):
+ * - alpha, parisc, sparc: each has a specific value;
+ * - others: they use the "generic" value.
+ */
#ifndef __O_TMPFILE
+#if defined(__alpha__)
+#define __O_TMPFILE 0100000000
+#elif defined(__parisc__) || defined(__hppa__)
+#define __O_TMPFILE 0400000000
+#elif defined(__sparc__) || defined(__sparc64__)
+#define __O_TMPFILE 0x2000000
+#else
#define __O_TMPFILE 020000000
#endif