-#serial 110 -*- autoconf -*-
+#serial 111 -*- autoconf -*-
dnl Misc type-related macros for coreutils.
AC_CHECK_HEADERS_ONCE([
hurd.h
linux/falloc.h
+ linux/fs.h
paths.h
priv.h
stropts.h
# include <linux/falloc.h>
#endif
+#ifdef HAVE_LINUX_FS_H
+# include <linux/fs.h>
+#endif
+
+#if !defined FICLONE && defined __linux__
+# define FICLONE _IOW (0x94, 9, int)
+#endif
+
#ifndef HAVE_FCHOWN
# define HAVE_FCHOWN false
# define fchown(fd, uid, gid) (-1)
static inline int
clone_file (int dest_fd, int src_fd)
{
-#ifdef __linux__
-# undef BTRFS_IOCTL_MAGIC
-# define BTRFS_IOCTL_MAGIC 0x94
-# undef BTRFS_IOC_CLONE
-# define BTRFS_IOC_CLONE _IOW (BTRFS_IOCTL_MAGIC, 9, int)
- return ioctl (dest_fd, BTRFS_IOC_CLONE, src_fd);
+#ifdef FICLONE
+ return ioctl (dest_fd, FICLONE, src_fd);
#else
(void) dest_fd;
(void) src_fd;