Make all bucket and overflow addresses unsigned
[unix-history] / usr / src / lib / libc / stdlib / atexit.3
CommitLineData
cd1a8d59
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
6.\"
7.\" %sccs.include.redist.man%
8.\"
9.\" @(#)atexit.3 5.1 (Berkeley) %G%
10.\"
11.TH ATEXIT 3 ""
12.UC 7
13.SH NAME
14atexit \- register a function to be called on exit
15.SH SYNOPSIS
16.B #include <stdlib.h>
17.PP
18.B "atexit(void (*function)())
19.SH DESCRIPTION
20.B Atexit
21registers the given
22.I function
23to be called at program exit, whether via
24.IR exit (3)
25or via return from the program's
26.BR main .
27Functions so registered are called in reverse order;
28no arguments are passed.
29At least 32 functions can always be registered,
30and more are allowed as long as sufficient memory can be allocated.
31.SH RETURN VALUE
32.B Atexit
33returns 0 on success, \-1 on error.
34.SH ERRORS
35.TP
36[ENOMEM]
37No memory was available to add the function to the list.
38The existing list of functions is unmodified.
39.SH SEE ALSO
40exit(3)
41.SH STANDARDS
42.B Atexit
43conforms to ANSI X3.159-1989 (``ANSI C'').