Operating System - HP-UX
1748092 Members
5721 Online
108758 Solutions
New Discussion юеВ

problem with pstat_getdynamic function

 
Vadim Yezhakov
Advisor

problem with pstat_getdynamic function

Hi.
I use pstat_getdynamic function:
struct pst_dynamic psd;
pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0);

I have 4 HPUX servers.
Function work correctly on 3 servers, but it return -1 with errno 22 on last server.
4 REPLIES 4
Mike Stroyan
Honored Contributor

Re: problem with pstat_getdynamic function

I don't know how that could produce errno 22. You could get errno 72, EOVERFLOW, by compiling your code with a 32-bit pstat call and running it on a 64-bit kernel. You can correct that problem by compiling with -D_PSTAT64 or by adding
#define _PSTAT64
to the top of your source code before the include of sys/pstat.h.
Vadim Yezhakov
Advisor

Re: problem with pstat_getdynamic function

Hi Mike.
Thanks for response.
But errno is just 22 - Invalid Argument.
And some more...
Error occures on HPUX 11.00
On HPUX 11i servers all work normaly.
Don Morris_1
Honored Contributor

Re: problem with pstat_getdynamic function

Are you compiling the program on each server, or did you compile on one and are running on many? (I wouldn't be at all surprised if 11.11 added fields to the pst_dynamic structure. pstat will handle passing older, smaller structures for backwards compatability but it can't handle user structures larger than the kernel-internal ones.) Structures larger than the kernel expect will generate EINVAL from pstat in general, and definately from pstat_getdynamic().
Vadim Yezhakov
Advisor

Re: problem with pstat_getdynamic function

Thank you.
I compile and run test on 11.00. And now all right.