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(device
)
38 struct partition entry
;
41 if ((fd
= open(device
, O_RDONLY
)) == -1) {
42 perror("sizeup open");
45 if (ioctl(fd
, DIOCGETP
, &entry
) == -1) {
46 perror("sizeup ioctl");