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