From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122174 invoked by alias); 19 Sep 2018 13:21:24 -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 121105 invoked by uid 89); 19 Sep 2018 13:21:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Sep 2018 13:21:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 67B7B56015; Wed, 19 Sep 2018 09:21:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id N4nfTgKtzC6J; Wed, 19 Sep 2018 09:21:20 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3698C56006; Wed, 19 Sep 2018 09:21:20 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7A64F85884; Wed, 19 Sep 2018 06:21:18 -0700 (PDT) Date: Wed, 19 Sep 2018 13:21:00 -0000 From: Joel Brobecker To: Rainer Orth Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix /proc pathname sizes on Solaris Message-ID: <20180919132118.GM19172@adacore.com> References: <20180917183459.GE19172@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-09/txt/msg00680.txt.bz2 > I've done some more digging myself: here's what I found: > > * The MAX_PROC_NAME_SIZE part (done slightly differently) was originally > done by Stefan Teleman when he imported gdb 7.6 into the userland repo > (gdb.procfs.c.patch). > > * The change to create_procinfo originated with April Chin when > importing gdb 7.12.1 later (001-fix-proc-name-size.patch). > > * I had to make minor adjustments for master to account for my removal > of !NEW_PROC_API > > So I'm going to attribute the patch to all three of us ;-) Sounds good :). > >> @@ -483,7 +483,7 @@ create_procinfo (int pid, int tid) > >> } > >> else > >> { > >> - sprintf (pi->pathname, "/proc/%05d/lwp/%d", pid, tid); > >> + sprintf (pi->pathname, "/proc/%d/lwp/%d", pid, tid); > > > > I am wondering how this ever worked for processes whose pid had > > fewer than 5 digits. I was initially concerned that this patch > > introduced a change of behavior that would create an incompatibility. > > But looking at Solaris 2.8 and 2.11 systems, I see processes with > > 3 or 4 digits PIDs, and the path in /proc doesn't have leading zeroes. > > Indeed, and Solaris procfs doesn't care if the part contains > additional leading zeros or not. > > > I also checked whether the file might be used on platforms other than > > Solaris (see configure.nat), and this does not appear to be the case. > > True: I removed support for all other previous users when getting rid of > !NEW_PROC_API, IRIX and Tru64 UNIX support that had long been obsoleted. Excellent. An extra confirmation is always nice. -- Joel