- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- information about a particular process in HPUX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
тАО08-17-2004 08:39 PM
тАО08-17-2004 08:39 PM
i.e pstat_getproc(&pst,sizeof(pst),(size_t)1,idx))
where idx=0
pst is of type struct pst_status.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2004 05:01 AM
тАО08-18-2004 05:01 AM
Re: information about a particular process in HPUX
According to the pstat_getproc() man page:
_____________________________________
As a shortcut, information for a single process may be obtained by setting elemcount to zero and setting index to the PID of that process.
_____________________________________
Have you tried calling pstat_getproc() in this manner?
Regards,
Dave
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2004 05:04 AM
тАО08-18-2004 05:04 AM
Re: information about a particular process in HPUX
Dave
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2004 10:25 AM
тАО08-18-2004 10:25 AM
Re: information about a particular process in HPUX
You would be much safer to compare the returned info (.pst_cmd) with your command name and once you have a match you know you have the right pstat structure to extract whatever you want (so you don't even need to call pstat_getproc on the individual PID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2004 06:50 PM
тАО08-18-2004 06:50 PM
Re: information about a particular process in HPUX
However if I use pstat_getproc it retrieves each process one by one. I don't know the pid. so i can't use the shortcut method. But i guess that we have to loop through all processes until we get the right one.
The command is supposed to be used in this way:
struct pst_status pst;
.
.
.
while(pstat_getproc(&pst,sizeof(pst),(size_t)1,idx)>0)
{
idx=(int)pst.pst_idx+1;
if( strcmp(basename(pst.pst_cmd,ourprocname)==0)
{
.... our code ......
break;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2004 04:57 AM
тАО08-19-2004 04:57 AM
Re: information about a particular process in HPUX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2004 05:00 AM
тАО08-19-2004 05:00 AM
Solution#define BURST ((size_t)10)
struct pst_status pst[BURST];
int i, count;
int idx = 0; /* index within the context */
/* loop until count == 0, will occur when all have been returned */
while ((count = pstat_getproc(pst, sizeof(pst[0]), BURST, idx)) > 0)
{
/* got count (max of BURST) this time. process them */
for (i = 0; i < count; i++) {
if (command && strcmp(pst[i].pst_ucomm, command))
continue; /* doesn't match command */