summaryrefslogtreecommitdiff
path: root/libinstaller/linuxioctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'libinstaller/linuxioctl.h')
-rw-r--r--libinstaller/linuxioctl.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/libinstaller/linuxioctl.h b/libinstaller/linuxioctl.h
new file mode 100644
index 00000000..e4284df7
--- /dev/null
+++ b/libinstaller/linuxioctl.h
@@ -0,0 +1,40 @@
+/*
+ * linuxioctl.h
+ *
+ * Wrapper for Linux ioctl definitions, including workarounds
+ */
+
+#ifndef LIBINSTALLER_LINUXIOCTL_H
+#define LIBINSTALLER_LINUXIOCTL_H
+
+#include <sys/ioctl.h>
+
+#define statfs _kernel_statfs /* HACK to deal with broken 2.4 distros */
+
+#include <linux/fd.h> /* Floppy geometry */
+#include <linux/hdreg.h> /* Hard disk geometry */
+
+#include <linux/fs.h> /* FIGETBSZ, FIBMAP, FS_IOC_FIEMAP */
+#include <linux/msdos_fs.h> /* FAT_IOCTL_SET_ATTRIBUTES */
+
+#undef SECTOR_SIZE /* Defined in msdos_fs.h for no good reason */
+#undef SECTOR_BITS
+#include <linux/ext2_fs.h> /* EXT2_IOC_* */
+
+#ifndef FAT_IOCTL_GET_ATTRIBUTES
+# define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
+#endif
+
+#ifndef FAT_IOCTL_SET_ATTRIBUTES
+# define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
+#endif
+
+#include <linux/fiemap.h> /* FIEMAP definitions */
+
+#ifndef FS_IOC_FIEMAP
+# define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
+#endif
+
+#undef statfs
+
+#endif /* LIBINSTALLER_LINUXIOCTL_H */