Purpose
DosGetProcessorStatus returns the ONLINE or OFFLINE status of each processor of an SMP system. The processor status may be set using DosSetProcessorStatus. ONLINE status imples the processor is available for running work. OFFLINE status implies the porcessor is not available for running work.
Syntax
#define INCL_DOS #define INCL_DOSSPINLOCK #include os2.h>
APIRET APRIENTRY DosGetProcessorStatus
Parameters
procid (ULONG) input
PROC_OFFLINE 0x00000000
Returns
ulrc (APIRET) returns
DosGetProcessorStatus returns one of the following values
87
Related Functions
Example Code
int main(int argc, char *argv[], char *envp[]){ APIRET rc=0; ULONG procid; ULONG status; int i; if (argc == 1) { for (procid=1; rc==0 ;++procid) { rc = DosGetProcessorStatus(procid, status); if (rc==0) { if (status == PROC_OFFLINE) printf("Processor %u offline\n", procid); else printf("Processor %u online\n", procid); } /* endif */ } /* endfor */ } else for (i=1; i argc ; ++i) { procid = atol(argv[i]); rc = DosGetProcessorStatus(procid, status); if (rc) printf("DosGetProcesorStatus returned %u\n",rc); else { if (status == PROC_OFFLINE) printf("Processor %u offline\n", procid); else printf("Processor %u online\n", procid); } /* endif */ } /* endfor */ return rc; }