3
#include <sys/disklabel.h>
9
int blk_getimagesize(int fd, uint64_t *size)
15
rc = ioctl(fd, DIOCGDINFO, &dl);
17
DPRINTF("ERR: DIOCGDINFO failed, couldn't stat image");
21
*size = dl.d_secsize * dl.d_secpercyl;
26
int blk_getsectorsize(int fd, uint64_t *sector_size)
31
*sector_size = DEV_BSIZE;
32
rc = ioctl(fd, DIOCGDINFO, &dl);
34
DPRINTF("ERR: DIOCGDINFO failed, couldn't stat image");
35
return 0; /* fallback to DEV_BSIZE */
38
*sector_size = dl.d_secsize;