k.********@gmail.com wrote:
Hi,
Note: This is entirely OffTopic in comp.lang.c -- hence followups
are set to comp.sys.hp.hpux where this belongs. Gentle (or not
so gentle) readers of comp.lang.c, please ignore the rest of this OT
reply -- thanks.
i'm new to HP-UX and of course 've got some issues...
Using undocumented system calls strikes me as a rather
odd way to start.
I will say that I don't think sysinfo() takes the arguments you think
it does. And given that this is a undocumented call.. those are
undocumented for a reason [i.e. HP doesn't really intend folks to
call it unless they're partners with some type of support/development
agreement...].
My suggestion? If you want the type of information that's in the
minfo structure (although some of that structure I can't tell
exactly what it thinks it would get exactly, mind you) -- use
the documented, supported interfaces for it. Assuming you're running
on anything vaguely recent, that should be pstat(). Likely you'll
want one or more of pstat_getvminfo(), pstat_getstatic() and
pstat_getdynamic(). "man 2 pstat" for your system -- note particularly
the section telling you where the headers for the structures live
[this varies by release], check the structure definitions for field
descriptions.
If you were trying for something more arcane/machine dependent such
as CPU type, etc. "man 2 sysconf"
Don
>
I want to make some use of sys/sysinfo.h but when running program i
get:
Invalid argument
Here's a short code sample:
#include <stdlib.h>
#include <stdio.h>
#include <sys/sysinfo.h>
int main(int argc, const char *argv[])
{
struct minfo s_info;
int ret = sysinfo(&s_info);
if(ret == -1){
perror("");
exit(-1);
}
return 1;
}
I bet it's lame, but i don't know how to solv this...
Please, help me with this one...
Best regards,
Krystian