- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: pstat_getcommandline() link error ??
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
тАО12-15-2004 12:03 PM - last edited on тАО03-29-2013 12:44 AM by Cathy_xu
тАО12-15-2004 12:03 PM - last edited on тАО03-29-2013 12:44 AM by Cathy_xu
pstat_getcommandline() link error ??
Hello.
I'm a begginer on HP-UX's C programmings
and environment.
I wrote a program(bsntest.c) as below:
include <STDIO.H>
#include
#include <UNISTD.H>
main(){
char buf[1024+1];
int pid;
pid = (int) getpid();
puts("use pstat_commandline()");
pstat_getcommandline(buf,1024,1,pid);
printf("command line : %s", buf);
}
when I did "cc bsntest.c",
then the error messages displayed as bellow:
$ cc bsntest.c
/usr/ccs/bin/ld: Unsatisfied symbols:
pstat_getcommandline (first referenced in bsntest.o) (code)
I guess that something is wrong to link,
but I can't understand the details of ld at now.(ofcource, I read ld's man page..)
Please tell me how to solve this problem.
regards,
Takanobu Maekawa
Moved from HP-UX Technical Documentation to HP-UX > languages
- Tags:
- pstat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2004 01:25 PM
тАО12-15-2004 01:25 PM
Re: pstat_getcommandline() link error ??
#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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2004 02:26 PM
тАО12-15-2004 02:26 PM
Re: pstat_getcommandline() link error ??
the probrem has removed!
regards,
Takanobu Maekawa