COHERENT manpages

This page displays the COHERENT manpage for _exit() [Terminate a program].

List of available manpages
Index


_exit() -- System Call (libc)

Terminate a program
#include <unistd.h>
void _exit(status) int status;

The system  call _exit() terminates a program  directly.  It returns status
to the  calling program,  and exits.   Unlike the library  function exit(),
_exit()  does  not  perform extra  termination  cleanup,  such as  flushing
buffered files and closing open files.

_exit() should  be used only  in situations where  you do not  want buffers
flushed or files closed.  For example, you may wish to call _exit() if your
program detects an irreparable error condition and you want to ``bail out''
to keep your data files from being corrupted.

_exit() should  also be used with  programs that do not  use STDIO.  Unlike
exit(), _exit()  does not  use STDIO.  This  will help you  create programs
that are extremely small when compiled.

See Also

close(),
exit(),
EXIT_FAILURE,
EXIT_SUCCESS,
libc,
unistd.h,
wait()
POSIX Standard, §3.2.2

Notes

If  you do  not  explicitly set  status  to a  value,  the program  returns
whatever  value happens  to have  been in  the register  EAX.  You  can set
status to either EXIT_SUCCESS or EXIT_FAILURE.