1819870 Members
2705 Online
109607 Solutions
New Discussion юеВ

pstat_getproc PROBLEM...

 
SOLVED
Go to solution
Andrew Sandoval
New Member

pstat_getproc PROBLEM...

Has anyone seen problems with, or know of a patch that addresses problems with pstat_getproc on HP11?

The following code works great on one box (HP-UX hostdev B.11.00 A 9000/800 2001889088 two-user license), but not on another (HP-UX hpux-qa B.11.00 U 9000/800 151049638 unlimited-user license)

Code Sample:
int main(int argc, char *argv[])
{
struct pst_status pst;
int target = (int)getppid();

memset((void*)&pst, 0, sizeof(pst));
if(argc>1) target = atoi(argv[1]);

if (pstat_getproc(&pst, sizeof(pst), (size_t)0, target) != -1)
{
printf("Parent started at %s", ctime(&pst.pst_start));
printf("Basename: '%s'\n", pst.pst_ucomm);
printf("Commandline: '%s'\n", pst.pst_cmd);
}
else
{
printf("errno: %i\n", errno);
perror("pstat_getproc");
}
return 0;
}

On the U 9000/800 151049638 box I get the following error message:
errno: 72
pstat_getproc: Value too large to be stored in data type

It works perfectly on the other HP 11 box, giving me:
./myps.hp11
Parent started at Wed Dec 6 17:48:08 2000
Basename: 'bash'
Commandline: 'bash'

Thanks in advance for any help you can offer.

P.S. > The header file which defined pst_status has not changed.
"The glory of God is intelligence..."
2 REPLIES 2
Darrel Louis
Honored Contributor
Solution

Re: pstat_getproc PROBLEM...

Haven't seen it before.

Check if the following can help you further:
http://devresource.hp.com/CXX/Forums/hpux-devtools/hpux-devtools.0003/0004.html
Andrew Sandoval
New Member

Re: pstat_getproc PROBLEM...

Thank you... This lead me in a round about way to find the answer... If you compile with -D_PSTAT64 it will work on both systems.
"The glory of God is intelligence..."