File: common.h

package info (click to toggle)
util-linux 2.12r-19etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 8,932 kB
  • ctags: 5,101
  • sloc: ansic: 46,134; sh: 8,074; makefile: 1,111; perl: 86; csh: 62; sed: 55
file content (32 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* common stuff for fdisk, cfdisk, sfdisk */

/* including <linux/fs.h> fails */
#include <sys/types.h>
#include <sys/ioctl.h>
#define BLKRRPART    _IO(0x12,95)    /* re-read partition table */
#define BLKGETSIZE   _IO(0x12,96)    /* return device size */
#define BLKFLSBUF    _IO(0x12,97)    /* flush buffer cache */
#define BLKSSZGET    _IO(0x12,104)   /* get block device sector size */
#define BLKGETSIZE64 _IOR(0x12,114,size_t)	/* size in bytes */

/* including <linux/hdreg.h> also fails */
struct hd_geometry {
      unsigned char heads;
      unsigned char sectors;
      unsigned short cylinders;
      unsigned long start;
};

#define HDIO_GETGEO		0x0301	/* get device geometry */


struct systypes {
	unsigned char type;
	char *name;
};

extern struct systypes i386_sys_types[];

extern char *partname(char *dev, int pno, int lth);

int disksize(int fd, unsigned long long *sectors);