processor_info man page on DigitalUNIX

Printed from

processor_info(3)					     processor_info(3)

       processor_info - determine type and status of a processor

       #include <sys/type.h> #include <sys/processor.h>

       int processor_info(
		processorid_t processorid,
		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
       to /usr/opt/svr4.

       Success.	 Failure.

       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>

	main() {
	       int x;
	       processor_info_t buffer;

	       x = processor_info(0, buffer);
	       if(x < 0)
	       else {
		   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);
	       exit(0); }

       Commands: pinfo(1m), psrinfo(1m)


List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net