xref: /freebsd/lib/libc/stdlib/at_quick_exit.3 (revision af8065219dfb27d91e9db2911553413f955d195f)
10a31efe0SDavid Chisnall.\"  Copyright (c) 2011 David Chisnall
20a31efe0SDavid Chisnall.\"  All rights reserved.
30a31efe0SDavid Chisnall.\"
40a31efe0SDavid Chisnall.\"  Redistribution and use in source and binary forms, with or without
50a31efe0SDavid Chisnall.\"  modification, are permitted provided that the following conditions
60a31efe0SDavid Chisnall.\"  are met:
70a31efe0SDavid Chisnall.\"  1. Redistributions of source code must retain the above copyright
80a31efe0SDavid Chisnall.\"     notice, this list of conditions and the following disclaimer.
90a31efe0SDavid Chisnall.\"  2. Redistributions in binary form must reproduce the above copyright
100a31efe0SDavid Chisnall.\"     notice, this list of conditions and the following disclaimer in the
110a31efe0SDavid Chisnall.\"     documentation and/or other materials provided with the distribution.
120a31efe0SDavid Chisnall.\"
130a31efe0SDavid Chisnall.\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
140a31efe0SDavid Chisnall.\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
150a31efe0SDavid Chisnall.\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
160a31efe0SDavid Chisnall.\"  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
170a31efe0SDavid Chisnall.\"  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
180a31efe0SDavid Chisnall.\"  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
190a31efe0SDavid Chisnall.\"  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
200a31efe0SDavid Chisnall.\"  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
210a31efe0SDavid Chisnall.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
220a31efe0SDavid Chisnall.\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
230a31efe0SDavid Chisnall.\"  SUCH DAMAGE.
240a31efe0SDavid Chisnall.\"
250a31efe0SDavid Chisnall.\"  $FreeBSD$
26*af806521SDavid Chisnall.\"
27*af806521SDavid Chisnall.Dd December 7, 2011
280a31efe0SDavid Chisnall.Dt AT_QUICK_EXIT 3
290a31efe0SDavid Chisnall.Os
300a31efe0SDavid Chisnall.Sh NAME
310a31efe0SDavid Chisnall.Nm at_quick_exit
32*af806521SDavid Chisnall.Nd registers a cleanup function to run on quick exit
330a31efe0SDavid Chisnall.Sh LIBRARY
340a31efe0SDavid Chisnall.Lb libc
350a31efe0SDavid Chisnall.Sh SYNOPSIS
360a31efe0SDavid Chisnall.In stdlib.h
370a31efe0SDavid Chisnall.Ft int
380a31efe0SDavid Chisnall.Fn at_quick_exit "void (*func)(void)"
390a31efe0SDavid Chisnall.Sh DESCRIPTION
400a31efe0SDavid ChisnallThe
410a31efe0SDavid Chisnall.Fn at_quick_exit
420a31efe0SDavid Chisnallfunction registers a cleanup function to be called when the program exits as a
430a31efe0SDavid Chisnallresult of calling
440a31efe0SDavid Chisnall.Xr quick_exit 3 .
450a31efe0SDavid ChisnallThe cleanup functions are called in the reverse order and will not be called if
460a31efe0SDavid Chisnallthe program exits by calling
470a31efe0SDavid Chisnall.Xr exit 3 ,
480a31efe0SDavid Chisnall.Xr _Exit 3 ,
490a31efe0SDavid Chisnallor
500a31efe0SDavid Chisnall.Xr abort 3 .
51*af806521SDavid Chisnall.Sh RETURN VALUES
52*af806521SDavid ChisnallThe
53*af806521SDavid Chisnall.Fn at_quick_exit
54*af806521SDavid Chisnallfunction returns the value 0 if successful and a non-zero value on failure.
550a31efe0SDavid Chisnall.Sh SEE ALSO
560a31efe0SDavid Chisnall.Xr exit 3 ,
57*af806521SDavid Chisnall.Xr quick_exit 3
580a31efe0SDavid Chisnall.Sh STANDARDS
590a31efe0SDavid ChisnallThe
600a31efe0SDavid Chisnall.Fn at_quick_exit
610a31efe0SDavid Chisnallfunction conforms to the C1x draft specification.
62