OS/2 Process and Thread API Differences
These APIs are included in your application by including the following
definition in your application source file.
#define INCL_DOSPROCESS
OS/2 Process API Differences
The following describes the implementation differences between the OS2Linux
library and the real OS/2 process manipulation APIs.
DosExecPgm
APIRET APIENTRY DosExecPgm(PCHAR pObjname, LONG cbObjname, ULONG execFlag,
PSZ pArg, PSZ pEnv, PRESULTCODES pRes, PSZ pName);
- The pEnv argument must be NULL.
- The execFlag argument can only be EXEC_SYNC and EXEC_ASYNC.
DosWaitChild
APIRET APIENTRY DosWaitChild(ULONG action, ULONG option, PRESULTCODES pres,
PPID ppid, PID pid);
- An argument action value of DCWA_PROCESSTREE is not supported.
DosKillProcess
APIRET APIENTRY DosKillProcess(ULONG action, PID pid);
- All non-zero values for action have been poisoned.
- All possible OS/2 return codes are not used.
- ERROR_INVALID_PARAMETER return code has been added.
- ERROR_ACCESS_DENIED return code has been added.
DosExitList
APIRET APIENTRY DosExitList(ULONG ordercode, PFNEXITLIST pfn);
- All exit functions recieve the TC_EXIT code as the only argument.
OS/2 Thread API Differences
_beginthread
unsigned long _beginthread(void(*start_address )( void * ),
unsigned stack_size, void *arglist);
- You may have to remove the __cdecl definition from the thread function
definitions in your source code files.
_endthread
void _endthread(void);
DosCreateThread
APIRET APIENTRY DosCreateThread(PTID ptid, PFNTHREAD pfn, ULONG param,
ULONG flag, ULONG cbStack);
- All non-zero values for the argument flag have been poisoned.
- All possible OS/2 return codes are not used.
- ERROR_INVALID_PARAMETER return code has been added.
DosResumeThread
APIRET APIENTRY DosResumeThread(TID tid);
- All possible OS/2 return codes are not used.
DosSuspendThread
APIRET APIENTRY DosSuspendThread(TID tid);
DosKillThread
APIRET APIENTRY DosKillThread(TID tid);
- All possible OS/2 return codes are not used.
DosAllocThreadLocalMemory
APIRET APIENTRY DosAllocThreadLocalMemory(ULONG cb, PULONG *p);
- We actually will allow more total bytes to be allocated.
DosFreeThreadLocalMemory
APIRET APIENTRY DosFreeThreadLocalMemory(ULONG *p);
DosWaitThread
APIRET APIENTRY DosWaitThread(PTID ptid, ULONG option);
- A TID of zero is not allowed (wait for next thread to end).
DosBeep
APIRET APIENTRY DosBeep(ULONG freq, ULONG dur);
- This function ignores all the input arguments and instead rings
the machine bell using the ASCII BEL character by sending that character to
the stderr file handle.
DosSleep
APIRET APIENTRY DosSleep(ULONG msec);
DosEnterCritSec
APIRET APIENTRY DosEnterCritSec(VOID);
- All possible OS/2 return codes are not used.
DosExitCritSec
APIRET APIENTRY DosExitCritSec(VOID);
- All possible OS/2 return codes are not used.
DosSetPriority
APIRET APIENTRY DosSetPriority(ULONG scope, ULONG ulClass, LONG delta,
ULONG PorTid);
- This function only supports thread priority modification.
- This function sets absolute values for the priority, not a range value.
DosGetInfoBlocks
APIRET APIENTRY DosGetInfoBlocks(PTIB *pptib, PPIB *pppib);
- The PIB is not completely filled out. See the source code.
- The TIB is not completely filled out. See the source code.