This will switch to the parent session if a child terminates. The argument seems to be passed in the register CX.
APIRET16 Pascal far DOSSMPARENTSWITCH(CX)
APIRET16 Pascal far