xref: /openbsd/lib/libc/include/atfork.h (revision bb64080b)
1*bb64080bSguenther /*	$OpenBSD: atfork.h,v 1.2 2015/08/27 04:37:09 guenther Exp $ */
2514a545fSguenther 
3514a545fSguenther /*
4514a545fSguenther  * Copyright (c) 2008 Kurt Miller <kurt@openbsd.org>
5514a545fSguenther  * Copyright (c) 2008 Philip Guenther <guenther@openbsd.org>
6514a545fSguenther  * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>
7514a545fSguenther  * All rights reserved.
8514a545fSguenther  *
9514a545fSguenther  * Redistribution and use in source and binary forms, with or without
10514a545fSguenther  * modification, are permitted provided that the following conditions
11514a545fSguenther  * are met:
12514a545fSguenther  * 1. Redistributions of source code must retain the above copyright
13514a545fSguenther  *    notice, this list of conditions and the following disclaimer.
14514a545fSguenther  * 2. Neither the name of the author nor the names of any co-contributors
15514a545fSguenther  *    may be used to endorse or promote products derived from this software
16514a545fSguenther  *    without specific prior written permission.
17514a545fSguenther  *
18514a545fSguenther  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19514a545fSguenther  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20514a545fSguenther  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21514a545fSguenther  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22514a545fSguenther  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23514a545fSguenther  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24514a545fSguenther  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25514a545fSguenther  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26514a545fSguenther  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27514a545fSguenther  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28514a545fSguenther  * SUCH DAMAGE.
29514a545fSguenther  *
30514a545fSguenther  * $FreeBSD: /repoman/r/ncvs/src/lib/libc_r/uthread/uthread_atfork.c,v 1.1 2004/12/10 03:36:45 grog Exp $
31514a545fSguenther  */
32514a545fSguenther 
33514a545fSguenther #include <sys/queue.h>
34514a545fSguenther 
35514a545fSguenther struct atfork_fn {
36514a545fSguenther 	TAILQ_ENTRY(atfork_fn) fn_next;
37514a545fSguenther 	void	(*fn_prepare)(void);
38514a545fSguenther 	void	(*fn_parent)(void);
39514a545fSguenther 	void	(*fn_child)(void);
40514a545fSguenther 	void	*fn_dso;
41514a545fSguenther };
42514a545fSguenther 
43*bb64080bSguenther __BEGIN_HIDDEN_DECLS
44514a545fSguenther extern TAILQ_HEAD(atfork_listhead, atfork_fn) _atfork_list;
45*bb64080bSguenther __END_HIDDEN_DECLS
46