processor_info(3)processor_info(3)NAMEprocessor_info - determine type and status of a processor
#include <sys/type.h> #include <sys/processor.h>
processor_info_t *infop );
SVR4 Library (libsvr4)
The type for processor name or CPU number. Returns information about
the CPU. Data structure fields consist of P_ONLINE or P_OFFLINE, ASCII
CPU types, ASCII FPU types and CPU clock frequency in MHz.
The processor_info() function obtains information about a single pro‐
cessor in the system. The information is returned in the proces‐
sor_info_t structure pointed to by infop. The structure contains the
following fields: Either P_ONLINE or P_OFFLINE. If the processor is
offline, the other fields are meaningless. A null terminated ASCII
string specifying the type of processor. A null terminated ASCII
string specifying the type of floating point hardware available. The
string contains zero or more floating point identifier strings, sepa‐
rated by commas. The frequency of the processor clock, in megahertz,
rounded to the nearest integer.
Some of the files that are referenced by absolute path in the System V
Environment for Tru64 UNIX man pages may actually be located relative
Failure may result from: The infop pointer points to an invalid memory
address. The processorid does not refer to an existing processor.
To get the processor info of processor #0.
#include <stdio.h> #include <errno.h> #include <processor.h>
x = processor_info(0, buffer);
if(x < 0)
printf("processor_info returned %d\n",x);
printf("State is %d\n", buffer.pi_state);
printf("CPU type is %s\n", buffer.pi_processor_type);
printf("FPU type is %s\n", buffer.pi_fputypes);
printf("Freq. is %d\n", buffer.pi_clock);
Commands: pinfo(1m), psrinfo(1m)processor_info(3)