Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use those system functions to catch system info. ?

 
SOLVED
Go to solution
Highlighted
Super Advisor

How to use those system functions to catch system info. ?

anyone knows where i can find more detail information about how to use those HP system functions ?

"/usr/include/sys/pstat.h"

# define pstat_getstatic __pstat_getstatic64
# define pstat_getdynamic __pstat_getdynamic64
# define pstat_getvminfo __pstat_getvminfo64
# define pstat_getprocessor __pstat_getprocessor64
# define pstat_getproc __pstat_getproc64
# define pstat_getdisk __pstat_getdisk64
# define pstat_getlv __pstat_getlv64
# define pstat_getswap __pstat_getswap64
# define pstat_getfile __pstat_getfile64
# define pstat_getsem __pstat_getsem64
# define pstat_getmsg __pstat_getmsg64
# define pstat_getshm __pstat_getshm64
# define pstat_getipc __pstat_getipc64
# define pstat_getstable __pstat_getstable64
# define pstat_getprocvm __pstat_getprocvm64
# define pstat_getcrashinfo __pstat_getcrashinfo64
# define pstat_getcrashdev __pstat_getcrashdev64
# define pstat_getnode __pstat_getnode64
# define pstat_getstream __pstat_getstream64
# define pstat_getsocket __pstat_getsocket64
# define pstat_getfiledetails __pstat_getfiledetails64
# define pstat_getpathname __pstat_getpathname64
# define pstat_getmpathname __pstat_getmpathname64
# define pstat_getfile2 __pstat_getfile264
# define pstat_getpset __pstat_getpset64


Thanks!

 

 

P.S.This thread has been moved from HP-UX>System Administration to HP-UX > languages- HP Forums Moderator

7 REPLIES 7
Highlighted
Honored Contributor

Re: How to use those system functions to catch system info. ?

Umm, "man pstat" gives quite a good account.

However, here is a a quick example.

#include
#include
#include


struct pst_static buf;

if (pstat_getstatic(&buf, sizeof(buf), (size_t)1, 0) != -1){
(void)printf("Physical memory %ld\n",buf.physical_memory);
}
else
perror("pstat_static");
}
Never preceed any demonstration with anything more predictive than "watch this"
Highlighted
Honored Contributor

Re: How to use those system functions to catch system info. ?

Wow, somehow I forgot main()!!

Stick this in before the "struct pst_static buf";

main(argc,argv)
int argc;
char **argv;
{
Never preceed any demonstration with anything more predictive than "watch this"
Highlighted
Super Advisor

Re: How to use those system functions to catch system info. ?

thanks! "man pstat" is good !
But do you know more detail info about pstat or other system functions, like how to use those variables, in PDF files, books...

thanks again !
Highlighted
Honored Contributor

Re: How to use those system functions to catch system info. ?

Sorry but I don't I'm afraid. I learnt C from the unix man pages so I'm sort of used to using them as the font of all knowledge :)
Never preceed any demonstration with anything more predictive than "watch this"
Highlighted
Super Advisor

Re: How to use those system functions to catch system info. ?

thanks, i hope that i can get some HP internal resources about the usage and accurate definitions of those variables of those functions...
Highlighted
Occasional Advisor
Solution

Re: How to use those system functions to catch system info. ?

In addition to the man pages, there is also a white paper (although most of the information is contained in the manpages):

http://docs.hp.com/hpux/onlinedocs/os/11i/pstat_whitepaper.pdf

I'd asked a question via HP support and this was the only information they were able to provide (although often the comments in the header files are enough to work out roughly what's going on).

In addition, the memory management and process management white papers in /usr/share/doc on an 11.0 system provide some clues as to some of the other values.
Highlighted
Super Advisor

Re: How to use those system functions to catch system info. ?

thanks David, that's what i want !