'\"macro stdmacro
.if n .pH g3c.atexit @(#)atexit	40.9 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} atexit 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} atexit 3C "C Programming Language Utilities"
.if \nX=2 .ds x} atexit 3C "" "\&"
.if \nX=3 .ds x} atexit "" "" "\&"
.TH \*(x}
.SH NAME
\f4atexit\f1 \- add program termination routine
.SH SYNOPSIS
\f4\#include <stdlib.h>\f1
.PP
\f4int atexit (void (\(**func)(void)\|);\f1
.PP
.SH DESCRIPTION
.PP
\f4atexit\fP adds the function \f2func\f1 to a list of functions to
be called without arguments on normal termination of the program.
Normal termination occurs by either a call to the \f4exit\fP 
system call or a return
from \f4main\fP.
At most 32 functions may be registered by \f4atexit\fP; the functions
will be called in the reverse order of their registration.
.PP
\f4atexit\fP returns 0 if the registration succeeds, nonzero if it fails.
.SH "SEE ALSO"
\f4exit\fP(2).
.\"	@(#)atexit.3c	
.Ee
