bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Port getprogname module to Tru64


From: Larkin Nickle
Subject: Fwd: Port getprogname module to Tru64
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

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 via email to

[Prev in Thread] Current Thread [Next in Thread]