Page MenuHomeFreeBSD

D51672.id159545.diff
No OneTemporary

D51672.id159545.diff

diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys
--- a/lib/libsys/Makefile.sys
+++ b/lib/libsys/Makefile.sys
@@ -52,7 +52,6 @@
PSEUDO= \
__realpathat \
clock_gettime \
- exit \
getlogin \
gettimeofday \
sched_getcpu
diff --git a/libexec/rtld-elf/rtld-libc/rtld_libc.h b/libexec/rtld-elf/rtld-libc/rtld_libc.h
--- 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 @@
*/
#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)
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -202,7 +202,7 @@
* exit -- death of process.
*/
int
-sys_exit(struct thread *td, struct exit_args *uap)
+sys__exit(struct thread *td, struct _exit_args *uap)
{
exit1(td, uap->rval, 0);
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -125,7 +125,7 @@
);
}
1 AUE_EXIT STD|CAPENABLED {
- void exit(
+ void _exit(
int rval
);
}
diff --git a/sys/tools/syscalls/scripts/syscall_h.lua b/sys/tools/syscalls/scripts/syscall_h.lua
--- a/sys/tools/syscalls/scripts/syscall_h.lua
+++ b/sys/tools/syscalls/scripts/syscall_h.lua
@@ -54,6 +54,17 @@
gen:write(string.format("#define\t%s%s%s\t%d\n",
config.syscallprefix, v:compatPrefix(), v.name,
v.num))
+
+ -- The _exit syscall was historically named exit
+ -- in the kernel and the SYS_exit definitation
+ -- is used in both C and assembly making
+ -- deprecation notices difficult so this adds a shim.
+ if v.name == "_exit" and
+ config.syscallprefix == "SYS_" then
+
+ gen:write(string.format(
+ "#define\tSYS_exit\tSYS__exit\n"))
+ end
elseif c >= 0 then
local comment
if c == 0 then
diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua
--- a/sys/tools/syscalls/scripts/syscalls_map.lua
+++ b/sys/tools/syscalls/scripts/syscalls_map.lua
@@ -39,7 +39,7 @@
for _, v in pairs(s) do
gen:write(v.prolog)
if v:native() and not v.type.NODEF and not v.type.NOLIB then
- if v.name ~= "exit" and v.name ~= "vfork" then
+ if v.name ~= "_exit" and v.name ~= "vfork" then
gen:write(string.format("\t_%s;\n", v.name))
end
gen:write(string.format("\t__sys_%s;\n", v.name))

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 9:52 PM (9 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30846266
Default Alt Text
D51672.id159545.diff (2 KB)

Event Timeline