This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/9 v2] Introduce nat/linux-namespaces.[ch]
- From: Michael Eager <eager at eagerm dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Pedro Alves <palves at redhat dot com>, Doug Evans <dje at google dot com>, Iago LÃpez Galeiras <iago at endocode dot com>
- Date: Mon, 15 Jun 2015 15:12:51 -0700
- Subject: Re: [PATCH 2/9 v2] Introduce nat/linux-namespaces.[ch]
- Authentication-results: sourceware.org; auth=none
- References: <1429186791-6867-1-git-send-email-gbenson at redhat dot com> <1430395542-16017-3-git-send-email-gbenson at redhat dot com> <557EE8F7 dot 5090706 at eagerm dot com>
On 06/15/2015 08:02 AM, Michael Eager wrote:
On 04/30/2015 05:05 AM, Gary Benson wrote:
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.
This patch causes a build failure in nat/linux-namespaces.c with
glibc-2.5, which does not define MSG_CMSG_CLOEXEC. It looks like
this symbol was introduced in glib-2.7.
Here is a patch which allows this to compile if the symbol is not defined.
Changelog:
* nat/linux-namespaces.c (MSG_CMSG_CLOEXEC): Define if not defined.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
>From 7ccb1f19f15c6ef052d06f1da9e92fda9c2c1fe7 Mon Sep 17 00:00:00 2001
From: Michael Eager <meager@cisco.com>
Date: Mon, 15 Jun 2015 11:26:12 -0700
Subject: [PATCH] GDB -- Define MSG_CMSG_CLOEXEC if undefined
* nat/linux-namespaces.c (MSG_CMSG_CLOEXEC): Define.
---
gdb/nat/linux-namespaces.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c
index f18e40d..3fc4326 100644
--- a/gdb/nat/linux-namespaces.c
+++ b/gdb/nat/linux-namespaces.c
@@ -47,6 +47,10 @@ setns (int fd, int nstype)
}
#endif
+#ifndef MSG_CMSG_CLOEXEC
+#define MSG_CMSG_CLOEXEC 0
+#endif
+
/* A Linux namespace. */
struct linux_ns
--
2.2.1