1 /* This routine differs in different UNIX variants (using different IOCTLs) */
3 #include <aros/debug.h>
4 #include <devices/trackdisk.h>
5 #include <exec/memory.h>
6 #include <proto/hostlib.h>
10 #include "hostdisk_host.h"
11 #include "hostdisk_device.h"
13 ULONG
Host_DeviceGeometry(int file
, struct DriveGeometry
*dg
, struct HostDiskBase
*hdskBase
)
19 ret
= hdskBase
->iface
->ioctl(file
, DKIOCGETBLOCKSIZE
, &dg
->dg_SectorSize
);
22 ret
= hdskBase
->iface
->ioctl(file
, DKIOCGETBLOCKCOUNT
, &dg
->dg_TotalSectors
);
24 err
= *hdskBase
->errnoPtr
;
30 D(bug("hostdisk: Error %d\n", err
));
35 D(bug("hostdisk: %u sectors per %u bytes\n", dg
->dg_TotalSectors
, dg
->dg_SectorSize
));
38 * This is all we can do on Darwin. They dropped CHS completely,
39 * so we stay with LBA (CylSectors == 1)
41 dg
->dg_Cylinders
= dg
->dg_TotalSectors
;