Introduce nat/linux-namespaces.[ch]
This commit introduces new shared files nat/linux-namespaces.[ch] containing code to support Linux namespaces that will be used by both GDB and gdbserver. gdb/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * nat/linux-namespaces.h: New file. * nat/linux-namespaces.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-namespaces.h. (linux-namespaces.o): New rule. * config/aarch64/linux.mh (NATDEPFILES): Add linux-namespaces.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. gdb/gdbserver/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * Makefile.in (SFILES): Add nat/linux-namespaces.c. (linux-namespaces.o): New rule. * configure.srv (srv_linux_obj): Add linux-namespaces.o.
This commit is contained in:
parent
ca09583623
commit
4b8b5e7245
@ -1,3 +1,31 @@
|
||||
2015-06-10 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* configure.ac (AC_CHECK_FUNCS): Add setns.
|
||||
* config.in: Regenerate.
|
||||
* configure: Likewise.
|
||||
* nat/linux-namespaces.h: New file.
|
||||
* nat/linux-namespaces.c: Likewise.
|
||||
* Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-namespaces.h.
|
||||
(linux-namespaces.o): New rule.
|
||||
* config/aarch64/linux.mh (NATDEPFILES): Add linux-namespaces.o.
|
||||
* config/alpha/alpha-linux.mh (NATDEPFILES): Likewise.
|
||||
* config/arm/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/i386/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/i386/linux64.mh (NATDEPFILES): Likewise.
|
||||
* config/ia64/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/m32r/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/m68k/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/mips/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/pa/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/powerpc/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
|
||||
* config/powerpc/spu-linux.mh (NATDEPFILES): Likewise.
|
||||
* config/s390/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/sparc/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
|
||||
* config/tilegx/linux.mh (NATDEPFILES): Likewise.
|
||||
* config/xtensa/linux.mh (NATDEPFILES): Likewise.
|
||||
|
||||
2015-06-10 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* utils.h (make_cleanup_close): Moved to common/filestuff.h.
|
||||
|
@ -979,7 +979,8 @@ i386-linux-nat.h common/common-defs.h common/errors.h common/common-types.h \
|
||||
common/common-debug.h common/cleanups.h common/gdb_setjmp.h \
|
||||
common/common-exceptions.h target/target.h common/symbol.h \
|
||||
common/common-regcache.h fbsd-tdep.h nat/linux-personality.h \
|
||||
common/fileio.h nat/x86-linux.h nat/x86-linux-dregs.h
|
||||
common/fileio.h nat/x86-linux.h nat/x86-linux-dregs.h \
|
||||
nat/linux-namespaces.h
|
||||
|
||||
# Header files that already have srcdir in them, or which are in objdir.
|
||||
|
||||
@ -2319,6 +2320,10 @@ x86-linux-dregs.o: ${srcdir}/nat/x86-linux-dregs.c
|
||||
$(COMPILE) $(srcdir)/nat/x86-linux-dregs.c
|
||||
$(POSTCOMPILE)
|
||||
|
||||
linux-namespaces.o: ${srcdir}/nat/linux-namespaces.c
|
||||
$(COMPILE) $(srcdir)/nat/linux-namespaces.c
|
||||
$(POSTCOMPILE)
|
||||
|
||||
#
|
||||
# gdb/tui/ dependencies
|
||||
#
|
||||
|
@ -390,6 +390,9 @@
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define to 1 if you have the `setns' function. */
|
||||
#undef HAVE_SETNS
|
||||
|
||||
/* Define to 1 if you have the `setpgid' function. */
|
||||
#undef HAVE_SETPGID
|
||||
|
||||
|
@ -22,7 +22,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o \
|
||||
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
|
||||
linux-personality.o
|
||||
linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES= -ldl $(RDYNAMIC)
|
||||
|
@ -3,7 +3,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
|
||||
fork-child.o proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o linux-personality.o
|
||||
linux-waitpid.o linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
|
@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o linux-personality.o
|
||||
linux-waitpid.o linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES= -ldl $(RDYNAMIC)
|
||||
|
@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
|
||||
x86-linux-dregs.o
|
||||
x86-linux-dregs.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
|
@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
proc-service.o linux-thread-db.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-btrace.o \
|
||||
linux-waitpid.o linux-personality.o x86-linux.o \
|
||||
x86-linux-dregs.o
|
||||
x86-linux-dregs.o linux-namespaces.o
|
||||
NAT_FILE= config/nm-linux.h
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
|
@ -6,7 +6,8 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-personality.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
m32r-linux-nat.o proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o linux-personality.o
|
||||
linux-waitpid.o linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES= -ldl $(RDYNAMIC)
|
||||
|
@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-personality.o \
|
||||
linux-waitpid.o
|
||||
linux-waitpid.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
|
@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o \
|
||||
mips-linux-watch.o
|
||||
mips-linux-watch.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
@ -4,7 +4,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
hppa-linux-nat.o proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o
|
||||
linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o linux-personality.o
|
||||
linux-waitpid.o linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
@ -6,7 +6,8 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o ppc-linux.o linux-personality.o
|
||||
linux-waitpid.o ppc-linux.o linux-personality.o \
|
||||
linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The PowerPC has severe limitations on TOC size, and uses them even
|
||||
|
@ -4,5 +4,5 @@
|
||||
# PPU side of the Cell BE and debugging the SPU side.
|
||||
|
||||
NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o
|
||||
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o linux-namespaces.o
|
||||
|
@ -4,6 +4,6 @@ NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
|
||||
linux-thread-db.o proc-service.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-personality.o \
|
||||
linux-waitpid.o
|
||||
linux-waitpid.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
@ -5,7 +5,7 @@ NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o
|
||||
linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
|
@ -5,7 +5,7 @@ NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o
|
||||
linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
|
@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||
proc-service.o linux-thread-db.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o \
|
||||
linux-procfs.o linux-ptrace.o linux-waitpid.o \
|
||||
linux-personality.o
|
||||
linux-personality.o linux-namespaces.o
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
# gdb executable.
|
||||
|
@ -5,7 +5,7 @@ NAT_FILE= config/nm-linux.h
|
||||
NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
|
||||
linux-thread-db.o proc-service.o \
|
||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
|
||||
linux-waitpid.o linux-personality.o
|
||||
linux-waitpid.o linux-personality.o linux-namespaces.o
|
||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||
|
||||
LOADLIBES = -ldl $(RDYNAMIC)
|
||||
|
2
gdb/configure
vendored
2
gdb/configure
vendored
@ -10957,7 +10957,7 @@ for ac_func in getauxval getrusage getuid getgid \
|
||||
sigaction sigprocmask sigsetmask socketpair \
|
||||
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
|
||||
setrlimit getrlimit posix_madvise waitpid \
|
||||
ptrace64 sigaltstack mkdtemp
|
||||
ptrace64 sigaltstack mkdtemp setns
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
|
@ -1331,7 +1331,7 @@ AC_CHECK_FUNCS([getauxval getrusage getuid getgid \
|
||||
sigaction sigprocmask sigsetmask socketpair \
|
||||
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
|
||||
setrlimit getrlimit posix_madvise waitpid \
|
||||
ptrace64 sigaltstack mkdtemp])
|
||||
ptrace64 sigaltstack mkdtemp setns])
|
||||
AM_LANGINFO_CODESET
|
||||
GDB_AC_COMMON
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
2015-06-10 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* configure.ac (AC_CHECK_FUNCS): Add setns.
|
||||
* config.in: Regenerate.
|
||||
* configure: Likewise.
|
||||
* Makefile.in (SFILES): Add nat/linux-namespaces.c.
|
||||
(linux-namespaces.o): New rule.
|
||||
* configure.srv (srv_linux_obj): Add linux-namespaces.o.
|
||||
|
||||
2015-06-09 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* hostio.c (handle_open): Process mode argument with
|
||||
|
@ -180,7 +180,7 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
|
||||
$(srcdir)/common/common-debug.c $(srcdir)/common/cleanups.c \
|
||||
$(srcdir)/common/common-exceptions.c $(srcdir)/symbol.c \
|
||||
$(srcdir)/common/btrace-common.c \
|
||||
$(srcdir)/common/fileio.c
|
||||
$(srcdir)/common/fileio.c $(srcdir)/nat/linux-namespaces.c
|
||||
|
||||
DEPFILES = @GDBSERVER_DEPFILES@
|
||||
|
||||
@ -615,6 +615,9 @@ x86-linux.o: ../nat/x86-linux.c
|
||||
x86-linux-dregs.o: ../nat/x86-linux-dregs.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
linux-namespaces.o: ../nat/linux-namespaces.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
|
||||
|
@ -186,6 +186,9 @@
|
||||
/* Define to 1 if you have the `pwrite' function. */
|
||||
#undef HAVE_PWRITE
|
||||
|
||||
/* Define to 1 if you have the `setns' function. */
|
||||
#undef HAVE_SETNS
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
|
2
gdb/gdbserver/configure
vendored
2
gdb/gdbserver/configure
vendored
@ -5310,7 +5310,7 @@ fi
|
||||
|
||||
done
|
||||
|
||||
for ac_func in getauxval pread pwrite pread64
|
||||
for ac_func in getauxval pread pwrite pread64 setns
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
|
@ -94,7 +94,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
|
||||
fcntl.h signal.h sys/file.h dnl
|
||||
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
|
||||
netinet/tcp.h arpa/inet.h)
|
||||
AC_CHECK_FUNCS(getauxval pread pwrite pread64)
|
||||
AC_CHECK_FUNCS(getauxval pread pwrite pread64 setns)
|
||||
|
||||
GDB_AC_COMMON
|
||||
|
||||
|
@ -42,7 +42,7 @@ srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/amd
|
||||
|
||||
# Linux object files. This is so we don't have to repeat
|
||||
# these files over and over again.
|
||||
srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o"
|
||||
srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o linux-namespaces.o"
|
||||
|
||||
# Input is taken from the "${target}" variable.
|
||||
|
||||
|
1050
gdb/nat/linux-namespaces.c
Normal file
1050
gdb/nat/linux-namespaces.c
Normal file
File diff suppressed because it is too large
Load Diff
76
gdb/nat/linux-namespaces.h
Normal file
76
gdb/nat/linux-namespaces.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* Linux namespaces(7) support.
|
||||
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef LINUX_NAMESPACES_H
|
||||
#define LINUX_NAMESPACES_H
|
||||
|
||||
/* Set to nonzero to enable debugging of Linux namespaces code. */
|
||||
|
||||
extern int debug_linux_namespaces;
|
||||
|
||||
/* Enumeration of Linux namespace types. */
|
||||
|
||||
enum linux_ns_type
|
||||
{
|
||||
/* IPC namespace: System V IPC, POSIX message queues. */
|
||||
LINUX_NS_IPC,
|
||||
|
||||
/* Mount namespace: mount points. */
|
||||
LINUX_NS_MNT,
|
||||
|
||||
/* Network namespace: network devices, stacks, ports, etc. */
|
||||
LINUX_NS_NET,
|
||||
|
||||
/* PID namespace: process IDs. */
|
||||
LINUX_NS_PID,
|
||||
|
||||
/* User namespace: user and group IDs. */
|
||||
LINUX_NS_USER,
|
||||
|
||||
/* UTS namespace: hostname and NIS domain name. */
|
||||
LINUX_NS_UTS,
|
||||
|
||||
/* Number of Linux namespaces. */
|
||||
NUM_LINUX_NS_TYPES
|
||||
};
|
||||
|
||||
/* Return nonzero if process PID has the same TYPE namespace as the
|
||||
calling process, or if the kernel does not support TYPE namespaces
|
||||
(in which case there is only one TYPE namespace). Return zero if
|
||||
the kernel supports TYPE namespaces and the two processes have
|
||||
different TYPE namespaces. */
|
||||
|
||||
extern int linux_ns_same (pid_t pid, enum linux_ns_type type);
|
||||
|
||||
/* Like gdb_open_cloexec, but in the mount namespace of process
|
||||
PID. */
|
||||
|
||||
extern int linux_mntns_open_cloexec (pid_t pid, const char *filename,
|
||||
int flags, mode_t mode);
|
||||
|
||||
/* Like unlink(2), but in the mount namespace of process PID. */
|
||||
|
||||
extern int linux_mntns_unlink (pid_t pid, const char *filename);
|
||||
|
||||
/* Like readlink(2), but in the mount namespace of process PID. */
|
||||
|
||||
extern ssize_t linux_mntns_readlink (pid_t pid, const char *filename,
|
||||
char *buf, size_t bufsiz);
|
||||
|
||||
#endif /* LINUX_NAMESPACES_H */
|
Loading…
x
Reference in New Issue
Block a user