Purpose
DosSetProcessorStatus sets the ONLINE or OFFLINE status of a processor on an SMP system. The processor status may be queried using DosGetProcessorStatus. ONLINE status implies the processor is available for running work. OFFLINE status implies the processor is not available for running work. The processor that executes DosSetProcessorStatus must be ONLINE.
Syntax
#define INCL_DOS #define INCL_DOSSPINLOCK #include os2.h>
APIRET DosSetProcessorStatus
Parameters
procid (ULONG) input
PROC_OFFLINE 0x00000000
Returns
ulrc (APIRET) returns
DosSetProcessorStatus returns one of the following values
87
Related Functions
Example Code
int main(int argc, char *argv[], char *envp[]){ APIRET rc; ULONG procid; ULONG status; int i; if (argc 3) { printf("Syntax SETPROC ON|OFF\n"); return 0; } /* endif */ if (strcmpi(argv[argc-1],"OFF")==0) status = 0; else if (strcmpi(argv[argc-1],"ON")==0) status = 1; else { printf("Syntax SETPROC ON|OFF\n"); return 0; } /* endif */ for (i=1; i argc-1; ++i ) { procid = atol(argv[i]); rc = DosSetProcessorStatus(procid, status); if (rc) printf("DosSetProcesorStatus returned %u\n",rc); } /* endfor */ return rc; }