- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- getting the command line argument in HPUX 11.11
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
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
тАО09-28-2006 08:43 PM
тАО09-28-2006 08:43 PM
getting the command line argument in HPUX 11.11
I have HPUX 11.0 box.
if i compile the snippet on HPUX 11.0 box
#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);
}
I got the error :Undeclared variable 'PSTAT_GETCOMMANDLINE'.
for succesful compilation do i need to compile it on only HPUX11.11 and above..
or am i missing any declaration..
can someone help me on this...
Thank u all
raju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2006 11:54 PM
тАО09-28-2006 11:54 PM
Re: getting the command line argument in HPUX 11.11
What compiler are we talking about?
Seems that simple code like this should work. Add a printf statement after this:
pid = atoi(argv[1]);
I'd like to see what we're getting and narrow down the part of the code that is causing the error.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2006 12:21 AM
тАО09-29-2006 12:21 AM
Re: getting the command line argument in HPUX 11.11
For starters, the header file '/usr/include/sys/pstat/pstat_ops.h' doesn't appear on my 11.0 box. As I recall, there was extensive work on the 'pstat' interface that occured in 11.11, so I think that you are going to have to redraft your code to compile it on 11.0.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2006 01:12 AM
тАО09-29-2006 01:12 AM
Re: getting the command line argument in HPUX 11.11
If you think issue is resolved, you can assign points and close this thread.
Your feedback shows 0 out of 14 responses,hope you appreacite that people spend their valuable time helping out and the best way to show gratitude is by assigning points.
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2006 04:35 PM
тАО10-02-2006 04:35 PM
Re: getting the command line argument in HPUX 11.11
Hi All,
The error i am facing is compile time error and not runtime error.Is PSTAT_GETCOMMANDLINE is a pre-defined variable in HPUX or need to include any header file.I want to know whether PSTAT_GETCOMMANDLINE has been introduced newly in HPUX 11.11..since i am compiling on HPUX 11.0 box. The compiler i am using is C++ compiler and version is HPUX 11.0..
Thank u all
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2006 07:00 PM
тАО10-02-2006 07:00 PM
Re: getting the command line argument in HPUX 11.11
I have compiled your code, as is, on my 11.11 box without problems using gcc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2006 07:41 AM
тАО10-03-2006 07:41 AM
Re: getting the command line argument in HPUX 11.11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2006 07:53 AM
тАО10-03-2006 07:53 AM
Re: getting the command line argument in HPUX 11.11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2006 07:57 PM
тАО10-03-2006 07:57 PM
Re: getting the command line argument in HPUX 11.11
It'll work on 11.0 with some modifications. The PSTAT_GETCOMMANDLINE variable is undefined since
#include
#define MAX_LENGTH (1024)
main (argc, argv) int argc; char *argv[]; {
int pid, PSTAT_GETCOMMANDLINE = 34;
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2006 05:14 PM
тАО10-04-2006 05:14 PM
Re: getting the command line argument in HPUX 11.11
Hi sandman ,
I was able to compile successfully in HPUX 11.0
box.Thank u all for all ur help and support.
thanks
raju