473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

HP-UX sysinfo usage

Hi,

i'm new to HP-UX and of course 've got some issues...

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

Nov 15 '06 #1
3 4056
k.********@gmail.com said:
Hi,

i'm new to HP-UX and of course 've got some issues...

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>
That's a non-standard header, so you should beware the following reply,
which is based on my inspection of my own system headers, which may be
completely different to yours.
int main(int argc, const char *argv[])
{
struct minfo s_info;
Look up sysinfo(), and check that it really does take a pointer to a struct
minfo object. On my system, it doesn't. So the topical, ISO C answer to
your question is that you appear to be passing a pointer of one type to a
function that expects a pointer to a different type.

Your best bets for the exact semantics and usage of sysinfo() are:

(1) consult your system's documentation;
(2) ask in comp.unix.programmer if you get stuck.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 15 '06 #2
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
Nov 15 '06 #3
Richard Heathfield wrote:
k.********@gmail.com said:
Hi,

i'm new to HP-UX and of course 've got some issues...
Your best bets for the exact semantics and usage of sysinfo() are:

(1) consult your system's documentation;
(2) ask in comp.unix.programmer if you get stuck.

A possible avenue would be the comp.sys.hp.hpux newsgroup as well.

Brian
Nov 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rami | last post by:
Hello all, Java has some printing problems with hp pcl5e and pcl6 drivers. I have one another printer that is defined just as "...PCL series", and this printer prints java output correctly. So, I...
0
by: rbt | last post by:
Hello there, Depending on the firmware version of the HP printer and the model type, one will encounter a myriad of combinations of the following strings while reading the index page: hp HP...
4
by: rpmohan | last post by:
Hello, I have sample Program called sample.C . The source code looks like below. #include <List.h> int main(int argc, char *argv) { List<int> myList; return 0;
1
by: Einat d | last post by:
HELP! This code compiles fine on the Solaris and AIX platform but for some reasone fails on the HP 11 platform. Here is the error I'm getting: Error 226: "ClsGetAllRepository.cpp", line 107...
2
by: Ari | last post by:
we have a strange problem with oracle dynamic sql method 4. when selecting a substr we expect to, and normally, receive from oracle in the describe select list (SELDSC) the length of the...
4
by: Le | last post by:
Our HP representatives are telling us that backing/restoring our MS SQL Servers with "HP Data Protector (HPDP)" is better and safer than using MS Sql's backup/restore process. I have strong...
1
by: AAVF | last post by:
We have a problem that has only started in the last few weeks. We have an Access 2000 database running on a P300 Win98 PC. The PC outputs Access reports to an HP LaserJet 5L printer, connected to...
0
by: Antonio Paglia | last post by:
Hi guys, I saw an strange behavior with some printers of series HP Laserjet 1000. I have installed several printers on my PC, some of them are : HP LaserJet 1020 e 1010. I'm using...
0
by: Prometric Test center | last post by:
Best Prometric (like Microsoft, Sun Microsystems, Dell, HP) Test center In Bangalore Hi Guys, Greetings from Everonn!!!! Are you looking for the good Prometric (like Microsoft, Sun...
0
by: recruiterforitjobs | last post by:
Hi, Hope you are doing great, My name is Sumit Kumar, and I am a technical recruiter for Okaya Inc, a technical staff augmentation firm located in NY. I am currently in search of an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.