From: Wolfgang Bumiller Date: Thu, 17 Sep 2015 10:50:03 +0000 (+0200) Subject: Tools: add unshare system call X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=952fd95e842ab2ed81a783c43f2015872b5b7149 Tools: add unshare system call Including the important CLONE_* constants. --- diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 26f0080..1a342ee 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -63,6 +63,13 @@ our $IPV6RE = "(?:" . "(?:(?:(?:(?:$IPV6H16:){0,5}$IPV6H16)?::" . ")$IPV6H16)|" . "(?:(?:(?:(?:$IPV6H16:){0,6}$IPV6H16)?::" . ")))"; +use constant (CLONE_NEWNS => 0x00020000, + CLONE_NEWUTS => 0x04000000, + CLONE_NEWIPC => 0x08000000, + CLONE_NEWUSER => 0x10000000, + CLONE_NEWPID => 0x20000000, + CLONE_NEWNET => 0x40000000); + sub run_with_timeout { my ($timeout, $code, @param) = @_; @@ -1153,4 +1160,9 @@ sub parse_host_and_port { return; # nothing } +sub unshare { + my ($flags) = @_; + syscall 272, $flags; +} + 1;