The test suites of applications using getprogname to print the current process name sometimes fails and prints '?' when both the pstat_getproc and __pstat_getproc64 fail. pstat_getproc never fails when I define _PSTAT64. Eventually, I found that the call to __pstat_getproc64 is sensitive to the sizeof struct pst_status. When I correct the size of status64 to the actual size of the struct pst_status on hppa, the call to __pstat_getproc64 works correctly.
I also added a declaration of __pstat_getproc64 to avoid compilation warning. Possibly, this is only needed on hppa. Dave --- --- getprogname.c.save 2021-09-19 15:28:26 +0000 +++ getprogname.c 2021-09-22 13:35:07 +0000 @@ -155,7 +155,12 @@ as above, but in a compilation unit where '#define _PSTAT64 1' is in effect. I prefer a single compilation unit; the struct size and the offsets are not going to change. */ +# ifdef __hppa__ + char status64[1176]; +# else char status64[1216]; +# endif + int __pstat_getproc64 (char *, size_t, size_t, int); if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0) { char *ucomm = status64 + 288;