diff options
Diffstat (limited to 'src/lib/libc/stdlib/atexit.h')
-rw-r--r-- | src/lib/libc/stdlib/atexit.h | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/src/lib/libc/stdlib/atexit.h b/src/lib/libc/stdlib/atexit.h index 6424dfdbbc..e7185e5559 100644 --- a/src/lib/libc/stdlib/atexit.h +++ b/src/lib/libc/stdlib/atexit.h | |||
@@ -1,41 +1,45 @@ | |||
1 | /* $OpenBSD: atexit.h,v 1.3 2002/07/29 19:54:42 dhartmei Exp $ */ | 1 | /*- |
2 | 2 | * Copyright (c) 1990 The Regents of the University of California. | |
3 | /* | ||
4 | * Copyright (c) 2002 Daniel Hartmeier | ||
5 | * All rights reserved. | 3 | * All rights reserved. |
6 | * | 4 | * |
7 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
9 | * are met: | 7 | * are met: |
8 | * 1. Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * 3. All advertising materials mentioning features or use of this software | ||
14 | * must display the following acknowledgement: | ||
15 | * This product includes software developed by the University of | ||
16 | * California, Berkeley and its contributors. | ||
17 | * 4. Neither the name of the University nor the names of its contributors | ||
18 | * may be used to endorse or promote products derived from this software | ||
19 | * without specific prior written permission. | ||
10 | * | 20 | * |
11 | * - Redistributions of source code must retain the above copyright | 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
12 | * notice, this list of conditions and the following disclaimer. | 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
13 | * - Redistributions in binary form must reproduce the above | 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
14 | * copyright notice, this list of conditions and the following | 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
15 | * disclaimer in the documentation and/or other materials provided | 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
16 | * with the distribution. | 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
17 | * | 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 31 | * SUCH DAMAGE. |
22 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
24 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
28 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | * POSSIBILITY OF SUCH DAMAGE. | ||
30 | * | 32 | * |
33 | * $OpenBSD: atexit.h,v 1.4 2002/07/31 18:13:16 dhartmei Exp $ | ||
31 | */ | 34 | */ |
32 | 35 | ||
36 | /* must be at least 32 to guarantee ANSI conformance */ | ||
37 | #define ATEXIT_SIZE 32 | ||
38 | |||
33 | struct atexit { | 39 | struct atexit { |
34 | struct atexit *next; /* next in list */ | 40 | struct atexit *next; /* next in list */ |
35 | int ind; /* next index in this table */ | 41 | int ind; /* next index in this table */ |
36 | int max; /* max entries >= ATEXIT_SIZE */ | 42 | void (*fns[ATEXIT_SIZE])(); /* the table itself */ |
37 | void (*fns[1])(); /* the table itself */ | ||
38 | }; | 43 | }; |
39 | 44 | ||
40 | extern int __atexit_invalid; | ||
41 | extern struct atexit *__atexit; /* points to head of LIFO stack */ | 45 | extern struct atexit *__atexit; /* points to head of LIFO stack */ |