From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079034715551.tru64-unix-managers.marc@archive.invalid> From: Paul Tyler Date: Wed, 13 Jan 1999 03:30:27 +0000 To: tru64-unix-managers Subject: pinfo/psrinfo from within C X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079034715551 Sorry about this. I know it isn't directly about system admin but hopefully someone can help. I've been trying to write some C code to determine the CPU version. (As pinfo -v does.) Using a getsysinfo system call I can get a number which seems to be different for different CPU types but which doesn't relate to the values in /usr/include/machine/hal/cpuconf.h. Does anyone know what the return codes should be? I get a type of 56 for an EV5.6 (21164A) and 37 for a EV4 (21064). The include file indicates these should be 7 and 2 respectively. Any insight would be appreciated. The C code follows: #include #include #include #include #include int main(int argc,char *argv[]) { int status=0; struct cpu_info buf; int st=0; status = getsysinfo(GSI_CPU_INFO, &buf, sizeof(buf), st, NULL,NULL); printf("status = 0, start = %d\n",st); printf("\tcpu type = %d\n",buf.cpu_type); printf("\tno cpus = %d\n",buf.ncpus); } Thanks Paul Tyler -- Paul Tyler | Phone. +61 2 9717 3576 | DISCLAIMER: The views expressed in ANSTO | Fax. +61 2 9717 3257 | this E-mail message do not PMB 1 MENAI 2234 | Email. pct@ansto.gov.au | necessarily represent the official AUSTRALIA | | views of ANSTO