]> git.proxmox.com Git - mirror_lxc.git/blame - src/lxc/namespace.h
Merge pull request #1756 from brauner/2017-08-10/further_lxc_2.1_preparations
[mirror_lxc.git] / src / lxc / namespace.h
CommitLineData
0ad19a3f 1/*
2 * lxc: linux Container library
3 *
5bb3ba8a 4 * (C) Copyright IBM Corp. 2007, 2009
0ad19a3f 5 *
6 * Authors:
9afe19d6 7 * Daniel Lezcano <daniel.lezcano at free.fr>
0ad19a3f 8 *
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.
13 *
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.
18 *
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
250b1eec 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0ad19a3f 22 */
f1a4a029
ÇO
23#ifndef __LXC_NAMESPACE_H
24#define __LXC_NAMESPACE_H
0ad19a3f 25
8173e600 26#include <sys/syscall.h>
5bb3ba8a
DL
27#include <sched.h>
28
1f1665e6
SG
29#include "config.h"
30
0ad19a3f 31#ifndef CLONE_FS
32# define CLONE_FS 0x00000200
33#endif
34#ifndef CLONE_NEWNS
35# define CLONE_NEWNS 0x00020000
36#endif
12983ba4
SH
37#ifndef CLONE_NEWCGROUP
38# define CLONE_NEWCGROUP 0x02000000
39#endif
0ad19a3f 40#ifndef CLONE_NEWUTS
41# define CLONE_NEWUTS 0x04000000
42#endif
43#ifndef CLONE_NEWIPC
44# define CLONE_NEWIPC 0x08000000
45#endif
46#ifndef CLONE_NEWUSER
47# define CLONE_NEWUSER 0x10000000
48#endif
49#ifndef CLONE_NEWPID
50# define CLONE_NEWPID 0x20000000
51#endif
52#ifndef CLONE_NEWNET
53# define CLONE_NEWNET 0x40000000
54#endif
675693a5 55
9662e444 56enum {
29ed9c13 57 LXC_NS_USER,
9662e444
CB
58 LXC_NS_MNT,
59 LXC_NS_PID,
60 LXC_NS_UTS,
61 LXC_NS_IPC,
9662e444
CB
62 LXC_NS_NET,
63 LXC_NS_CGROUP,
64 LXC_NS_MAX
65};
66
67extern const struct ns_info {
68 const char *proc_name;
69 int clone_flag;
70 const char *flag_name;
71} ns_info[LXC_NS_MAX];
72
675693a5
DS
73#if defined(__ia64__)
74int __clone2(int (*__fn) (void *__arg), void *__child_stack_base,
75 size_t __child_stack_size, int __flags, void *__arg, ...);
1f1665e6 76#else
fbef4590
SH
77int clone(int (*fn)(void *), void *child_stack,
78 int flags, void *arg, ...
79 /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
1f1665e6 80#endif
fbef4590 81
5bb3ba8a
DL
82extern pid_t lxc_clone(int (*fn)(void *), void *arg, int flags);
83
39a5d5fe
CS
84extern int lxc_namespace_2_cloneflag(char *namespace);
85extern int lxc_fill_namespace_flags(char *flaglist, int *flags);
86
0ad19a3f 87#endif