2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 /* This routine differs in different UNIX variants (using different IOCTLs) */
8 #include <aros/debug.h>
9 #include <devices/trackdisk.h>
10 #include <exec/memory.h>
11 #include <proto/hostlib.h>
15 #include "hostdisk_host.h"
16 #include "hostdisk_device.h"
18 ULONG
Host_DeviceGeometry(int file
, struct DriveGeometry
*dg
, struct HostDiskBase
*hdskBase
)
24 ret
= hdskBase
->iface
->ioctl(file
, DKIOCGETBLOCKSIZE
, &dg
->dg_SectorSize
);
27 ret
= hdskBase
->iface
->ioctl(file
, DKIOCGETBLOCKCOUNT
, &dg
->dg_TotalSectors
);
29 err
= *hdskBase
->errnoPtr
;
35 D(bug("hostdisk: Error %d\n", err
));
40 D(bug("hostdisk: %u sectors per %u bytes\n", dg
->dg_TotalSectors
, dg
->dg_SectorSize
));
43 * This is all we can do on Darwin. They dropped CHS completely,
44 * so we stay with LBA (CylSectors == 1)
46 dg
->dg_Cylinders
= dg
->dg_TotalSectors
;