cpuinfo with nlist

cpuinfo with nlist

Post by bb.. » Wed, 09 Jun 1999 04:00:00

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");

        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");

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


1. using nlist(), not nlist64(), in SunOS5.7_64-bit ... can it be done ???

Hi all,

I hope someone on this list or from Sun might be able to shed some light
on this problem.

We are trying to run a 32-bit app that runs on Solaris 7 (booted in
32-bit mode) on the same box booted in 64-bit mode.  It turns out that
all calls to nlist() are failing  (for kernel symbols like "sema",
"seminfo", "msginfo", "ncpu", etc...).

We would like to keep one binary that would support both platforms, is
there a way to compile the application in a 32-bit environment so that
it will work on a 64-bit OS ? (i.e. Is there a define(s) that will tell
the compiler to use the "wide" mode when calling specific system calls.
For instance, HP uses _PSTAT64 for this and others.)

Thanks in advance for any assistance,

2. display x-windows on a win98 machine

3. Kernel nlist entries

4. Using an old AIX box for firewall

5. nlist() ?

6. 8250_cs does not work.

7. top : nlist failed

8. Linux help site

9. Berkley nlist(3) equivalent in SVR4

10. Equiv. of SunOS nlist?

11. nlist() always returns -1 but errno=0 on Solaris7&8

12. nlist() in Linux???

13. Help with nlist(), XCOFF, and memory architecture...