Fix: add missing unistd.h for fdatasync in compat-fcntl.c
[lttng-tools.git] / src / common / compat / compat-fcntl.c
index 5a1c757b864ed1de210f19b60744714bce01dcd6..b462fd76c9c77fa8c15e60b3ae2b5a221f9fe38e 100644 (file)
 
 #define _GNU_SOURCE
 #include <common/compat/fcntl.h>
+#include <unistd.h>
 
 #ifdef __linux__
 
 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.025628 seconds and 4 git commands to generate.