2006-12-06 17:25:39 -06:00
|
|
|
/* common stuff for fdisk, cfdisk, sfdisk */
|
|
|
|
|
2006-12-06 17:25:43 -06:00
|
|
|
/* including <linux/fs.h> fails */
|
2006-12-06 17:26:18 -06:00
|
|
|
#include <sys/types.h>
|
2006-12-06 17:25:43 -06:00
|
|
|
#include <sys/ioctl.h>
|
2006-12-06 17:26:12 -06:00
|
|
|
#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 */
|
2006-12-06 17:26:16 -06:00
|
|
|
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* size in bytes */
|
2006-12-06 17:25:43 -06:00
|
|
|
|
2006-12-06 17:25:56 -06:00
|
|
|
/* 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 */
|
|
|
|
|
|
|
|
|
2006-12-06 17:25:39 -06:00
|
|
|
struct systypes {
|
|
|
|
unsigned char type;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct systypes i386_sys_types[];
|
2006-12-06 17:25:41 -06:00
|
|
|
|
2006-12-06 17:25:43 -06:00
|
|
|
extern char *partname(char *dev, int pno, int lth);
|
2006-12-06 17:26:18 -06:00
|
|
|
|
|
|
|
int disksize(int fd, unsigned long long *sectors);
|