[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: Port getprogname module to Tru64
From: |
Larkin Nickle |
Subject: |
Re: Fwd: Port getprogname module to Tru64 |
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 |
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 <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)
{