aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib/exit.c')
-rw-r--r--newlib/libc/stdlib/exit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c
index 195b724..7648091 100644
--- a/newlib/libc/stdlib/exit.c
+++ b/newlib/libc/stdlib/exit.c
@@ -62,5 +62,9 @@ _DEFUN (exit, (code),
if (_GLOBAL_REENT->__cleanup)
(*_GLOBAL_REENT->__cleanup) (_GLOBAL_REENT);
+#ifdef REENTRANT_SYSCALLS_PROVIDED
+ _exit_r (_GLOBAL_REENT, code);
+#else
_exit (code);
+#endif
}