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=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 AFCFB1F5AE for ; Sat, 22 May 2021 12:51:35 +0000 (UTC) Received: from localhost ([::1]:33998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkR6M-0001JP-Kg for normalperson@yhbt.net; Sat, 22 May 2021 08:51:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkLIv-0008IL-C0 for bug-gnulib@gnu.org; Sat, 22 May 2021 02:40:09 -0400 Received: from mercury.larbob.org ([107.191.42.78]:12527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkLIs-0003kn-LV for bug-gnulib@gnu.org; Sat, 22 May 2021 02:40:09 -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 f17ca8cd (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Sat, 22 May 2021 02:40:03 -0400 (EDT) Subject: Fwd: Port getprogname module to Tru64 References: To: bug-gnulib@gnu.org From: Larkin Nickle X-Forwarded-Message-Id: Message-ID: <6998c911-5031-b00c-2d99-b773792f4809@larbob.org> Date: Sat, 22 May 2021 02:40:02 -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: 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, 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" This patch allows getprogname to work under Tru64. This has been tested on Tru64 5.1B-6 with success. Larkin --- lib/getprogname.c 2021-05-22 02:27:02.835632500 -0400 +++ lib/getprogname.c.patched 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) {