bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getprogname fails randomly on PA-RISC HPUX 11.11 with 64-bit kernel


From: John David Anglin
Subject: getprogname fails randomly on PA-RISC HPUX 11.11 with 64-bit kernel
Date: Wed, 22 Sep 2021 13:59:59 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]