This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]