Wait for process in trap.