3 * Based on sizeup() in mkfs.c.
8 #include <machine/partition.h>
9 #include <minix/partition.h>
10 #include <sys/ioc_disk.h>
20 unsigned long sizeup(char *);
22 int main(int argc
, char *argv
[])
25 fprintf(stderr
, "Usage: %s <device>\n", argv
[0]);
29 printf("%lu\n", sizeup(argv
[1]));
34 unsigned long sizeup(char *device
)
37 struct part_geom entry
;
40 if ((fd
= open(device
, O_RDONLY
)) == -1) {
41 perror("sizeup open");
44 if (ioctl(fd
, DIOCGETP
, &entry
) == -1) {
45 perror("sizeup ioctl");