old linux

This commit is contained in:
rsc 2004-05-15 23:16:38 +00:00
parent 7f596de86a
commit 76e6aca867

View file

@ -53,8 +53,10 @@ disksize(int fd, int dev)
long l; long l;
struct hd_geometry geo; struct hd_geometry geo;
#ifdef BLKGETSIZE64
if(ioctl(fd, BLKGETSIZE64, &u64) >= 0) if(ioctl(fd, BLKGETSIZE64, &u64) >= 0)
return u64; return u64;
#endif
if(ioctl(fd, BLKGETSIZE, &l) >= 0) if(ioctl(fd, BLKGETSIZE, &l) >= 0)
return l*512; return l*512;
if(ioctl(fd, HDIO_GETGEO, &geo) >= 0) if(ioctl(fd, HDIO_GETGEO, &geo) >= 0)