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: Gary Benson <gbenson at redhat dot com>
- To: Michael Eager <eager at eagerm dot com>
- Cc: gdb-patches at sourceware dot org, Pedro Alves <palves at redhat dot com>, Doug Evans <dje at google dot com>, Iago López Galeiras <iago at endocode dot com>
- Date: Tue, 16 Jun 2015 09:40:33 +0100
- 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> <557F4DE3 dot 6020306 at eagerm dot com>
Michael Eager wrote:
> 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 linux-namespaces.[ch]
> > > containing code to support Linux namespaces that will be used
> > > by both GDB and gdbserver.
> >
> > 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.
[snip]
Looks good, though maybe with a comment (below).
Please commit this.
Cheers,
Gary
--
diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c
index f18e40d..a7a3e4d 100644
--- a/gdb/nat/linux-namespaces.c
+++ b/gdb/nat/linux-namespaces.c
@@ -47,6 +47,12 @@ setns (int fd, int nstype)
}
#endif
+/* Handle systems without MSG_CMSG_CLOEXEC. */
+
+#ifndef MSG_CMSG_CLOEXEC
+#define MSG_CMSG_CLOEXEC 0
+#endif
+
/* A Linux namespace. */
struct linux_ns