From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16512 invoked by alias); 20 Apr 2015 11:12:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16427 invoked by uid 89); 20 Apr 2015 11:12:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 20 Apr 2015 11:12:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 395B85B; Mon, 20 Apr 2015 11:11:59 +0000 (UTC) Received: from blade.nx (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3KBBwVj031696; Mon, 20 Apr 2015 07:11:58 -0400 Received: by blade.nx (Postfix, from userid 1000) id 8A43F264117; Mon, 20 Apr 2015 12:11:57 +0100 (BST) Date: Mon, 20 Apr 2015 11:12:00 -0000 From: Gary Benson To: Doug Evans Cc: Pedro Alves , gdb-patches Subject: Re: [PATCH 3/7] Introduce nat/linux-namespaces.[ch] Message-ID: <20150420111157.GC9269@blade.nx> References: <1429186791-6867-1-git-send-email-gbenson@redhat.com> <1429186791-6867-4-git-send-email-gbenson@redhat.com> <55311E3D.1090502@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00740.txt.bz2 Doug Evans wrote: > On Fri, Apr 17, 2015 at 7:52 AM, Pedro Alves 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/