---
configure.ac | 3 +-
include/ntfs-3g/ioctl.h | 30
include/ntfs-3g/volume.h | 3 -
libntfs-3g/Makefile.am | 1 +
libntfs-3g/ioctl.c | 382 +++
src/ntfs-3g.c| 31 +++-
6 files changed, 440 insertions(+), 10 deletions(-)
create mode 100644 include/ntfs-3g/ioctl.h
create mode 100644 libntfs-3g/ioctl.c
diff --git a/configure.ac b/configure.ac
index d1f7e10..0da527f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -471,7 +471,8 @@ AC_CHECK_HEADERS([ctype.h fcntl.h libgen.h libintl.h
limits.h locale.h \
regex.h endian.h byteswap.h sys/byteorder.h sys/disk.h sys/endian.h \
sys/param.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/stat.h sys/types.h \
sys/vfs.h sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h \
- linux/hdreg.h machine/endian.h windows.h syslog.h pwd.h malloc.h])
+ linux/fs.h inttypes.h linux/hdreg.h \
+ machine/endian.h windows.h syslog.h pwd.h malloc.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
diff --git a/include/ntfs-3g/ioctl.h b/include/ntfs-3g/ioctl.h
new file mode 100644
index 000..4ed6c01
--- /dev/null
+++ b/include/ntfs-3g/ioctl.h
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (c) 2014 Jean-Pierre Andre
+ *
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (in the main directory of the NTFS-3G
+ * distribution in the file COPYING); if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef IOCTL_H
+#define IOCTL_H
+
+int ntfs_ioctl(ntfs_inode *ni, int cmd, void *arg,
+unsigned int flags, void *data);
+
+#endif /* IOCTL_H */
diff --git a/include/ntfs-3g/volume.h b/include/ntfs-3g/volume.h
index a181ccc..aeb779a 100644
--- a/include/ntfs-3g/volume.h
+++ b/include/ntfs-3g/volume.h
@@ -36,9 +36,6 @@
#ifdef HAVE_SYS_PARAM_H
#include sys/param.h
#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include sys/mount.h
-#endif
#ifdef HAVE_MNTENT_H
#include mntent.h
#endif
diff --git a/libntfs-3g/Makefile.am b/libntfs-3g/Makefile.am
index 47337b2..d6b150e 100644
--- a/libntfs-3g/Makefile.am
+++ b/libntfs-3g/Makefile.am
@@ -31,6 +31,7 @@ libntfs_3g_la_SOURCES = \
efs.c \
index.c \
inode.c \
+ ioctl.c \
lcnalloc.c \
logfile.c \
logging.c \
diff --git a/libntfs-3g/ioctl.c b/libntfs-3g/ioctl.c
new file mode 100644
index 000..bbbceb9
--- /dev/null
+++ b/libntfs-3g/ioctl.c
@@ -0,0 +1,382 @@
+/**
+ * ioctl.c - Processing of ioctls
+ *
+ * This module is part of ntfs-3g library
+ *
+ * Copyright (c) 2014 Jean-Pierre Andre
+ * Copyright (c) 2014 Red Hat, Inc.
+ *
+ * This program/include file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (in the main directory of the NTFS-3G
+ * distribution in the file COPYING); if not, write to the Free Software
+ * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include config.h
+
+#ifdef HAVE_STDIO_H
+#include stdio.h
+#endif
+#ifdef HAVE_INTTYPES_H
+#include inttypes.h
+#endif
+#ifdef HAVE_STRING_H
+#include string.h
+#endif
+#ifdef HAVE_ERRNO_H
+#include errno.h
+#endif
+#ifdef HAVE_FCNTL_H
+#include fcntl.h
+#endif
+#ifdef HAVE_UNISTD_H
+#include unistd.h
+#endif
+#ifdef HAVE_STDLIB_H
+#include stdlib.h
+#endif
+#ifdef HAVE_LIMITS_H
+#include limits.h
+#endif
+#include syslog.h
+
+#ifdef HAVE_SETXATTR
+#include sys/xattr.h
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include sys/types.h
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include sys/stat.h
+#endif
+
+#ifdef HAVE_LINUX_FS_H
+#include linux/fs.h
+#endif
+
+#include dirent.h
+
+#include compat.h
+#include debug.h
+#include bitmap.h
+#include attrib.h
+#include inode.h
+#include layout.h
+#include