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