bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Larkin Nickle <me@larbob.org>
To: bug-gnulib@gnu.org
Subject: Fwd: Port getprogname module to Tru64
Date: Sat, 22 May 2021 02:40:02 -0400	[thread overview]
Message-ID: <6998c911-5031-b00c-2d99-b773792f4809@larbob.org> (raw)
In-Reply-To: <bd1ab32a-8c9e-ef69-1e5f-58673fe77e7c@larbob.org>

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 <string.h>
  #endif

-#ifdef __sgi
+#if defined __sgi || defined __osf__
  # include <string.h>
  # include <unistd.h>
  # include <stdio.h>
@@ -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)
      {


       reply	other threads:[~2021-05-22 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bd1ab32a-8c9e-ef69-1e5f-58673fe77e7c@larbob.org>
2021-05-22  6:40 ` Larkin Nickle [this message]
2021-05-22  6:54   ` Fwd: Port getprogname module to Tru64 Larkin Nickle
2021-05-22 14:52     ` Bruno Haible
2021-05-22 17:41       ` Larkin Nickle
2021-05-22 19:19         ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6998c911-5031-b00c-2d99-b773792f4809@larbob.org \
    --to=me@larbob.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).