#ifndef BLOCKDATA_H #define BLOCKDATA_H #include #include #include #include #include #include //#include //#include //#include #ifndef BLKROSET #define BLKGETSIZE _IO(0x12,96) #define BLKBSZGET _IOR(0x12,112,size_t) #define BLKGETSIZE64 _IOR(0x12,114,size_t) #endif /* otherwise from */ #ifndef HDIO_GETGEO #define HDIO_GETGEO 0x0301 struct hd_geometry { unsigned char heads; unsigned char sectors; unsigned short cylinders; /* truncated */ unsigned long start; }; #endif struct partition_detection_anchor { off_t offset; const char * anchor; }; //static int getsize(int fd, long long *sectors); int getsize(int fd, long long *sectors); //int getsize(int fd, long long *sectors); int get_device_data(char *device, int *blocksize, int *startsector); int seek_and_compare(int fd, struct partition_detection_anchor anch); char * detect_partition_type(char * dev); #endif