diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f5dceeb --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +/blib/ +/.build/ +_build/ +cover_db/ +inc/ +Build +!Build/ +Build.bat +.last_cover_stats +/Makefile +/Makefile.old +/MANIFEST.bak +/META.yml +/META.json +/MYMETA.* +nytprof.out +/pm_to_blib +*.o +*.bs +/_eumm/ +Sys-Linux-Namespace* +test* diff --git a/dist.ini b/dist.ini index d5149af..906514b 100644 --- a/dist.ini +++ b/dist.ini @@ -1,4 +1,4 @@ -name = Sys-Linux-Unshare +name = Sys-Linux-Namespace author = Ryan Voots license = Perl_5 copyright_holder = Ryan Voots diff --git a/lib/Sys/Linux/Namespace.pm b/lib/Sys/Linux/Namespace.pm index b879b0f..5f15062 100644 --- a/lib/Sys/Linux/Namespace.pm +++ b/lib/Sys/Linux/Namespace.pm @@ -1,4 +1,5 @@ package Sys::Linux::Namespace; +# ABSTRACT: Sets up linux kernel namespaces use strict; use warnings; diff --git a/lib/Sys/Linux/Unshare.pm b/lib/Sys/Linux/Unshare.pm index 86eebfa..d33869b 100644 --- a/lib/Sys/Linux/Unshare.pm +++ b/lib/Sys/Linux/Unshare.pm @@ -6,6 +6,10 @@ use Data::Dumper; require Exporter; our @ISA = qw/Exporter/; +require XSLoader; + +XSLoader::load(); + BEGIN { # Force reloading of all .ph files delete $INC{$_} for (grep {/\.ph$/} keys %INC); diff --git a/unshare.XS b/unshare.XS new file mode 100644 index 0000000..6f376fd --- /dev/null +++ b/unshare.XS @@ -0,0 +1,18 @@ +#define PERL_NO_GET_CONTEXT // we'll define thread context if necessary (faster) +#include "EXTERN.h" // globals/constant import locations +#include "perl.h" // Perl symbols, structures and constants definition +#include "XSUB.h" // xsubpp functions and macros +#include // rand() + +// additional c code goes here + +MODULE = Sys::Linux::Unshare PACKAGE = Sys::Linux::Unshare +PROTOTYPES: ENABLE + + # XS code goes here + + # XS comments begin with " #" to avoid them being interpreted as pre-processor + # directives + +unsigned int +rand()