HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- process info.
Operating System - Linux
1827204
Members
2449
Online
109716
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
Go to solution
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-08-2006 07:53 PM
11-08-2006 07:53 PM
Can any one tell how to get process name from process id in HP. which field give this information.
#include
#include
#include
#include
int main( argc, argv )
int argc;
char** argv;
{
struct pst_status buf;
size_t psize;
size_t count;
int index;
index = getppid();
psize = sizeof( struct pst_status );
count = 0;
if ( pstat_getproc( &buf, psize, 0, index ) < 0 ) {
perror( "pstat_getproc" );
return -1;
}
printf( " Information %s\n", buf.u_comm);
return 0;
}
#include
#include
#include
#include
int main( argc, argv )
int argc;
char** argv;
{
struct pst_status buf;
size_t psize;
size_t count;
int index;
index = getppid();
psize = sizeof( struct pst_status );
count = 0;
if ( pstat_getproc( &buf, psize, 0, index ) < 0 ) {
perror( "pstat_getproc" );
return -1;
}
printf( " Information %s\n", buf.u_comm);
return 0;
}
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 07:58 PM
11-08-2006 07:58 PM
Re: process info.
Robert,
may I suggest you reward the efforts of the people helping with your questions:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Your profiles shows you have not allocated points to any of the answers to your questions!
This thread may help with your current question:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=195283
may I suggest you reward the efforts of the people helping with your questions:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Your profiles shows you have not allocated points to any of the answers to your questions!
This thread may help with your current question:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=195283
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 08:01 PM
11-08-2006 08:01 PM
Re: process info.
hi,
you may also have a look at "lsof"
hope this helps too!
kind regards
yogeerah
you may also have a look at "lsof"
hope this helps too!
kind regards
yogeerah
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Tags:
- lsof
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 11:37 PM
11-09-2006 11:37 PM
Solution
Looks like you mislabeled you name
buf.u_comm should be buf.pst_ucomm
I made a few changes but not many, I was able to compile and run the following:
#include
#include
#include
#include
main(argc, argv)
int argc ;
char **argv ;
{
struct pst_status buf;
size_t psize;
size_t count;
int index;
index= (int) getppid();
count=0;
if (pstat_getproc(&buf,sizeof(buf), (size_t)0,index) != -1)
{
(void) printf("Information Process id: %d Program Name: %s\n", index, buf.pst_ucomm);
}
else {
(void) perror("pstat_getpoc");
return -1;
}
return(0) ;
}
buf.u_comm should be buf.pst_ucomm
I made a few changes but not many, I was able to compile and run the following:
#include
#include
#include
#include
main(argc, argv)
int argc ;
char **argv ;
{
struct pst_status buf;
size_t psize;
size_t count;
int index;
index= (int) getppid();
count=0;
if (pstat_getproc(&buf,sizeof(buf), (size_t)0,index) != -1)
{
(void) printf("Information Process id: %d Program Name: %s\n", index, buf.pst_ucomm);
}
else {
(void) perror("pstat_getpoc");
return -1;
}
return(0) ;
}
There are a 100 ways to do things and 97 of them are right
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