]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/on_exit.3
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man3 / on_exit.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
c13182ef 11.\"
fea681da
MK
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
c13182ef 19.\"
fea681da
MK
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
23.\" References consulted:
24.\" Linux libc source code
25.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26.\" 386BSD man pages
27.\" Modified 1993-04-02, David Metcalfe
28.\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu)
29.TH ON_EXIT 3 1993-04-02 "GNU" "Linux Programmer's Manual"
30.SH NAME
027df6e0 31on_exit \- register a function to be called at normal process termination
fea681da
MK
32.SH SYNOPSIS
33.nf
34.B #include <stdlib.h>
35.sp
36.BI "int on_exit(void (*" function ")(int , void *), void *" arg );
37.fi
38.SH DESCRIPTION
87ed9800 39The \fBon_exit\fP() function registers the given \fIfunction\fP to be
027df6e0 40called at normal process termination, whether via
fea681da 41.BR exit (3)
87ed9800 42or via return from the program's \fImain\fP().
fea681da
MK
43The \fIfunction\fP is passed the argument to
44.BR exit (3)
87ed9800 45and the \fIarg\fP argument from \fBon_exit\fP().
fea681da 46.SH "RETURN VALUE"
87ed9800 47The \fBon_exit\fP() function returns the value 0 if successful; otherwise
fea681da
MK
48it returns a non-zero value.
49.SH "CONFORMING TO"
50This function comes from SunOS 4, but is also present in
c13182ef 51libc4, libc5 and glibc.
68e1685c 52It no longer occurs in Solaris (SunOS 5).
fea681da
MK
53Avoid this function, and use the standard
54.BR atexit (3)
55instead.
56.SH "SEE ALSO"
57.BR _exit (3),
58.BR atexit (3),
59.BR exit (3)