summaryrefslogtreecommitdiffstats
path: root/patches/systemd-229/0004-missing-define-O_PATH-and-AT_EMPTY_PATH.patch
blob: adfb10e58d3be5717f03a4da641d16d31abb0d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 2 Jun 2015 10:46:05 +0200
Subject: [PATCH] missing: define O_PATH and AT_EMPTY_PATH

This is required for glibc <= 2.15

Upstream requires glibc 2.16 but this is useful for host-systemd.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 src/basic/missing.h    | 6 ++++++
 src/basic/xattr-util.c | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/basic/missing.h b/src/basic/missing.h
index 34af717a7ce8..d17d725116e5 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -917,6 +917,12 @@ static inline int setns(int fd, int nstype) {
 #ifndef CLOCK_BOOTTIME_ALARM
 #define CLOCK_BOOTTIME_ALARM 9
 #endif
+#ifndef O_PATH
+#define O_PATH		010000000
+#endif
+#ifndef AT_EMPTY_PATH
+#define AT_EMPTY_PATH	0x1000	/* Allow empty relative pathname */
+#endif
 
 #ifndef IPV6_UNICAST_IF
 #define IPV6_UNICAST_IF 76
diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c
index 8d7f14f3827e..dd9d2ebb1155 100644
--- a/src/basic/xattr-util.c
+++ b/src/basic/xattr-util.c
@@ -25,6 +25,7 @@
 #include <sys/time.h>
 #include <sys/xattr.h>
 
+#include "missing.h"
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "macro.h"