From: Larkin Nickle Date: Sat, 22 May 2021 19:17:50 +0000 (-0700) Subject: getprogname: port to Tru64 X-Git-Tag: v1.0~2876 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=530ef0af967b773152642ca426d502575b48451d;p=gnulib.git getprogname: port to Tru64 * lib/getprogname.c: Treat __osf__ like __sgi, except with /proc/123 instead of /proc/pinfo/123. --- diff --git a/ChangeLog b/ChangeLog index 50e3761764..a3fcdb65fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-05-22 Larkin Nickle (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 sigsegv: don’t assume SIGSTKSZ is a constant diff --git a/lib/getprogname.c b/lib/getprogname.c index a3bd15ebb0..9a80281121 100644 --- a/lib/getprogname.c +++ b/lib/getprogname.c @@ -43,7 +43,7 @@ # include #endif -#ifdef __sgi +#if defined __sgi || defined __osf__ # include # include # include @@ -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) {