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>
)
])
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],
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__ */