]> Savannah Git Hosting - gnulib.git/commitdiff
getprogname: port to Tru64
authorLarkin Nickle <me@larbob.org>
Sat, 22 May 2021 19:17:50 +0000 (12:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 May 2021 19:18:25 +0000 (12:18 -0700)
* lib/getprogname.c: Treat __osf__ like __sgi, except
with /proc/123 instead of /proc/pinfo/123.

ChangeLog
lib/getprogname.c

index 50e37617649872dd54dfe96e6f0ba349a3861594..a3fcdb65fef91b18f2344fad5526037a8b472c90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-22  Larkin Nickle  <me@larbob.org>  (tiny change)
+
+       getprogname: port to Tru64
+       * lib/getprogname.c: Treat __osf__ like __sgi, except
+       with /proc/123 instead of /proc/pinfo/123.
+
 2021-05-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        sigsegv: don’t assume SIGSTKSZ is a constant
index a3bd15ebb0d0c1eeb0ae8c511514177b5304007e..9a802811218d7f2be04e5595e835990af42c658d 100644 (file)
@@ -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 @@ getprogname (void)
       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)
     {