| 1 | #define PERL_NO_GET_CONTEXT // we'll define thread context if necessary (faster) | ||
| 2 | #include "EXTERN.h" // globals/constant import locations | ||
| 3 | #include "perl.h" // Perl symbols, structures and constants definition | ||
| 4 | #include "XSUB.h" // xsubpp functions and macros | ||
| 5 | #include <sys/mount.h> | ||
| 6 | |||
| 7 | MODULE = Sys::Linux::Mount PACKAGE = Sys::Linux::Mount | ||
| 8 | PROTOTYPES: ENABLE | ||
| 9 | |||
| 10 | # XS code goes here | ||
| 11 | |||
| 12 | # XS comments begin with " #" to avoid them being interpreted as pre-processor | ||
| 13 | # directives | ||
| 14 | |||
| 15 | SV *_mount_sys(const char *source, const char *target, const char *filesystem, unsigned long mountflags, const char *data) | ||
| 16 | CODE: | ||
| 17 | 0 | ST(0) = sv_newmortal(); | |
| 18 | 0 | sv_setiv(ST(0), mount(source, target, filesystem, mountflags, (void *) data)); | |
| 19 | |||
| 20 | SV *_umount_sys(const char *target) | ||
| 21 | CODE: | ||
| 22 | 0 | ST(0) = sv_newmortal(); | |
| 23 | 0 | sv_setiv(ST(0), umount(target)); | |
| 24 | |||
| 25 | SV *_umount2_sys(const char *target, int umountflags) | ||
| 26 | CODE: | ||
| 27 | 0 | ST(0) = sv_newmortal(); | |
| 28 | 0 | sv_setiv(ST(0), umount2(target, umountflags)); |