From b9849fdffd787ec3a8eff50ffe9430769fc6e88d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 13 Sep 2001 13:44:41 +0000 Subject: add partition adding on the fly trick --- perl-install/c/stuff.xs.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 563c97013..9ca44ff11 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -29,6 +29,7 @@ print ' #include #include #include +#include #include #include @@ -157,6 +158,23 @@ setMouseLive(display, type, emulate3buttons) print ' +int +add_partition(hd, start_sector, size_sector, part_number) + int hd + unsigned long start_sector + unsigned long size_sector + int part_number + CODE: + { + long long start = start_sector * 512; + long long size = size_sector * 512; + struct blkpg_partition p = { start, size, part_number, "", "" }; + struct blkpg_ioctl_arg s = { BLKPG_ADD_PARTITION, 0, sizeof(struct blkpg_partition), (void *) &p }; + RETVAL = ioctl(hd, BLKPG, &s) == 0; + } + OUTPUT: + RETVAL + int is_secure_file(filename) char * filename -- cgit v1.2.1