This is a discussion on nlist() is not working!! within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> My environment : # uname -a HP-UX hp B.11.11 U 9000/785 2001212688 unlimited-user license # gcc -v Reading specs ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| My environment : # uname -a HP-UX hp B.11.11 U 9000/785 2001212688 unlimited-user license # gcc -v Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux11.00/3.2/specs Configured with: .../gcc/configure --enable-languages=c,c++ --host=hppa1.1-hp-hpux11.00 --targ et=hppa1.1-hp-hpux11.00 --with-g Thread model: single gcc version 3.2 20020708 (experimental) I wrote a simple program using the function nlist(). But, I can't get the return value 0. This is code. #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <netdb.h> #include <nlist.h> #include <stdlib.h> #include <nlist.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/protosw.h> #include <sys/ioctl.h> #include <sys/mbuf.h> #include <net/route.h> #include <net/if.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/tcp.h> struct nlist nlst[] = { { "_tcb" }, { "_tcp_debug" }, { "_tcp_debx" }, { "_mbstat" }, { "_tcpstat" }, {0} }; int main(argc, argv) int argc; char *argv[]; { int kmem; int rNlist = 0; if ( (rNlist = nlist("/stand/vmunix", nlst)) < 0 ) { printf( "Return value of nlist() is %d.\n", rNlist ); } if( (kmem = open("/dev/kmem", 0)) < 0) { perror("/dev/kmem"); exit(1); } close( kmem ); return 0; } Here is error? Thanks in advance!! |