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: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, Eli Zaretskii <eliz at gnu 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: Mon, 11 Jan 2016 16:40:50 +0000
- 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> <86si28wdlh dot fsf at gmail dot com>
Hi Yao,
Yao Qi wrote:
> Gary Benson <gbenson@redhat.com> writes:
> > +/* Return an object representing the mount namespace helper process.
> > + If no mount namespace helper process has been started then start
> > + one. Return NULL if no mount namespace helper process could be
> > + started. */
> > +
> > +static struct linux_mnsh *
> > +linux_mntns_get_helper (void)
> > +{
> > + static struct linux_mnsh *helper = NULL;
> > +
> > + if (helper == NULL)
> > + {
> > + static struct linux_mnsh h;
> > + struct linux_ns *ns;
> > + pid_t helper_creator = getpid ();
> > + int sv[2];
> > +
> > + ns = linux_ns_get_namespace (LINUX_NS_MNT);
> > + if (ns == NULL)
> > + return NULL;
> > +
> > + if (gdb_socketpair_cloexec (AF_UNIX, SOCK_STREAM, 0, sv) < 0)
> > + return NULL;
> > +
> > + h.pid = fork ();
> > + if (h.pid < 0)
>
> Function fork isn't available on uclinux target, so it causes a
> compilation error like this below. Since my work touches
> linux-bfin-low.c, I build GDBserver for bfin-uclinux, and the error
> is found.
[snip]
> I don't know much about linux namespace stuff, so I didn't give a
> fix here. Could you have a look?
It probably needs a configure check, I'll add one.
Cheers,
Gary
--
http://gbenson.net/