Namespace commands


Defines

#define CLONE_VM   0x00000100
#define CLONE_FS   0x00000200
#define CLONE_FILES   0x00000400
#define CLONE_SIGHAND   0x00000800
#define CLONE_PTRACE   0x00002000
#define CLONE_VFORK   0x00004000
#define CLONE_PARENT   0x00008000
#define CLONE_THREAD   0x00010000
#define CLONE_NEWNS   0x00020000
#define CLONE_SYSVSEM   0x00040000
#define CLONE_SETTLS   0x00080000
#define CLONE_PARENT_SETTID   0x00100000
#define CLONE_CHILD_CLEARTID   0x00200000
#define CLONE_DETACHED   0x00400000
#define CLONE_UNTRACED   0x00800000
#define CLONE_CHILD_SETTID   0x01000000
#define CLONE_STOPPED   0x02000000
#define CLONE_NEWUTS   0x04000000
#define CLONE_NEWIPC   0x08000000
#define CLONE_KTHREAD   0x10000000

Functions

int ns_clone (int flags, void *child_stack)
 Clone the current namespace (FS/IPC/UTS).
int ns_enter (xid_t xid, uint64_t mask)
 Enter namespace.
int ns_set (xid_t xid, uint64_t mask)
 Set namespace.


Define Documentation

#define CLONE_VM   0x00000100

Definition at line 617 of file vserver.h.

#define CLONE_FS   0x00000200

Definition at line 618 of file vserver.h.

#define CLONE_FILES   0x00000400

Definition at line 619 of file vserver.h.

#define CLONE_SIGHAND   0x00000800

Definition at line 620 of file vserver.h.

#define CLONE_PTRACE   0x00002000

Definition at line 621 of file vserver.h.

#define CLONE_VFORK   0x00004000

Definition at line 622 of file vserver.h.

#define CLONE_PARENT   0x00008000

Definition at line 623 of file vserver.h.

#define CLONE_THREAD   0x00010000

Definition at line 624 of file vserver.h.

#define CLONE_NEWNS   0x00020000

Definition at line 625 of file vserver.h.

Referenced by ns_clone().

#define CLONE_SYSVSEM   0x00040000

Definition at line 626 of file vserver.h.

#define CLONE_SETTLS   0x00080000

Definition at line 627 of file vserver.h.

#define CLONE_PARENT_SETTID   0x00100000

Definition at line 628 of file vserver.h.

#define CLONE_CHILD_CLEARTID   0x00200000

Definition at line 629 of file vserver.h.

#define CLONE_DETACHED   0x00400000

Definition at line 630 of file vserver.h.

#define CLONE_UNTRACED   0x00800000

Definition at line 631 of file vserver.h.

#define CLONE_CHILD_SETTID   0x01000000

Definition at line 632 of file vserver.h.

#define CLONE_STOPPED   0x02000000

Definition at line 633 of file vserver.h.

#define CLONE_NEWUTS   0x04000000

Definition at line 634 of file vserver.h.

Referenced by ns_clone().

#define CLONE_NEWIPC   0x08000000

Definition at line 635 of file vserver.h.

Referenced by ns_clone().

#define CLONE_KTHREAD   0x10000000

Definition at line 636 of file vserver.h.


Function Documentation

int ns_clone ( int  flags,
void *  child_stack 
)

Clone the current namespace (FS/IPC/UTS).

Parameters:
flags Clone flags
child_stack Child stack

Definition at line 25 of file namespace.c.

References clone(), CLONE_NEWIPC, CLONE_NEWNS, and CLONE_NEWUTS.

00026 {
00027         return clone(flags|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC, child_stack);
00028 }

int ns_enter ( xid_t  xid,
uint64_t  mask 
)

Enter namespace.

Parameters:
xid Context ID

Definition at line 30 of file namespace.c.

References vserver().

00031 {
00032         struct vcmd_space_mask kdata = { .mask = mask };
00033         return vserver(VCMD_enter_space, xid, &kdata);
00034 }

int ns_set ( xid_t  xid,
uint64_t  mask 
)

Set namespace.

Parameters:
xid Context ID

Definition at line 36 of file namespace.c.

References vserver().

00037 {
00038         struct vcmd_space_mask kdata = { .mask = mask };
00039         return vserver(VCMD_set_space, xid, &kdata);
00040 }


Generated on Wed Jun 20 19:50:09 2007 for libvserver by  doxygen 1.5.2