This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/7] Introduce nat/linux-namespaces.[ch]
- From: Gary Benson <gbenson at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 20 Apr 2015 12:11:57 +0100
- Subject: Re: [PATCH 3/7] Introduce nat/linux-namespaces.[ch]
- Authentication-results: sourceware.org; auth=none
- References: <1429186791-6867-1-git-send-email-gbenson at redhat dot com> <1429186791-6867-4-git-send-email-gbenson at redhat dot com> <55311E3D dot 1090502 at redhat dot com> <CADPb22S+bw_bsSAe3jww=Mg2_hPVOwG6QqKPVCaAcfDaDc8dOA at mail dot gmail dot com>
Doug Evans wrote:
> On Fri, Apr 17, 2015 at 7:52 AM, Pedro Alves <palves@redhat.com> wrote:
> > > +/* Enter the TYPE namespace of process PID and call FUNC with the
> > > + argument ARG, returning to the original TYPE namespace afterwards.
> > > + If process PID has the same TYPE namespace as the current process,
> > > + or if TYPE namespaces are not supported, just call FUNC with ARG.
> > > + Return nonzero if FUNC was called, zero otherwise (and set ERRNO). */
> > > +
> > > +extern int linux_ns_enter (int pid, const char *type,
> > > + void (*func) (void *), void *arg);
> >
> >
> > So the function:
> >
> > #1 - enters the namespace
> > #2 - calls func
> > #3 - exits the namespace.
> >
> > IMO, "linux_ns_ENTER" isn't a good name for that. I'd expect that a function
> > called "enter" do just #1 above. Something like "linux_ns_do",
> > "linux_do_in_ns", "linux_in_ns", etc., would be clearer, IMO.
>
> with_linux_ns ?
>
> full disclosure: borrowed from Scheme
> /ducks
Works for me.
Cheers,
Gary
--
http://gbenson.net/