--- Linux-Clone/Clone.pm 2011/11/28 05:43:03 1.1 +++ Linux-Clone/Clone.pm 2016/08/24 03:34:24 1.2 @@ -8,7 +8,7 @@ =head1 DESCRIPTION -This module exposes the linux clone(2) and unshare(2) syscalls to +This module exposes the linux clone(2), unshare(2) and related syscalls to Perl. =over 4 @@ -26,9 +26,12 @@ Linux::Clone::THREAD (in unshare, implies VM, SIGHAND) Linux::Clone::SIGHAND Linux::Clone::SYSVSEM + Linux::Clone::NEWUSER (in unshare, implies CLONE_THREAD) + Linux::Clone::NEWPID Linux::Clone::NEWUTS Linux::Clone::NEWIPC Linux::Clone::NEWNET + Linux::Clone::NEWCGROUP Example: unshare the network namespace and prove that by calling ifconfig, showing only an unconfigured lo interface. @@ -124,8 +127,6 @@ Linux::Clone::CHILD_CLEARTID (not yet implemented) Linux::Clone::DETACHED Linux::Clone::UNTRACED - Linux::Clone::NEWUSER - Linux::Clone::NEWPID Linux::Clone::IO Note that for practical reasons you basically must not use @@ -139,6 +140,15 @@ my $pid = Linux::Clone::clone sub { warn "in child"; 77 }, 0, POSIX::SIGCHLD; +=item Linux::Clone::setns $fh_or_fd[, $nstype] + +Calls setns(2) on the file descriptor (or file handle) C<$fh_or_fd>. If +C<$nstype> is missing, then C<0> is used. + +At the time of this writing, C<$nstype> can be C<0>, C, +C, C, C, +C, C or C. + =back =cut @@ -148,7 +158,7 @@ # use common::sense; BEGIN { - our $VERSION = '0.01'; + our $VERSION = '1.0'; require XSLoader; XSLoader::load (__PACKAGE__, $VERSION);