diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-09 15:23:56 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-09 15:23:56 +0000 |
commit | 975c4c27c0245389fedb1669bab816502f1c36f3 (patch) | |
tree | da1eb9b0c736869fcc57bef4b7df4381ff064885 /perl-install/c | |
parent | 29dbc8c49c643d5d18f64907ca9d5104ad9cf08e (diff) | |
download | drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.gz drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.bz2 drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.xz drakx-975c4c27c0245389fedb1669bab816502f1c36f3.zip |
no_comment
Diffstat (limited to 'perl-install/c')
-rw-r--r-- | perl-install/c/stuff.xs.pm | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 5aaef8605..bc405af1d 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -19,6 +19,7 @@ print ' #include <linux/hdreg.h> #include <linux/vt.h> #include <linux/cdrom.h> +#include <linux/loop.h> #include <net/if.h> #include <net/route.h> @@ -242,6 +243,32 @@ kernel_version() RETVAL +int +set_loop(dev_fd, file) + int dev_fd + char *file + CODE: + RETVAL = 0; +{ + struct loop_info loopinfo; + int file_fd = open(file, O_RDWR); + + if (file_fd < 0) return; + + memset(&loopinfo, 0, sizeof (loopinfo)); + strncpy(loopinfo.lo_name, file, LO_NAME_SIZE); + loopinfo.lo_name[LO_NAME_SIZE - 1] = 0; + + if (ioctl(dev_fd, LOOP_SET_FD, file_fd) < 0) return; + if (ioctl(dev_fd, LOOP_SET_STATUS, &loopinfo) < 0) { + ioctl(dev_fd, LOOP_CLR_FD, 0); + return; + } + close(file_fd); + RETVAL = 1; +} + OUTPUT: + RETVAL '; $ENV{C_RPM} and print ' @@ -747,7 +774,7 @@ headerGetEntry_filenames(h) @macros = ( [ qw(int S_IFCHR S_IFBLK KDSKBENT KT_SPEC NR_KEYS MAX_NR_KEYMAPS BLKRRPART TIOCSCTTY - HDIO_GETGEO BLKGETSIZE + HDIO_GETGEO BLKGETSIZE LOOP_GET_STATUS MS_MGC_VAL MS_RDONLY O_NONBLOCK SECTORSIZE WNOHANG VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT ) ], |