Terminates a process.
Standard C Library (libc.a)
#include <stdlib.h>
void exit ( Status)
int Status;
void _exit ( Status)
int Status;
void _Exit (Status) int Status;
#include <sys/limits.h>
int atexit ( Function)
void (*Function) (void);
The exit subroutine terminates the calling process after calling the standard I/O library _cleanup function to flush any buffered output. Also, it calls any functions registered previously for the process by the atexit subroutine. The atexit subroutine registers functions called at normal process termination for cleanup processing. Normal termination occurs as a result of either a call to the exit subroutine or a return statement in the main function.
Each function a call to the atexit subroutine registers must return. This action ensures that all registered functions are called.
Finally, the exit subroutine calls the _exit subroutine, which completes process termination and does not return. The _exit subroutine terminates the calling process and causes the following to occur:
The _Exit subroutine is functionally equivalent to the _exit subroutine. The _Exit subroutine does not call functions registered with atexit or any registered signal handlers. The way the subroutine is implemented determines whether open streams are flushed or closed, and whether temporary files are removed. The calling process is terminated with the consequences described below.
The _Exit subroutine may block awaiting such I/O completion. The implementation defines whether any I/O is canceled, and which I/O may be canceled upon _Exit.
Upon successful completion, the atexit subroutine returns a value of 0. Otherwise, a nonzero value is returned. The exit and _exit subroutines do not return a value.
acct Subroutine, lockfx, lockf, flock, or lockf64 Subroutine, lockfx, lockf, flock, or lockf64 Subroutine, lockfx, lockf, flock, or lockf64 Subroutine, and getrusage, getrusage64, times, or vtimes Subroutine.
longjmp Subroutine, semop Subroutine, shmget Subroutine, sigaction, sigvec, or signal Subroutine, and wait, waitpid, or wait3 Subroutine in AIX 5L Version 5.2 Technical Reference: Base Operating System and Extensions Volume 2.
Asynchronous I/O Overview in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.
unistd.h in AIX 5L Version 5.2 Files Reference.