From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,8d97c418b87f573 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-05-13 05:03:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!nntp.abs.net!uunet!dca.uu.net!news.compaq.com!cacnews.cac.cpqcorp.net!53ab2750!not-for-mail Newsgroups: comp.unix.tru64 Subject: Re: How I get cpu total number References: From: duane@hunch.zk3.dec.com (Andrew Duane USG) Message-ID: Date: Mon, 13 May 2002 12:08:25 GMT NNTP-Posting-Host: 16.141.0.43 X-Complaints-To: abuse@Compaq.com X-Trace: cacnews.cac.cpqcorp.net 1021291705 16.141.0.43 (Mon, 13 May 2002 05:08:25 PDT) NNTP-Posting-Date: Mon, 13 May 2002 05:08:25 PDT Organization: Hewlett-Packard Co. Xref: archiver1.google.com comp.unix.tru64:7639 In article "Atom" 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 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