7 func (n *Namespace) Syscall() int {
8 return namespaceInfo[n.Type]
11 var namespaceInfo = map[NamespaceType]int{
12 NEWNET: syscall.CLONE_NEWNET,
13 NEWNS: syscall.CLONE_NEWNS,
14 NEWUSER: syscall.CLONE_NEWUSER,
15 NEWIPC: syscall.CLONE_NEWIPC,
16 NEWUTS: syscall.CLONE_NEWUTS,
17 NEWPID: syscall.CLONE_NEWPID,
20 // CloneFlags parses the container's Namespaces options to set the correct
21 // flags on clone, unshare. This function returns flags only for new namespaces.
22 func (n *Namespaces) CloneFlags() uintptr {
24 for _, v := range *n {
28 flag |= namespaceInfo[v.Type]