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: Yao Qi <qiyaoltc at gmail dot com>
- To: Gary Benson <gbenson at redhat 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: Fri, 08 Jan 2016 10:49:14 +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>
Gary Benson <gbenson@redhat.com> writes:
Hi Gary,
> +/* 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.
cc1: warnings being treated as errors
gdb/gdbserver/../nat/linux-namespaces.c: In function âlinux_mntns_get_helperâ:
gdb/gdbserver/../nat/linux-namespaces.c:647: error: implicit declaration of function âforkâ
I don't know much about linux namespace stuff, so I didn't give a fix
here. Could you have a look?
--
Yao (éå)