Purpose
DosSetThreadAffinity allows the calling thread to change the processor affinity mask for the current thread.
Syntax
APIRET DosSetThreadAffinity
Parameters
pAffinityMask (PMPAffinity) input
Returns
ulrc APIRET) returns
DosSetThreadAffinity returns one of the following values
13
Remarks
The processor affinity mask contains 1 bit per processor. A maximum of 64 processors can be designated. If affinity bits are on for non-existent processors, the error ERROR_INVALID_DATA will be returned.
Related Functions
Example Code
#define INCL_DOS#define INCL_32 #define INCL_DOSERRORS #define INCL_NOPMAPI #include os2.h> #include stdio.h> int main(void) { APIRET rc; MPAFFINITY affinity; rc = DosSetThreadAffinity( affinity); printf("Set thread's affinity rc = %08.8xh\n", rc); printf("Set thread's affinity affinity[0] = %08.8xh, affinity[1] = %08.8xh\n", affinity.mask[0], affinity.mask[1]); return rc; }