HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pstat_getproc()
Operating System - HP-UX
1826677
Members
2624
Online
109696
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
Forums
Discussions
Discussions
Discussions
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
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
11-16-2001 12:02 PM
11-16-2001 12:02 PM
pstat_getproc()
I have a C program that uses pstat_getproc to get process information of everything that is running on an HP-UX 11.00 system.
I am trying to convert this to run on Linux. Does anyone know what the equivelant is on Linux? Or where I can find documentation on the API interface for the "ps" command.
Thanks in advance.
--Keith
I am trying to convert this to run on Linux. Does anyone know what the equivelant is on Linux? Or where I can find documentation on the API interface for the "ps" command.
Thanks in advance.
--Keith
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2001 12:23 PM
11-16-2001 12:23 PM
Re: pstat_getproc()
I'm not sure how this helps:
http://web.mit.edu/afs/sipb.mit.edu/project/sipbsrc/linux/skill-3.7/getproc.c
live free or die
harry
http://web.mit.edu/afs/sipb.mit.edu/project/sipbsrc/linux/skill-3.7/getproc.c
live free or die
harry
Live Free or Die
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2001 12:24 PM
11-16-2001 12:24 PM
Re: pstat_getproc()
Most of that information is gathered by catting files in the /proc filesystem. There is a LPK (Linux Porting Kit) on HP's Devresources site:
http://devresource.hp.com/LPK/docs/portguideparisc.pdf
which might be of some help. I believe they talk about portin from Linux to HP but the information is probably relavent going the other way.
Hope this helps.
-Santosh
http://devresource.hp.com/LPK/docs/portguideparisc.pdf
which might be of some help. I believe they talk about portin from Linux to HP but the information is probably relavent going the other way.
Hope this helps.
-Santosh
Life is what's happening while you're busy making other plans
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2001 02:30 PM
11-16-2001 02:30 PM
Re: pstat_getproc()
Here's an example from sendmail:
/*
** Read /proc/loadavg for the load average. This is assumed to be
** in a format like "0.15 0.12 0.06".
**
** Initially intended for Linux. This has been in the kernel
** since at least 0.99.15.
*/
# ifndef _PATH_LOADAVG
# define _PATH_LOADAVG "/proc/loadavg"
# endif
int
getla()
{
double avenrun;
register int result;
FILE *fp;
fp = fopen(_PATH_LOADAVG, "r");
if (fp == NULL)
{
if (tTd(3, 1))
printf("getla: fopen(%s): %s\n",
_PATH_LOADAVG, errstring(errno));
return -1;
}
result = fscanf(fp, "%lf", &avenrun);
fclose(fp);
if (result != 1)
{
if (tTd(3, 1))
printf("getla: fscanf() = %d: %s\n",
result, errstring(errno));
return -1;
}
if (tTd(3, 1))
printf("getla(): %.2f\n", avenrun);
return ((int) (avenrun + 0.5));
}
/*
** Read /proc/loadavg for the load average. This is assumed to be
** in a format like "0.15 0.12 0.06".
**
** Initially intended for Linux. This has been in the kernel
** since at least 0.99.15.
*/
# ifndef _PATH_LOADAVG
# define _PATH_LOADAVG "/proc/loadavg"
# endif
int
getla()
{
double avenrun;
register int result;
FILE *fp;
fp = fopen(_PATH_LOADAVG, "r");
if (fp == NULL)
{
if (tTd(3, 1))
printf("getla: fopen(%s): %s\n",
_PATH_LOADAVG, errstring(errno));
return -1;
}
result = fscanf(fp, "%lf", &avenrun);
fclose(fp);
if (result != 1)
{
if (tTd(3, 1))
printf("getla: fscanf() = %d: %s\n",
result, errstring(errno));
return -1;
}
if (tTd(3, 1))
printf("getla(): %.2f\n", avenrun);
return ((int) (avenrun + 0.5));
}
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.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP