EXIT(3C) COMMAND REFERENCE EXIT(3C)
NAME
exit - terminate a process
SYNOPSIS
exit(status)
int status;
extern int lasterr
DESCRIPTION
Exit terminates a process with the following consequences:
All of the descriptors open in the calling process are
closed.
If the parent process of the calling process is executing a
wait or is interested in the SIGCHLD signal, then it is
notified of the calling process's termination and the low-
order eight bits of status are made available to it; see
wait(2). The low-order eight bits of status are available to
the parent process.
If the status given to exit is 0 or the status is not given,
the status is replaced by the value of the last warning code
given to the subroutine ERROR(3c). The value of this warning
code is stored in the variable _last_err, and may be set by
user programs in cases where ERROR cannot be used.
The parent process ID of all of the calling process's
existing child processes is also set to 1. This means that
the initialization process (see intro(2)) inherits each of
these processes as well.
RETURN VALUE
This call never returns.
CAVEATS
Programs that "fall off the end" (for example, do not
explicitly call exit and do not explicitly return with a
value) do not exit with any useful value. In this cases,
any exit code may result.
Calling exit with no parameters causes the same action as
calling exit with a value of 0.
SEE ALSO
fork(2), wait(2), exit(2), ERROR(3c).
Printed 10/17/86 1
%%index%%
na:72,62;
sy:134,360;
de:494,1323;
rv:1817,110;
ca:1927,439;
se:2366,143;
%%index%%000000000107