Signed-off-by: Dan Mick <dan.mick@inktank.com>
#define CEPH_SYNC_FILESYSTEM_H
#include <unistd.h>
+#include <syscall.h>
#ifndef __CYGWIN__
# ifndef DARWIN
return 0;
#endif
+#ifdef SYS_syncfs
+ if (syscall(SYS_syncfs, fd) == 0)
+ return 0;
+#endif
+
#ifdef BTRFS_IOC_SYNC
if (::ioctl(fd, BTRFS_IOC_SYNC) == 0)
return 0;
#if defined(__linux__)
#include <linux/fs.h>
+#include <syscall.h>
#endif
#include <iostream>
} else {
dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl;
}
+#else
+#ifdef SYS_syncfs
+ if (syscall(SYS_syncfs, fd) == 0) {
+ dout(0) << "mount syscall(SYS_syncfs, fd) fully supported" << dendl;
+ have_syncfs = true;
+ } else {
+ dout(0) << "mount syscall(SYS_syncfs, fd) supported by libc BUT NOT the kernel" << dendl;
+ }
#else
dout(0) << "mount syncfs(2) syscall not support by glibc" << dendl;
+#endif
#endif
if (!have_syncfs) {
if (btrfs) {