Places the current thread into a wait state until an asynchronous child process ends. When the process ends, its process identifier, termination code, and result code are returned to the caller.
#define INCL_DOSPROCESS
#include <os2.h>
ULONG action; /* An indicator that specifies which process the current thread is waiting to terminate. */
ULONG option; /* An indicator that specifies whether to return if no child process ends. */
PRESULTCODES pres; /* Address of the structure that contains the termination code and the result code indicating the reason for the child's termination. */
PPID ppid; /* Address of the process identifier of the ending process. */
PID pid; /* Identifier of the process whose termination is being waited for. */
APIRET ulrc; /* Return Code. */
ulrc = DosWaitChild(action, option, pres,
ppid, pid);