EXIT(2) DOMAIN/IX SYS5 EXIT(2)
NAME
exit, _exit - terminate process
USAGE
void exit(status)
int status;
void _exit(status)
int status;
DESCRIPTION
Exit terminates the process that called it, with the follow-
ing consequences:
⊕ All of the file descriptors open in the calling process
are closed.
⊕ If the parent process of the calling process is executing
a wait, it is notified of the calling process's termina-
tion and the low order eight bits (i.e., bits 0377) of
status are made available to it; see wait(2).
⊕ If the parent process of the calling process is not exe-
cuting a wait, the calling process is transformed into a
"pseudo-process" that only occupies a slot in the process
table. The process has no other space allocated either
in user or kernel space.
⊕ The parent process ID of all of the calling process's
existing children and pseudo-processes is set to 1, which
means that these processes effectively become orphans.
⊕ Each attached shared memory segment is detached and the
value of shm_nattach in the data structure associated
with its shared memory identifier is decreased by 1.
⊕ For each semaphore for which the calling process has set
a semadj value (see semop(2)), that semadj value is added
to the semval of the specified semaphore.
⊕ If the process has a process, text, or data lock, an
unlock is performed (see plock(2)).
⊕ If the process IDs, tty group IDs, and process group ID
of the calling process are equal, the SIGHUP signal is
sent to each process that has a process group ID equal to
that of the calling process.
Printed 12/4/86 EXIT-1
EXIT(2) DOMAIN/IX SYS5 EXIT(2)
The C function exit may cause cleanup actions before the
process exits. The function _exit circumvents all cleanup.
RELATED INFORMATION
plock(2), semop(2), signal(2), wait(2)
EXIT-2 Printed 12/4/86