xref: /freebsd/lib/libc/stdlib/at_quick_exit.3 (revision 0a31efe016d28d5f3bee6c24591831149d760650)
1*0a31efe0SDavid Chisnall.\"  Copyright (c) 2011 David Chisnall
2*0a31efe0SDavid Chisnall.\"  All rights reserved.
3*0a31efe0SDavid Chisnall.\"
4*0a31efe0SDavid Chisnall.\"  Redistribution and use in source and binary forms, with or without
5*0a31efe0SDavid Chisnall.\"  modification, are permitted provided that the following conditions
6*0a31efe0SDavid Chisnall.\"  are met:
7*0a31efe0SDavid Chisnall.\"  1. Redistributions of source code must retain the above copyright
8*0a31efe0SDavid Chisnall.\"     notice, this list of conditions and the following disclaimer.
9*0a31efe0SDavid Chisnall.\"  2. Redistributions in binary form must reproduce the above copyright
10*0a31efe0SDavid Chisnall.\"     notice, this list of conditions and the following disclaimer in the
11*0a31efe0SDavid Chisnall.\"     documentation and/or other materials provided with the distribution.
12*0a31efe0SDavid Chisnall.\"
13*0a31efe0SDavid Chisnall.\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*0a31efe0SDavid Chisnall.\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*0a31efe0SDavid Chisnall.\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*0a31efe0SDavid Chisnall.\"  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*0a31efe0SDavid Chisnall.\"  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*0a31efe0SDavid Chisnall.\"  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*0a31efe0SDavid Chisnall.\"  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*0a31efe0SDavid Chisnall.\"  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*0a31efe0SDavid Chisnall.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*0a31efe0SDavid Chisnall.\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*0a31efe0SDavid Chisnall.\"  SUCH DAMAGE.
24*0a31efe0SDavid Chisnall.\"
25*0a31efe0SDavid Chisnall.\"  $FreeBSD$
26*0a31efe0SDavid Chisnall.\" /
27*0a31efe0SDavid Chisnall.Dd December 7, 2011o.Dt ATEXIT 3
28*0a31efe0SDavid Chisnall.Dt AT_QUICK_EXIT 3
29*0a31efe0SDavid Chisnall.Os
30*0a31efe0SDavid Chisnall.Sh NAME
31*0a31efe0SDavid Chisnall.Nm at_quick_exit
32*0a31efe0SDavid Chisnall.Nd Registers a cleanup function to run on quick exit.
33*0a31efe0SDavid Chisnall.Sh LIBRARY
34*0a31efe0SDavid Chisnall.Lb libc
35*0a31efe0SDavid Chisnall.Sh SYNOPSIS
36*0a31efe0SDavid Chisnall.In stdlib.h
37*0a31efe0SDavid Chisnall.Ft int
38*0a31efe0SDavid Chisnall.Fn at_quick_exit "void (*func)(void)"
39*0a31efe0SDavid Chisnall.Sh DESCRIPTION
40*0a31efe0SDavid ChisnallThe
41*0a31efe0SDavid Chisnall.Fn at_quick_exit
42*0a31efe0SDavid Chisnallfunction registers a cleanup function to be called when the program exits as a
43*0a31efe0SDavid Chisnallresult of calling
44*0a31efe0SDavid Chisnall.Xr quick_exit 3 .
45*0a31efe0SDavid ChisnallThe cleanup functions are called in the reverse order and will not be called if
46*0a31efe0SDavid Chisnallthe program exits by calling
47*0a31efe0SDavid Chisnall.Xr exit 3 ,
48*0a31efe0SDavid Chisnall.Xr _Exit 3 ,
49*0a31efe0SDavid Chisnallor
50*0a31efe0SDavid Chisnall.Xr abort 3 .
51*0a31efe0SDavid Chisnall.El
52*0a31efe0SDavid Chisnall.Sh SEE ALSO
53*0a31efe0SDavid Chisnall.Xr exit 3 ,
54*0a31efe0SDavid Chisnall.Xr at_quick_exit 3
55*0a31efe0SDavid Chisnall.Sh STANDARDS
56*0a31efe0SDavid ChisnallThe
57*0a31efe0SDavid Chisnall.Fn at_quick_exit
58*0a31efe0SDavid Chisnallfunction conforms to the C1x draft specification.
59