summaryrefslogtreecommitdiffstats
path: root/patches/systemd-230/0006-missing-define-syncfs.patch
blob: b117a1e2e15584d401f6818078d0073af27b3059 (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
44
45
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Sat, 1 Aug 2015 21:36:38 +0200
Subject: [PATCH] missing: define syncfs

This is required for glibc < 2.14

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

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 configure.ac        | 1 +
 src/basic/missing.h | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index 35f96228f06a..00a68a7ea867 100644
--- a/configure.ac
+++ b/configure.ac
@@ -309,6 +309,7 @@ AC_CHECK_DECLS([
         pivot_root,
         name_to_handle_at,
         setns,
+        syncfs,
         getrandom,
         renameat2,
         kcmp,
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 187b16757887..e67763c9b8ca 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -849,6 +849,14 @@ struct btrfs_ioctl_quota_ctl_args {
 #define AT_EMPTY_PATH	0x1000	/* Allow empty relative pathname */
 #endif
 
+#if !HAVE_DECL_SYNCFS
+static inline int syncfs(int fd)
+{
+        errno = ENOSYS;
+        return -1;
+}
+#endif
+
 #ifndef IPV6_UNICAST_IF
 #define IPV6_UNICAST_IF 76
 #endif