guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/10: build: syscalls: Add setns syscall wrapper.


From: David Thompson
Subject: 02/10: build: syscalls: Add setns syscall wrapper.
Date: Mon, 22 Jun 2015 01:06:29 +0000

davexunit pushed a commit to branch wip-container
in repository guix.

commit 381faf67009e46eaf32802d08f0d94e5f225f1c9
Author: David Thompson <address@hidden>
Date:   Mon Jun 8 08:43:05 2015 -0400

    build: syscalls: Add setns syscall wrapper.
    
    * guix/build/syscalls.scm (setns): New procedure.
---
 guix/build/syscalls.scm |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 3346358..90975e3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -45,6 +45,7 @@
             CLONE_NEWPID
             CLONE_NEWNET
             clone
+            setns
 
             IFF_UP
             IFF_BROADCAST
@@ -279,6 +280,15 @@ Unlike the fork system call, clone accepts FLAGS that 
specify which resources
 are shared between the parent and child processes."
       (proc syscall-id flags %null-pointer))))
 
+(define setns
+  (let* ((ptr  (dynamic-func "setns" (dynamic-link)))
+         (proc (pointer->procedure int ptr (list int int))))
+    (lambda (fdes nstype)
+      "Reassociate the current process with the namespace specified by FDES.
+NSTYPE specifies which type of namespace the current process may be
+reassociated with, or 0 if there is no such limitation."
+      (proc fdes nstype))))
+
 
 ;;;
 ;;; Packed structures.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]