From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21313 invoked by alias); 17 Apr 2015 17:32:36 -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 21299 invoked by uid 89); 17 Apr 2015 17:32:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 17 Apr 2015 17:32:34 +0000 Received: by oica37 with SMTP id a37so78628722oic.0 for ; Fri, 17 Apr 2015 10:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Pl+OvUpCyDPobLTYbf3KMieagiK45Z/RpSkgwFsKfj8=; b=Sj8BRwK6Ui0cxFcL7FXZfC3nfKCkPNJ19SWSGeg4pm/FbWmQvDrOzuOhIBcIkOrfBM kdNtM+XyT6RodBdtSj3H/usXY8kOkUjzJhtNn2gvL+zdsgdag+/hiw0Ue78J5z/MN6Ky v/LQnWwBixqF1b+WYaZFaIa/O3PzkRco8HlS2ewCfqfbLFJlV30vq2YkGfzQgVU/ADR6 L18yUoeQ7AQJe2JOBuPVv7JZ/45UfBH+5n2TZioDP5G4xz9Fs+RBbK7BhUoGkmfVLtyR RtWuVrJe6cSPHUXooF4ClSUoK/T0KfiJqFlAar39DGpyiMZZO2q8BCSTNd514MiYAb3X YWEg== X-Gm-Message-State: ALoCoQnM895Sa4+vjdx8yir2ICcD0sikSSYIpK+9giTPhfQ5EAEgZDdujC4TWfUPTmM05QKteBLU MIME-Version: 1.0 X-Received: by 10.202.84.135 with SMTP id i129mr3740046oib.114.1429291952391; Fri, 17 Apr 2015 10:32:32 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Fri, 17 Apr 2015 10:32:32 -0700 (PDT) In-Reply-To: <55311E3D.1090502@redhat.com> References: <1429186791-6867-1-git-send-email-gbenson@redhat.com> <1429186791-6867-4-git-send-email-gbenson@redhat.com> <55311E3D.1090502@redhat.com> Date: Fri, 17 Apr 2015 17:32:00 -0000 Message-ID: Subject: Re: [PATCH 3/7] Introduce nat/linux-namespaces.[ch] From: Doug Evans To: Pedro Alves Cc: Gary Benson , gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00700.txt.bz2 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