Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* How I get cpu total number
@ 2002-05-11  2:21 Atom
  2002-05-13 12:08 ` Andrew Duane USG
  0 siblings, 1 reply; 2+ messages in thread
From: Atom @ 2002-05-11  2:21 UTC (permalink / raw)


First, sorry for my poor English.

How I get cpu total number and online cpu number by table() system call on
tru64..

Thanks in advance...




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How I get cpu total number
  2002-05-11  2:21 How I get cpu total number Atom
@ 2002-05-13 12:08 ` Andrew Duane USG
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Duane USG @ 2002-05-13 12:08 UTC (permalink / raw)


In article <abhu8a$j0o$1@news1.kornet.net> "Atom" <aiguru@linux.co.kr> writes:
>How I get cpu total number and online cpu number by table() system call on
>tru64..

Table() isn't what you want; getsysinfo() is. From the getsysinfo man page:

  GSI_CPUS_IN_BOX
      Returns the actual number of CPUs present in the current machine in the
      form of an int.

      buffer
          int

      nbytes
          Specifies the size of the user buffer.

My code snippet:

#include <sys/sysinfo.h>

        int ncpus;
        getsysinfo(GSI_CPUS_IN_BOX, (char *)&ncpus, sizeof(ncpus), 0L, 0L, 0L);
        printf ("There are %d CPUs in this box\n", ncpus);

--

Andrew L. Duane (JOT-7)			duane@zk3.dec.com
Compaq Computer Corporation		(603)-884-1294
110 Spit Brook Road
M/S ZKO3-3/U14
Nashua, NH    03062-2698



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-13 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-11  2:21 How I get cpu total number Atom
2002-05-13 12:08 ` Andrew Duane USG

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox