manual page distributed with 4.1BSD
[unix-history] / usr / src / lib / libc / sys / _exit.2
.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)_exit.2 4.1 (Berkeley) %G%
.\"
.TH EXIT 2
.UC 4
.SH NAME
exit \- terminate process
.SH SYNOPSIS
.nf
.B exit(status)
.B int status;
.PP
.B _exit(status)
.B int status;
.fi
.SH DESCRIPTION
.I Exit
is the normal means of terminating a process.
.I Exit
closes all the process's files and notifies the parent process
if it is executing a
.IR wait .
The low-order 8 bits of
.I status
are available to the parent process.
.PP
This call can never return.
.PP
The C function
.I exit
may cause cleanup actions before the
final `sys exit'.
The function
.I _exit
circumvents all cleanup, and should be used to terminate a child
process after a
.IR fork (2)
or
.IR vfork (2)
to avoid flushing buffered output twice.
.SH "SEE ALSO"
fork(2), vfork(2), wait(2)
.SH "ASSEMBLER (PDP-11)"
(exit = 1.)
.br
(status in r0)
.br
.B sys exit