summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-13 13:44:41 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-13 13:44:41 +0000
commitb9849fdffd787ec3a8eff50ffe9430769fc6e88d (patch)
tree6f242de26956818e7cb835d022591c53b73d71a6 /perl-install/c/stuff.xs.pm
parent8a33f256e6081ad807a6f14b6d96543e8af705d2 (diff)
downloaddrakx-b9849fdffd787ec3a8eff50ffe9430769fc6e88d.tar
drakx-b9849fdffd787ec3a8eff50ffe9430769fc6e88d.tar.gz
drakx-b9849fdffd787ec3a8eff50ffe9430769fc6e88d.tar.bz2
drakx-b9849fdffd787ec3a8eff50ffe9430769fc6e88d.tar.xz
drakx-b9849fdffd787ec3a8eff50ffe9430769fc6e88d.zip
add partition adding on the fly trick
Diffstat (limited to 'perl-install/c/stuff.xs.pm')
-rw-r--r--perl-install/c/stuff.xs.pm18
1 files changed, 18 insertions, 0 deletions
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 <linux/fd.h>
#include <linux/cdrom.h>
#include <linux/loop.h>
+#include <linux/blkpg.h>
#include <net/if.h>
#include <net/route.h>
@@ -158,6 +159,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
CODE: