]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/namespace.h
2 * lxc: linux Container library
4 * (C) Copyright IBM Corp. 2007, 2009
7 * Daniel Lezcano <daniel.lezcano at free.fr>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef __LXC_NAMESPACE_H
24 #define __LXC_NAMESPACE_H
26 #include <sys/syscall.h>
32 # define CLONE_FS 0x00000200
35 # define CLONE_NEWNS 0x00020000
37 #ifndef CLONE_NEWCGROUP
38 # define CLONE_NEWCGROUP 0x02000000
41 # define CLONE_NEWUTS 0x04000000
44 # define CLONE_NEWIPC 0x08000000
47 # define CLONE_NEWUSER 0x10000000
50 # define CLONE_NEWPID 0x20000000
53 # define CLONE_NEWNET 0x40000000
67 extern const struct ns_info
{
68 const char *proc_name
;
70 const char *flag_name
;
72 } ns_info
[LXC_NS_MAX
];
75 int __clone2(int (*__fn
) (void *__arg
), void *__child_stack_base
,
76 size_t __child_stack_size
, int __flags
, void *__arg
, ...);
78 int clone(int (*fn
)(void *), void *child_stack
,
79 int flags
, void *arg
, ...
80 /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
83 extern pid_t
lxc_clone(int (*fn
)(void *), void *arg
, int flags
);
85 extern int lxc_namespace_2_cloneflag(const char *namespace);
86 extern int lxc_namespace_2_ns_idx(const char *namespace);
87 extern int lxc_fill_namespace_flags(char *flaglist
, int *flags
);