- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: pstat_getproc issue on 11iV3
Operating System - HP-UX
1755534
Members
4237
Online
108834
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 05:49 AM
тАО02-11-2009 05:49 AM
pstat_getproc issue on 11iV3
I am using following program to collect the current Heap usage... The same program work fine in HP11iV2.Some how the same program fails in 11iV3.
the pstat_getproc returns -1.
I am able to get pst_dsize,pst_tsize and pst_ssize.
what is the problem on 11iV3??
#include
#include
#include
#include
void main(void)
{
struct pst_status psinfo;
pid_t index = getpid();
fprintf(stderr,"\n%d\n",index);
if (pstat_getproc(&psinfo, sizeof(psinfo), (size_t)0, index) != -1)
{
printf("\nProcessHeap:%d\n ",psinfo.pst_dsize+psinfo.pst_tsize+psinfo.pst_ssize);
}
else
{
printf("\nFailed\n");
}
}
the pstat_getproc returns -1.
I am able to get pst_dsize,pst_tsize and pst_ssize.
what is the problem on 11iV3??
#include
#include
#include
#include
void main(void)
{
struct pst_status psinfo;
pid_t index = getpid();
fprintf(stderr,"\n%d\n",index);
if (pstat_getproc(&psinfo, sizeof(psinfo), (size_t)0, index) != -1)
{
printf("\nProcessHeap:%d\n ",psinfo.pst_dsize+psinfo.pst_tsize+psinfo.pst_ssize);
}
else
{
printf("\nFailed\n");
}
}
- Tags:
- pstat
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 12:06 PM
тАО02-11-2009 12:06 PM
Re: pstat_getproc issue on 11iV3
Howdy NAGS:
The program worked for me on 11iV3, only change I made was to #include
I think the errno should be set when pstat_getproc fails. Try using the perror function in the else clause.
Regards,
-Dave
The program worked for me on 11iV3, only change I made was to #include
I think the errno should be set when pstat_getproc fails. Try using the perror function in the else clause.
Regards,
-Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 03:37 PM
тАО02-11-2009 03:37 PM
Re: pstat_getproc issue on 11iV3
Your program isn't Standard:
warning #2951-D: return type of function "main" must be "int"
void main(void) {
warning #2223-D: function "getpid" declared implicitly
pid_t index = getpid();
Your format isn't correct: ProcessHeap:%ld
I'm not sure why you care about pst_tsize, this is just about free?
As David said you need to check errno.
Are you compiling with -D_PSTAT64?
If so, your format would be %lld.
warning #2951-D: return type of function "main" must be "int"
void main(void) {
warning #2223-D: function "getpid" declared implicitly
pid_t index = getpid();
Your format isn't correct: ProcessHeap:%ld
I'm not sure why you care about pst_tsize, this is just about free?
As David said you need to check errno.
Are you compiling with -D_PSTAT64?
If so, your format would be %lld.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP