Back to index

glibc  2.9
exit.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991,1996,1997,1999,2001,2002,2006
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef       _EXIT_H
00021 #define _EXIT_H 1
00022 
00023 #include <stdint.h>
00024 
00025 enum
00026 {
00027   ef_free,    /* `ef_free' MUST be zero!  */
00028   ef_us,
00029   ef_on,
00030   ef_at,
00031   ef_cxa
00032 };
00033 
00034 struct exit_function
00035   {
00036     /* `flavour' should be of type of the `enum' above but since we need
00037        this element in an atomic operation we have to use `long int'.  */
00038     long int flavor;
00039     union
00040       {
00041        void (*at) (void);
00042        struct
00043          {
00044            void (*fn) (int status, void *arg);
00045            void *arg;
00046          } on;
00047        struct
00048          {
00049            void (*fn) (void *arg, int status);
00050            void *arg;
00051            void *dso_handle;
00052          } cxa;
00053       } func;
00054   };
00055 struct exit_function_list
00056   {
00057     struct exit_function_list *next;
00058     size_t idx;
00059     struct exit_function fns[32];
00060   };
00061 extern struct exit_function_list *__exit_funcs attribute_hidden;
00062 
00063 extern struct exit_function *__new_exitfn (void);
00064 extern uint64_t __new_exitfn_called attribute_hidden;
00065 
00066 #endif /* exit.h  */