This call returns the current process ID, thread ID, and the process ID of the parent process.
DosGetPID
ProcessIDs (PPIDINFO) - output
pid (PID)
The process ID may be used to generate uniquely named temporary files, or for communication with signals. For more information on signals, see DosFlagProcess and DosSendSignal.
In the OS/2 environment, thread IDs are used with calls that manipulate threads in the current process. For more information, see DosSuspendThread, DosResumeThread, DosGetPrty, and DosSetPrty.
If the application is executing in the OS/2 environment, it is more efficient to obtain these variables by calling DosGetInfoSeg instead of DosGetPID. However, applications written to the family API cannot depend on the availability of DosGetInfoSeg.
To get an ID for a process other than the current process or its parent process, issue DosGetPPID.