From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75284 invoked by alias); 17 Apr 2015 04:36:00 -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 75272 invoked by uid 89); 17 Apr 2015 04:36:00 -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-ob0-f170.google.com Received: from mail-ob0-f170.google.com (HELO mail-ob0-f170.google.com) (209.85.214.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 17 Apr 2015 04:35:59 +0000 Received: by oblw8 with SMTP id w8so60810635obl.0 for ; Thu, 16 Apr 2015 21:35:57 -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=ykeiX9rYdzex6GPnelJNugcgRBdN8p9Wc/LR4nQKxls=; b=kKmJS7UoqdC4MKqeNmC6nVVAgcHVyi6nZOVbSZw0Vo8TavxU4Mk/N8rVIEgKpxqzgn oobruhp/kGgXmXfx6LAjRgdEX888SXYaJ0wYndP5FIHvMPmc9jx7sSAk4Ogt2Jv5K0h3 XcUUDviEowm2c9Kz2vQKKZ5FCcZDZEmgwGiYjf0fD8eYHF9UsY8yhaUFxXjrnpsDtxeJ LF5cKd8JW1Of/2dZIvs6Kw62iMIwNk5KVW+aYyffSLSPCehWsocGawyBDJ58f8u1fTkI xs5yJI9uoH7E6cgCDAIs13ZnFAUoCQ9iX0HJaY2Ri/VnP4Oz39RmjeFe/7KoMIGnyP7o vurw== X-Gm-Message-State: ALoCoQkEFzSH4jxhur3FoIuu6+XJDCccJF3MQm7H338Rzy/La0QBn6Gn85FFxIZ72OmweCTMmUXH MIME-Version: 1.0 X-Received: by 10.202.84.135 with SMTP id i129mr1001059oib.114.1429245357414; Thu, 16 Apr 2015 21:35:57 -0700 (PDT) Received: by 10.182.103.101 with HTTP; Thu, 16 Apr 2015 21:35:57 -0700 (PDT) In-Reply-To: <1429186791-6867-5-git-send-email-gbenson@redhat.com> References: <1429186791-6867-1-git-send-email-gbenson@redhat.com> <1429186791-6867-5-git-send-email-gbenson@redhat.com> Date: Fri, 17 Apr 2015 04:36:00 -0000 Message-ID: Subject: Re: [PATCH 4/7] Remove linux_proc_pid_get_ns From: Doug Evans To: Gary Benson Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00640.txt.bz2 On Thu, Apr 16, 2015 at 5:19 AM, Gary Benson wrote: > This commit removes linux_proc_pid_get_ns, and updates its only > use to use linux_ns_same instead. > > gdb/ChangeLog: > > * linux-thread-db.c (nat/linux-namespaces.h): New include. > (check_pid_namespace_match): Use linux_ns_same rather than > linux_proc_pid_get_ns to spot PID namespace mismatches. > * nat/linux-procfs.h (linux_proc_pid_get_ns): Remove. > * nat/linux-procfs.c (linux_proc_pid_get_ns): Likewise. LGTM. one nit below > diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c > index 44364c5..24bcb01 100644 > --- a/gdb/nat/linux-procfs.c > +++ b/gdb/nat/linux-procfs.c > @@ -185,25 +185,6 @@ linux_proc_pid_is_zombie (pid_t pid) > return linux_proc_pid_is_zombie_maybe_warn (pid, 1); > } > > -/* See linux-procfs.h declaration. */ > - > -char * > -linux_proc_pid_get_ns (pid_t pid, const char *ns) > -{ > - char buf[100]; > - char nsval[64]; > - int ret; > - xsnprintf (buf, sizeof (buf), "/proc/%d/ns/%s", (int) pid, ns); > - ret = readlink (buf, nsval, sizeof (nsval)); > - if (0 < ret && ret < sizeof (nsval)) > - { > - nsval[ret] = '\0'; > - return xstrdup (nsval); > - } > - > - return NULL; > -} I see we're using pid_t here. I think we talked before about a type for pids. Since this is all linux specific code maybe use pid_t more in this patch set?