Re: [PATCH 2/9 v2] Introduce nat/linux-namespaces.[ch]

Gary Benson
2016-01-11T16:40:55Z

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

--