GDB (xrefs)
linux-namespaces.h
Go to the documentation of this file.
1 /* Linux namespaces(7) support.
2 
3  Copyright (C) 2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef LINUX_NAMESPACES_H
21 #define LINUX_NAMESPACES_H
22 
23 /* Set to nonzero to enable debugging of Linux namespaces code. */
24 
25 extern int debug_linux_namespaces;
26 
27 /* Enumeration of Linux namespace types. */
28 
30  {
31  /* IPC namespace: System V IPC, POSIX message queues. */
33 
34  /* Mount namespace: mount points. */
36 
37  /* Network namespace: network devices, stacks, ports, etc. */
39 
40  /* PID namespace: process IDs. */
42 
43  /* User namespace: user and group IDs. */
45 
46  /* UTS namespace: hostname and NIS domain name. */
48 
49  /* Number of Linux namespaces. */
51  };
52 
53 /* Return nonzero if process PID has the same TYPE namespace as the
54  calling process, or if the kernel does not support TYPE namespaces
55  (in which case there is only one TYPE namespace). Return zero if
56  the kernel supports TYPE namespaces and the two processes have
57  different TYPE namespaces. */
58 
59 extern int linux_ns_same (pid_t pid, enum linux_ns_type type);
60 
61 /* Like gdb_open_cloexec, but in the mount namespace of process
62  PID. */
63 
64 extern int linux_mntns_open_cloexec (pid_t pid, const char *filename,
65  int flags, mode_t mode);
66 
67 /* Like unlink(2), but in the mount namespace of process PID. */
68 
69 extern int linux_mntns_unlink (pid_t pid, const char *filename);
70 
71 /* Like readlink(2), but in the mount namespace of process PID. */
72 
73 extern ssize_t linux_mntns_readlink (pid_t pid, const char *filename,
74  char *buf, size_t bufsiz);
75 
76 #endif /* LINUX_NAMESPACES_H */
int linux_mntns_open_cloexec(pid_t pid, const char *filename, int flags, mode_t mode)
linux_ns_type
int linux_ns_same(pid_t pid, enum linux_ns_type type)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
Definition: gnu-nat.c:1885
ssize_t linux_mntns_readlink(pid_t pid, const char *filename, char *buf, size_t bufsiz)
int debug_linux_namespaces
Definition: gdbtypes.h:749
int linux_mntns_unlink(pid_t pid, const char *filename)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
Definition: gnu-nat.c:1818