12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef _EXIT_H
- #define _EXIT_H 1
- #include <stdbool.h>
- #include <stdint.h>
- #include <libc-lock.h>
- enum
- {
- ef_free,
- ef_us,
- ef_on,
- ef_at,
- ef_cxa
- };
- struct exit_function
- {
-
- long int flavor;
- union
- {
- void (*at) (void);
- struct
- {
- void (*fn) (int status, void *arg);
- void *arg;
- } on;
- struct
- {
- void (*fn) (void *arg, int status);
- void *arg;
- void *dso_handle;
- } cxa;
- } func;
- };
- struct exit_function_list
- {
- struct exit_function_list *next;
- size_t idx;
- struct exit_function fns[32];
- };
- extern struct exit_function_list *__exit_funcs attribute_hidden;
- extern struct exit_function_list *__quick_exit_funcs attribute_hidden;
- extern uint64_t __new_exitfn_called attribute_hidden;
- extern bool __exit_funcs_done attribute_hidden;
- __libc_lock_define (extern, __exit_funcs_lock);
- extern struct exit_function *__new_exitfn (struct exit_function_list **listp)
- attribute_hidden;
- extern void __run_exit_handlers (int status,
- struct exit_function_list **listp,
- bool run_list_atexit, bool run_dtors)
- attribute_hidden __attribute__ ((__noreturn__));
- extern int __internal_atexit (void (*func) (void *), void *arg, void *d,
- struct exit_function_list **listp)
- attribute_hidden;
- extern int __cxa_at_quick_exit (void (*func) (void *), void *d);
- #endif
|