Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!oha!access!edm!geoff From: geoff@edm.uucp (Geoff Coleman) Newsgroups: comp.unix.aix Subject: Is the following a bug in knlist() ??? Message-ID: <1990Nov8.231920.3656@edm.uucp> Date: 8 Nov 90 23:19:20 GMT Organization: Unexsys Systems inc. Lines: 54 Help I need to know if the following is considered a bug or not. Given the following code which uses knlist() to poke into the live kernel and find the location of a couple of variables. If compiled with cc -DGOOD test1.c it will return a value of 0 from knlist and 0 in errno. If compiled with cc test1.c it will return a value of-1 from knlist and errno will be zero because swplo does not exist in the aix kernel. This goes against the documentation for knlist() in the manuals. Geoff Coleman Unexsys Systems ____________________________ test1.c _________________________________ #include #include #include /* need this for name list function */ struct nlist name_list[4]; /* define an array of nlist structs */ int i; main(){ for(i=0;i<3;i++){ name_list[i].n_value = 0; name_list[i].n_scnum = 0; name_list[i].n_type = 0; name_list[i].n_sclass = NULL; name_list[i].n_numaux = NULL; } name_list[0].n_name = "proc"; #ifdef GOOD name_list[1].n_name = "v"; name_list[2].n_name = "swplo"; #else name_list[1].n_name = "swplo"; name_list[2].n_name = "v"; #endif name_list[3].n_name = NULL; fprintf(stderr,"return from knlist = %d\n", knlist(name_list,2,sizeof(struct nlist))); fprintf(stderr," errno = %d\n",errno); }