ksymoops: remove package, it has been obsolete and useless for a long time
[openwrt.org/packages.git] / devel / 001-uclibc_sync_file_ranges.patch
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
Make sync_file_range() usage optional
 
Under uClibc, sync_file_range() is not available under all
architectures, so we fall back to fdatasync() in this case.
 
Inspired by the patch done by Thomas Petazzoni for the
2.0-pre25 version.
 
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 configure.ac              |    2 +-
 src/common/compat/fcntl.h |    5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
 
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xye
        )
 ])
 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
-AC_CHECK_FUNCS([sched_getcpu sysconf])
+AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
 
 # check for dlopen
 AC_CHECK_LIB([dl], [dlopen],
@@ -394,4 +394,3 @@ AS_IF([test "x$consumerd_only" = "xno"],
 ])
 
 AS_ECHO()
-
--- a/src/common/compat/compat-fcntl.c
+++ b/src/common/compat/compat-fcntl.c
@@ -23,7 +23,11 @@
 int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
                unsigned int flags)
 {
+#ifdef HAVE_SYNC_FILE_RANGE
        return sync_file_range(fd, offset, nbytes, flags);
+#else
+       return fdatasync(fd);
+#endif
 }
 
 #endif /* __linux__ */
 
comments