.TH _exit() "" "" "System Call (libc)"
.PC "Terminate a program"
.B "#include <unistd.h>"
\fBvoid _exit(\fIstatus\^\fB) int \fIstatus\^\fB;\fR
.PP
The system call
.B _exit()
terminates a program directly.
It returns \fIstatus\fR to the calling program, and exits.
Unlike the library function
.BR exit() ,
.B _exit()
does not perform extra termination cleanup, such as flushing buffered files
and closing open files.
.PP
.B _exit()
should be used only in situations where you do
.I not
want buffers flushed or files closed.
For example, you may wish to call
.B _exit()
if your program detects an irreparable
error condition and you want to \*(QLbail out\*(QR to keep your data
files from being corrupted.
.PP
.B _exit()
should also be used with programs that do not use STDIO.
Unlike
.BR exit() ,
.B _exit()
does not use STDIO.
This will help you create programs that are extremely small when compiled.
.SH "See Also"
.Xr "close()," close
.Xr "exit()," exit.s
.Xr "EXIT_FAILURE," exit_fail
.Xr "EXIT_SUCCESS," exit_succ
.Xr "libc," libc
.Xr "unistd.h," unistd.h
.Xr "wait()" wait.s
.br
\*(PX Standard, \(sc3.2.2
.SH Notes
If you do not explicitly set
.I status
to a value,
the program returns whatever value happens to have been in the register EAX.
You can set
.I status
to either
.B EXIT_SUCCESS
or
.BR EXIT_FAILURE .
