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)
{