- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: question on pstat_getcommandline
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
Forums
Discussions
Discussions
Discussions
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
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
11-25-2003 06:12 PM
11-25-2003 06:12 PM
I am currently running on HPUX 11i. I am using pstat_getcommandline in one of my programs. I get the following error when I try to compile.
---------------------------
Function 'pstat_getcommandline' has not been defined yet; cannot call.
---------------------------
Even though I have included sys/pstat.h?
Could someone please help me out?
Thanks
Padmini
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 06:41 PM
11-25-2003 06:41 PM
Re: question on pstat_getcommandline
I can't see the option for 'pstat_getcommandline' from the manual page on HP-UX 11i system.
# man pstat
Could you inform to me what the purpose of 'pstat_getcommandline' in your script ?
Best Regards,
AW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 09:03 PM
11-25-2003 09:03 PM
Re: question on pstat_getcommandline
From the net I found pstat_getcommandline Returns the commandline of the process specified (which is listed for 11.i v2)
However, I am currently running on 11.11 (pa risc ). Does it mean, pstat_getcommandline for 11.11, is not supported?
And that pstat_getcommandline is only for 11.i v2 (for intel itanium 2 architecture)?
Thanks
Padmini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 09:18 PM
11-25-2003 09:18 PM
Solution...
The PSTAT_GETCOMMANDLINE opcode is undocumented and unsupported for normal use.
...
With these caveats in mind, here is sample C code that uses the PSTAT_GETCOMMANDLINE function code and works on an HP-UX 11.11 system as of March 28, 2001:
#include
#include
#define MAX_LENGTH (1024)
main (argc, argv) int argc; char *argv[]; {
int pid;
char long_command [MAX_LENGTH];
union pstun pu;
pid = atoi(argv[1]);
pu.pst_command = long_command;
if (pstat(PSTAT_GETCOMMANDLINE, pu, MAX_LENGTH, 1, pid) == -1) {
printf("ERROR: pstat() failure using pid(%d)\n", pid);
exit(-1);
}
printf("pid %d = %s\n", pid, pu.pst_command);
}
...
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 10:12 PM
11-25-2003 10:12 PM