• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * linuxioctl.h
3  *
4  * Wrapper for Linux ioctl definitions, including workarounds
5  */
6 
7 #ifndef LIBINSTALLER_LINUXIOCTL_H
8 #define LIBINSTALLER_LINUXIOCTL_H
9 
10 #include <sys/ioctl.h>
11 
12 #ifdef __linux__
13 
14 #define statfs _kernel_statfs	/* HACK to deal with broken 2.4 distros */
15 
16 #include <linux/fd.h>		/* Floppy geometry */
17 #include <linux/hdreg.h>	/* Hard disk geometry */
18 
19 #include <linux/fs.h>		/* FIGETBSZ, FIBMAP, FS_IOC_* */
20 
21 #undef SECTOR_SIZE		/* Defined in msdos_fs.h for no good reason */
22 #undef SECTOR_BITS
23 
24 #ifndef FS_IOC_GETFLAGS
25 /* Old kernel headers, these were once ext2-specific... */
26 # include <linux/ext2_fs.h>	/* EXT2_IOC_* */
27 
28 # define FS_IOC_GETFLAGS EXT2_IOC_GETFLAGS
29 # define FS_IOC_SETFLAGS EXT2_IOC_SETFLAGS
30 
31 # define FS_IMMUTABLE_FL EXT2_IMMUTABLE_FL
32 
33 #else
34 
35 # include <ext2fs/ext2_fs.h>
36 
37 #endif
38 
39 #ifndef FAT_IOCTL_GET_ATTRIBUTES
40 # define FAT_IOCTL_GET_ATTRIBUTES	_IOR('r', 0x10, __u32)
41 #endif
42 #ifndef FAT_IOCTL_SET_ATTRIBUTES
43 # define FAT_IOCTL_SET_ATTRIBUTES	_IOW('r', 0x11, __u32)
44 #endif
45 
46 #include <linux/fiemap.h>	/* FIEMAP definitions */
47 
48 #ifndef FS_IOC_FIEMAP
49 # define FS_IOC_FIEMAP		_IOWR('f', 11, struct fiemap)
50 #endif
51 
52 #undef statfs
53 
54 #ifndef  BLKGETSIZE64
55 /* This takes a u64, but the size field says size_t.  Someone screwed big. */
56 # define BLKGETSIZE64 _IOR(0x12,114,size_t)
57 #endif
58 
59 #include <linux/loop.h>
60 
61 #endif /* __linux__ */
62 
63 #endif /* LIBINSTALLER_LINUXIOCTL_H */
64