packages: disable mips16 support on a number of packages that fail to build with it
[packages.git] / devel / lttng-tools / patches / 001-uclibc_sync_file_ranges.patch
1 Make sync_file_range() usage optional
2
3 Under uClibc, sync_file_range() is not available under all
4 architectures, so we fall back to fdatasync() in this case.
5
6 Inspired by the patch done by Thomas Petazzoni for the
7 2.0-pre25 version.
8
9 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
10 ---
11  configure.ac              |    2 +-
12  src/common/compat/fcntl.h |    5 +++++
13  2 files changed, 6 insertions(+), 1 deletion(-)
14
15 --- a/configure.ac
16 +++ b/configure.ac
17 @@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xye
18         )
19  ])
20  AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
21 -AC_CHECK_FUNCS([sched_getcpu sysconf])
22 +AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
23  
24  # check for dlopen
25  AC_CHECK_LIB([dl], [dlopen],
26 @@ -394,4 +394,3 @@ AS_IF([test "x$consumerd_only" = "xno"],
27  ])
28  
29  AS_ECHO()
30 -
31 --- a/src/common/compat/compat-fcntl.c
32 +++ b/src/common/compat/compat-fcntl.c
33 @@ -23,7 +23,11 @@
34  int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
35                 unsigned int flags)
36  {
37 +#ifdef HAVE_SYNC_FILE_RANGE
38         return sync_file_range(fd, offset, nbytes, flags);
39 +#else
40 +       return fdatasync(fd);
41 +#endif
42  }
43  
44  #endif /* __linux__ */