summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/stdlib/atexit.c7
-rw-r--r--libc/sysdeps/linux/common/_exit.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index 4cec3f320..3a8a7be14 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -320,7 +320,9 @@ extern void (*__rtld_fini)(void);
/*
* Normal program termination
*/
-void exit(int rv)
+#undef exit
+#undef __exit
+void attribute_hidden __exit(int rv)
{
/* Perform exit-specific cleanup (atexit and on_exit) */
LOCK;
@@ -343,6 +345,7 @@ void exit(int rv)
if (_stdio_term)
_stdio_term();
- _exit(rv);
+ _exit_internal(rv);
}
+strong_alias(__exit,exit)
#endif
diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c
index d0a4ee1d6..a36f5a128 100644
--- a/libc/sysdeps/linux/common/_exit.c
+++ b/libc/sysdeps/linux/common/_exit.c
@@ -32,10 +32,12 @@
static inline _syscall1(void, __syscall_exit, int, status);
#endif
-void attribute_noreturn _exit(int status)
+#undef _exit
+#undef _exit_internal
+void attribute_noreturn _exit_internal(int status)
{
/* The loop is added only to keep gcc happy. */
while(1)
INLINE_SYSCALL(exit, 1, status);
}
-
+strong_alias(_exit_internal,_exit)