F$Wait

From NitrOS-9
Jump to: navigation, search
Wait Temporarily turns off a calling process
OS9 F$Wait 103F 04

Entry Conditions

None

Exit Conditions

A deceased child process’s ID

B deceased child process’s exist status (if no error)

Error Output

CC carry set on error

B error code, if any

Additional Information

  • The Wait call turns off the calling process until a child process dies, either by exiting an Exit system call, or by receiving a signal. The Wait call helps you save system time.
  • NitrOS-9 returns the child’s process ID and exit status to the parent. If the child died because of a signal, the exit status byte (Register B) contains the signal code.
  • If the caller has several children, NitrOS-9 activates the caller when the first one dies. Therefore, you need to use one Wait system call to detect the termination of each child.
  • NitrOS-9 immediately reactivates the caller if a child dies before the Wait call. If the caller has no children, Wait returns an error. (See the Exit system call for more information.)
  • If the Wait call returns with the carry bit set, the Wait function was not successful. If the carry bit is cleared, Wait functioned normally and any error that occurred in the child process is returned in Register B.

krnp2