|
|
@ -29,30 +29,25 @@ |
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
|
.\" SUCH DAMAGE. |
|
|
|
.\" |
|
|
|
.\" $OpenBSD: exit.3,v 1.13 2013/06/05 03:39:23 tedu Exp $ |
|
|
|
.\" $OpenBSD: exit.3,v 1.14 2013/06/05 04:06:08 guenther Exp $ |
|
|
|
.\" |
|
|
|
.Dd $Mdocdate: June 5 2013 $ |
|
|
|
.Dt EXIT 3 |
|
|
|
.Os |
|
|
|
.Sh NAME |
|
|
|
.Nm exit, _Exit |
|
|
|
.Nm exit |
|
|
|
.Nd perform normal program termination |
|
|
|
.Sh SYNOPSIS |
|
|
|
.In stdlib.h |
|
|
|
.Ft void |
|
|
|
.Fn exit "int status" |
|
|
|
.Ft void |
|
|
|
.Fn _Exit "int status" |
|
|
|
.Sh DESCRIPTION |
|
|
|
The |
|
|
|
.Fn exit |
|
|
|
and |
|
|
|
.Fn _Exit |
|
|
|
functions terminate a process. |
|
|
|
function terminates a process. |
|
|
|
.Pp |
|
|
|
Before termination, |
|
|
|
.Fn exit |
|
|
|
performs the following operations in the order listed: |
|
|
|
Before termination it performs the following functions in the |
|
|
|
order listed: |
|
|
|
.Bl -enum -offset indent |
|
|
|
.It |
|
|
|
Call the functions registered with the |
|
|
@ -68,25 +63,9 @@ Unlink all files created with the |
|
|
|
function. |
|
|
|
.El |
|
|
|
.Pp |
|
|
|
The |
|
|
|
.Fn _Exit |
|
|
|
function terminates without calling the functions registered with the |
|
|
|
.Xr atexit 3 |
|
|
|
function. |
|
|
|
The |
|
|
|
.Ox |
|
|
|
implementation of |
|
|
|
.Fn _Exit |
|
|
|
does not flush open output streams or unlink files created with the |
|
|
|
.Xr tmpfile 3 |
|
|
|
function. |
|
|
|
However, this behavior is implementation-specific. |
|
|
|
.Pp |
|
|
|
Lastly, |
|
|
|
Following this, |
|
|
|
.Fn exit |
|
|
|
and |
|
|
|
.Fn _Exit |
|
|
|
call |
|
|
|
calls |
|
|
|
.Xr _exit 2 . |
|
|
|
Note that typically |
|
|
|
.Xr _exit 2 |
|
|
@ -96,9 +75,7 @@ on to the parent, thus negative values have less meaning. |
|
|
|
.Sh RETURN VALUES |
|
|
|
The |
|
|
|
.Fn exit |
|
|
|
and |
|
|
|
.Fn _Exit |
|
|
|
functions never return. |
|
|
|
function never returns. |
|
|
|
.Sh SEE ALSO |
|
|
|
.Xr _exit 2 , |
|
|
|
.Xr atexit 3 , |
|
|
@ -108,9 +85,7 @@ functions never return. |
|
|
|
.Sh STANDARDS |
|
|
|
The |
|
|
|
.Fn exit |
|
|
|
and |
|
|
|
.Fn _Exit |
|
|
|
functions conform to |
|
|
|
function conforms to |
|
|
|
.St -ansiC-99 . |
|
|
|
.Sh HISTORY |
|
|
|
An |
|
|
|