aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2025-08-08 09:30:16 +0000
committerBrooks Davis <brooks@FreeBSD.org>2025-08-08 09:30:16 +0000
commite7e964cb2ebde11593786a28cea0238d9a6e24c3 (patch)
treeff222b2b7075e6fd66474dd686670a36e5606d88 /libexec/rtld-elf
parentfd4cdc438b7740007b06ea97431cc724e9aae185 (diff)
syscalls: normalize _exit(2) declerations
exit(3) is implemented by the runtime and performs a number of shutdown actions before ultimately calling _exit(2) to terminate the program. We historically named the syscall table entry `exit` rather than `_exit`, but this requires special handling in libc/libsys to cause the `_exit` symbol to exist while implementing `exit` in libc. Declare the syscall as `_exit` and flow that through the system. Because syscall(SYS_exit, code) is fairly widely used, allow a configured extra line in syscall.h to define SYS_exit to SYS__exit. I've found no external uses of __sys_exit() so I've not bothered to create a compatability version of this private symbol. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D51672
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/rtld-libc/rtld_libc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld-libc/rtld_libc.h b/libexec/rtld-elf/rtld-libc/rtld_libc.h
index 35b4ef32cf87..33601d73cbf9 100644
--- a/libexec/rtld-elf/rtld-libc/rtld_libc.h
+++ b/libexec/rtld-elf/rtld-libc/rtld_libc.h
@@ -44,7 +44,7 @@
#define __libc_interposing error, must not use this variable inside rtld
int __sys_close(int);
-void __sys_exit(int) __dead2;
+void __sys__exit(int) __dead2;
int __sys_fcntl(int, int, ...);
int __sys_fstat(int fd, struct stat *);
int __sys_fstatat(int, const char *, struct stat *, int);
@@ -70,8 +70,8 @@ int __getosreldate(void);
*/
#define close(fd) __sys_close(fd)
#define _close(fd) __sys_close(fd)
-#define exit(status) __sys_exit(status)
-#define _exit(status) __sys_exit(status)
+#define exit(status) __sys__exit(status)
+#define _exit(status) __sys__exit(status)
#define fcntl(fd, cmd, arg) __sys_fcntl(fd, cmd, arg)
#define _fcntl(fd, cmd, arg) __sys_fcntl(fd, cmd, arg)
#define _fstat(fd, sb) __sys_fstat(fd, sb)