diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-01-28 09:31:59 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-01-28 19:04:05 -0400 |
commit | a88ef2fde041e5d733b5cbe2728b15ca149d1671 (patch) | |
tree | b4b01c75a640810f6549c485a382242d25a19a97 /src/Runtime/abort_exit.c |
Initial commit
Diffstat (limited to 'src/Runtime/abort_exit.c')
-rw-r--r-- | src/Runtime/abort_exit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Runtime/abort_exit.c b/src/Runtime/abort_exit.c new file mode 100644 index 0000000..43b1a0c --- /dev/null +++ b/src/Runtime/abort_exit.c @@ -0,0 +1,17 @@ +void __destroy_global_chain(); + +extern void (*_dtors[])(void); + +int __aborting; + + +void exit(int state) { + void (**dtor)(void); + if (!__aborting) { + dtor = _dtors; + while (*dtor != 0) { + (*dtor)(); + dtor++; + } + } +} |