Make sync_file_range() usage optional
authorSamuel Martin <s.martin49@gmail.com>
Sat, 12 Jan 2013 08:23:57 +0000 (09:23 +0100)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 16 Jan 2013 15:53:37 +0000 (10:53 -0500)
Under uClibc, sync_file_range() is not available under all
architectures, so we fall back to fdatasync() in this case.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
configure.ac
src/common/compat/compat-fcntl.c

index 857e8e9fc60a0520b2db2dcf7283d67804093cdb..91e76f06a98700d2a9deb36c29a650176e62c4ab 100644 (file)
@@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
        )
 ])
 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],
index 5a1c757b864ed1de210f19b60744714bce01dcd6..7ff63a3a109146e81cb696691f780b6d1117c013 100644 (file)
 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__ */
This page took 0.026718 seconds and 4 git commands to generate.