1 /* very primitive wrapper around the `delete partition' ioctl */
6 #ifdef HAVE_LINUX_COMPILER_H
7 #include <linux/compiler.h>
9 #include <linux/blkpg.h>
12 main(int argc, char **argv){
14 struct blkpg_ioctl_arg a;
15 struct blkpg_partition p;
19 "usage: %s diskdevice partitionnr\n",
23 if ((fd = open(argv[1], O_RDONLY)) < 0) {
27 p.pno = atoi(argv[2]);
32 a.op = BLKPG_DEL_PARTITION;
34 a.datalen = sizeof(p);
37 if (ioctl(fd, BLKPG, &a) == -1) {