From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B36B31F5AE for ; Sat, 22 May 2021 12:51:36 +0000 (UTC) Received: from localhost ([::1]:34026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkR6N-0001Ky-Sf for normalperson@yhbt.net; Sat, 22 May 2021 08:51:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkLX2-0007jd-J1 for bug-gnulib@gnu.org; Sat, 22 May 2021 02:54:44 -0400 Received: from mercury.larbob.org ([107.191.42.78]:31915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkLX0-0000UV-RW for bug-gnulib@gnu.org; Sat, 22 May 2021 02:54:44 -0400 Received: from [192.168.0.14] (cpe-74-132-21-98.kya.res.rr.com [74.132.21.98]) by mercury.larbob.org (OpenSMTPD) with ESMTPSA id 6b34bd96 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Sat, 22 May 2021 02:54:41 -0400 (EDT) Subject: Re: Fwd: Port getprogname module to Tru64 From: Larkin Nickle To: bug-gnulib@gnu.org References: <6998c911-5031-b00c-2d99-b773792f4809@larbob.org> Message-ID: Date: Sat, 22 May 2021 02:54:39 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <6998c911-5031-b00c-2d99-b773792f4809@larbob.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=107.191.42.78; envelope-from=me@larbob.org; helo=mercury.larbob.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 22 May 2021 08:51:31 -0400 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On 2021-05-22 02:40, Larkin Nickle wrote: > This patch allows getprogname to work under Tru64. This has been tested > on Tru64 5.1B-6 with success. > > Larkin > > ... Oops, the last patch has a bad header. This should be fixed. :) Larkin --- a/lib/getprogname.c 2021-05-22 02:27:02.835632500 -0400 +++ b/lib/getprogname.c 2021-05-22 02:33:55.003154200 -0400 @@ -43,7 +43,7 @@ # include #endif -#ifdef __sgi +#if defined __sgi || defined __osf__ # include # include # include @@ -224,11 +224,15 @@ free (buf.ps_pathptr); } return p; -# elif defined __sgi /* IRIX */ +# elif defined __sgi || defined __osf__ /* IRIX or Tru64 */ char filename[50]; int fd; - sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); + # if defined __sgi + sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); + # else + sprintf (filename, "/proc/%d", (int) getpid ()); + # endif fd = open (filename, O_RDONLY | O_CLOEXEC); if (0 <= fd) {