AC_CHECK_HEADERS(termios.h)
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(linux/fs.h)
+AC_CHECK_HEADERS(sys/clonefile.h)
AC_CHECK_FUNCS(gethostname)
AC_CHECK_FUNCS(getopt_long)
# endif
#endif
+#ifdef __APPLE__
+# ifdef HAVE_SYS_CLONEFILE_H
+# include <sys/clonefile.h>
+# define FILE_CLONING_SUPPORTED 1
+# endif
+#endif
+
#ifdef _WIN32
#include <windows.h>
#include <sys/locking.h>
}
errno = saved_errno;
+#elif defined(__APPLE__)
+ (void)via_tmp_file;
+ result = clonefile(src, dest, CLONE_NOOWNERCOPY) == 0;
#endif
#else // FILE_CLONING_SUPPORTED