I am trying get cpu information using nlist().
The symbol for n_name I am using is "get_cpuinfo".
Is this a symbol incorrect? Does Linux allow the user to user nlist?
Is there another way that I can get cpu information from the system.
int kmem; /*open*/
struct nlist nl[] = {
{ "get_cpuinfo",0,0,0,0,0 },
{ NULL,0,0,0,0,0 }
};
if( (kmem=open("/dev/kmem", O_RDONLY) ) < 0 ) {
fprintf(stderr,"error opening /dev/kmem");
exit(1);
}
if((nlist("/boot/vmlinux-2.2.5-15",nl)<0) ||
(nl[0].n_type == 0)) {
fprintf(stderr,"/boot/vmlinux-2.2.5-15: no namelist\n");
exit(1);
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.