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.\" 25af806521SDavid Chisnall.Dd December 7, 2011 260a31efe0SDavid Chisnall.Dt AT_QUICK_EXIT 3 270a31efe0SDavid Chisnall.Os 280a31efe0SDavid Chisnall.Sh NAME 290a31efe0SDavid Chisnall.Nm at_quick_exit 30af806521SDavid Chisnall.Nd registers a cleanup function to run on quick exit 310a31efe0SDavid Chisnall.Sh LIBRARY 320a31efe0SDavid Chisnall.Lb libc 330a31efe0SDavid Chisnall.Sh SYNOPSIS 340a31efe0SDavid Chisnall.In stdlib.h 350a31efe0SDavid Chisnall.Ft int 360a31efe0SDavid Chisnall.Fn at_quick_exit "void (*func)(void)" 370a31efe0SDavid Chisnall.Sh DESCRIPTION 380a31efe0SDavid ChisnallThe 390a31efe0SDavid Chisnall.Fn at_quick_exit 400a31efe0SDavid Chisnallfunction registers a cleanup function to be called when the program exits as a 410a31efe0SDavid Chisnallresult of calling 420a31efe0SDavid Chisnall.Xr quick_exit 3 . 430a31efe0SDavid ChisnallThe cleanup functions are called in the reverse order and will not be called if 440a31efe0SDavid Chisnallthe program exits by calling 450a31efe0SDavid Chisnall.Xr exit 3 , 460a31efe0SDavid Chisnall.Xr _Exit 3 , 470a31efe0SDavid Chisnallor 480a31efe0SDavid Chisnall.Xr abort 3 . 49af806521SDavid Chisnall.Sh RETURN VALUES 50af806521SDavid ChisnallThe 51af806521SDavid Chisnall.Fn at_quick_exit 52af806521SDavid Chisnallfunction returns the value 0 if successful and a non-zero value on failure. 530a31efe0SDavid Chisnall.Sh SEE ALSO 540a31efe0SDavid Chisnall.Xr exit 3 , 55af806521SDavid Chisnall.Xr quick_exit 3 560a31efe0SDavid Chisnall.Sh STANDARDS 570a31efe0SDavid ChisnallThe 580a31efe0SDavid Chisnall.Fn at_quick_exit 59*f6a61518SSergey Kandaurovfunction conforms to 60*f6a61518SSergey Kandaurov.St -isoC-2011 . 61