Browse Source

Hide exit/_exit

Peter S. Mazinger 19 years ago
parent
commit
9d2c271f9b
2 changed files with 9 additions and 4 deletions
  1. 5 2
      libc/stdlib/atexit.c
  2. 4 2
      libc/sysdeps/linux/common/_exit.c

+ 5 - 2
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

+ 4 - 2
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)