basic.%wait

C Function/BASIC Program, Releases: AP/Unix

Waits for termination of child process.

Syntax

variable=%wait( &status)

Description

returns the exit code of the child process(es) created by the current process.
The 'status' is returned in the integer 'status', passed by its address.
Note that even though 'status' is an integer, only the lower 16 bits are updated by the system call. See the Unix Programmer's Reference Manual for more details on the format of the returned status.

Example

status=0
(void)%wait( &status )
high$status=int(status/256)
low$status=mod(status,256)
begin case
case low$status=255
* Child stopped due to a signal
case low$status=0
* Child stopped by calling exit()
case high$status=0
* Child was terminated due to a signal
end case

See Also

Command Name Type Description
basic.cfunc Definition can be called from a Pick/BASIC program or subroutine in AP/DOS and AP/Unix implementations using a syntax similar to that of normal C.
basic.cfunction Definition Declare a list of C functions.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.