diff --git a/include/unistd.h b/include/unistd.h index 1bfe0aa9102a..a1d68810470b 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.165 2024/05/19 22:25:47 christos Exp $ */ +/* $NetBSD: unistd.h,v 1.166 2024/05/20 01:30:33 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -330,7 +330,7 @@ int closefrom(int); int des_cipher(const char *, char *, long, int); int des_setkey(const char *); #ifndef __LIBC12_SOURCE__ -int dup3(int, int, int) __RENAME(__dup3110); +int dup3(int, int, int) __RENAME(__dup3100); #endif void endusershell(void); int exect(const char *, char * const *, char * const *); diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 1abf57f11360..acb1d4330661 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.254 2024/05/19 22:25:48 christos Exp $ +# $NetBSD: Makefile.inc,v 1.255 2024/05/20 01:30:33 christos Exp $ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 # sys sources @@ -102,7 +102,7 @@ ASM=\ chdir.S chflags.S chmod.S chown.S chroot.S \ clock_getcpuclockid2.S \ __clock_getres50.S __clock_gettime50.S \ - dup.S dup2.S __dup3110.S \ + dup.S dup2.S __dup3100.S \ eventfd.S \ extattrctl.S \ extattr_delete_fd.S extattr_delete_file.S \ diff --git a/sys/compat/common/compat_100_mod.c b/sys/compat/common/compat_100_mod.c index 89020902edb3..f195994e56ac 100644 --- a/sys/compat/common/compat_100_mod.c +++ b/sys/compat/common/compat_100_mod.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat_100_mod.c,v 1.2 2023/07/28 18:19:00 christos Exp $ */ +/* $NetBSD: compat_100_mod.c,v 1.3 2024/05/20 01:30:34 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: compat_100_mod.c,v 1.2 2023/07/28 18:19:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_100_mod.c,v 1.3 2024/05/20 01:30:34 christos Exp $"); #include #include @@ -49,15 +49,23 @@ __KERNEL_RCSID(0, "$NetBSD: compat_100_mod.c,v 1.2 2023/07/28 18:19:00 christos int compat_100_init(void) { + int error; - return kern_event_100_init(); + error = kern_event_100_init(); + if (error) + return error; + return sys_descrip_100_init(); } int compat_100_fini(void) { + int error; - return kern_event_100_fini(); + error = kern_event_100_fini(); + if (error) + return error; + return sys_descrip_100_fini(); } MODULE(MODULE_CLASS_EXEC, compat_100, NULL); diff --git a/sys/compat/common/compat_110_mod.c b/sys/compat/common/compat_110_mod.c index 9e2d6a2e105e..dcb33365d944 100644 --- a/sys/compat/common/compat_110_mod.c +++ b/sys/compat/common/compat_110_mod.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat_110_mod.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */ +/* $NetBSD: compat_110_mod.c,v 1.2 2024/05/20 01:30:34 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: compat_110_mod.c,v 1.1 2024/05/19 22:25:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_110_mod.c,v 1.2 2024/05/20 01:30:34 christos Exp $"); #include #include @@ -49,15 +49,13 @@ __KERNEL_RCSID(0, "$NetBSD: compat_110_mod.c,v 1.1 2024/05/19 22:25:48 christos int compat_110_init(void) { - - return sys_descrip_110_init(); + return 0; } int compat_110_fini(void) { - - return sys_descrip_110_fini(); + return 0; } MODULE(MODULE_CLASS_EXEC, compat_110, NULL); diff --git a/sys/compat/common/compat_mod.h b/sys/compat/common/compat_mod.h index 276bd4d6accb..f0ab23798fc4 100644 --- a/sys/compat/common/compat_mod.h +++ b/sys/compat/common/compat_mod.h @@ -1,4 +1,4 @@ -/* $NetBSD: compat_mod.h,v 1.11 2024/05/19 22:25:48 christos Exp $ */ +/* $NetBSD: compat_mod.h,v 1.12 2024/05/20 01:30:34 christos Exp $ */ /*- * Copyright (c) 2013, 2019 The NetBSD Foundation, Inc. @@ -35,8 +35,6 @@ #ifdef COMPAT_110 int compat_110_init(void); int compat_110_fini(void); -int sys_descrip_110_init(void); -int sys_descrip_110_fini(void); #endif #ifdef COMPAT_100 @@ -44,6 +42,8 @@ int compat_100_init(void); int compat_100_fini(void); int kern_event_100_init(void); int kern_event_100_fini(void); +int sys_descrip_100_init(void); +int sys_descrip_100_fini(void); #endif #ifdef COMPAT_90 diff --git a/sys/compat/common/files.common b/sys/compat/common/files.common index d63d9a5dc331..8a55a78df3ff 100644 --- a/sys/compat/common/files.common +++ b/sys/compat/common/files.common @@ -1,4 +1,4 @@ -# $NetBSD: files.common,v 1.12 2024/05/19 22:25:48 christos Exp $ +# $NetBSD: files.common,v 1.13 2024/05/20 01:30:34 christos Exp $ # # Generic utility files, used by various compat options. @@ -114,10 +114,11 @@ file compat/common/net_inet6_nd_90.c compat_90 # Compatibility code for NetBSD 10.0 file compat/common/compat_100_mod.c compat_100 file compat/common/kern_event_100.c compat_100 +file compat/common/compat_100_mod.c compat_100 +file compat/common/sys_descrip_100.c compat_100 # Compatibility code for NetBSD 11.0 file compat/common/compat_110_mod.c compat_110 -file compat/common/sys_descrip_110.c compat_110 # # Sources for sysv ipc compatibility across the versions. diff --git a/sys/compat/common/sys_decrip_110.c b/sys/compat/common/sys_descrip_100.c similarity index 93% rename from sys/compat/common/sys_decrip_110.c rename to sys/compat/common/sys_descrip_100.c index 4ba16696dc18..2d9abc15d9eb 100644 --- a/sys/compat/common/sys_decrip_110.c +++ b/sys/compat/common/sys_descrip_100.c @@ -1,4 +1,4 @@ -/* $NetBSD: sys_decrip_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */ +/* $NetBSD: sys_descrip_100.c,v 1.1 2024/05/20 01:30:34 christos Exp $ */ /*- * Copyright (c) 2024 The NetBSD Foundation, Inc. @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_decrip_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_descrip_100.c,v 1.1 2024/05/20 01:30:34 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" diff --git a/sys/compat/netbsd32/netbsd32_compat_100.c b/sys/compat/netbsd32/netbsd32_compat_100.c index 68c3c5a19ad7..0acc1ffe6c87 100644 --- a/sys/compat/netbsd32/netbsd32_compat_100.c +++ b/sys/compat/netbsd32/netbsd32_compat_100.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $ */ +/* $NetBSD: netbsd32_compat_100.c,v 1.4 2024/05/20 01:30:33 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,9 +30,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.4 2024/05/20 01:30:33 christos Exp $"); #include +#include #include #include #include @@ -129,9 +130,29 @@ compat_100_netbsd32___kevent50(struct lwp *l, SCARG(uap, timeout), &netbsd32_kevent_ops); } +int +compat_100_netbsd32_dup3(struct lwp *l, + const struct compat_100_netbsd32_dup3_args *uap, register_t *retval) +{ + /* { + syscallarg(int) from; + syscallarg(int) to; + syscallarg(int) flags; + syscallarg(const netbsd32_kevent100p_t) changelist; + syscallarg(netbsd32_size_t) nchanges; + syscallarg(netbsd32_kevent100p_t) eventlist; + syscallarg(netbsd32_size_t) nevents; + syscallarg(netbsd32_timespecp_t) timeout; + } */ + return dodup(l, SCARG(uap, from), SCARG(uap, to), SCARG(uap, flags), + retval); +} + static struct syscall_package compat_netbsd32_100_syscalls[] = { { NETBSD32_SYS_compat_100_netbsd32___kevent50, 0, (sy_call_t *)compat_100_netbsd32___kevent50 }, + { NETBSD32_SYS_compat_100_netbsd32_dup3, 0, + (sy_call_t *)compat_100_netbsd32_dup3 }, { 0, 0, NULL }, }; diff --git a/sys/compat/netbsd32/netbsd32_compat_110.c b/sys/compat/netbsd32/netbsd32_compat_110.c index 5413e9e24b76..d0a5e2f4a519 100644 --- a/sys/compat/netbsd32/netbsd32_compat_110.c +++ b/sys/compat/netbsd32/netbsd32_compat_110.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */ +/* $NetBSD: netbsd32_compat_110.c,v 1.2 2024/05/20 01:30:33 christos Exp $ */ /*- * Copyright (c) 2024 The NetBSD Foundation, Inc. @@ -30,10 +30,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_110.c,v 1.2 2024/05/20 01:30:33 christos Exp $"); #include -#include #include #include #include @@ -43,27 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 chri #include #include -int -compat_110_netbsd32_dup3(struct lwp *l, - const struct compat_110_netbsd32_dup3_args *uap, register_t *retval) -{ - /* { - syscallarg(int) from; - syscallarg(int) to; - syscallarg(int) flags; - syscallarg(const netbsd32_kevent100p_t) changelist; - syscallarg(netbsd32_size_t) nchanges; - syscallarg(netbsd32_kevent100p_t) eventlist; - syscallarg(netbsd32_size_t) nevents; - syscallarg(netbsd32_timespecp_t) timeout; - } */ - return dodup(l, SCARG(uap, from), SCARG(uap, to), SCARG(uap, flags), - retval); -} static struct syscall_package compat_netbsd32_110_syscalls[] = { - { NETBSD32_SYS_compat_110_netbsd32_dup3, 0, - (sy_call_t *)compat_110_netbsd32_dup3 }, { 0, 0, NULL }, }; diff --git a/sys/compat/netbsd32/netbsd32_netbsd.c b/sys/compat/netbsd32/netbsd32_netbsd.c index 4133d2ac98b8..777ca41c9fe0 100644 --- a/sys/compat/netbsd32/netbsd32_netbsd.c +++ b/sys/compat/netbsd32/netbsd32_netbsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.236 2024/05/19 22:25:48 christos Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.237 2024/05/20 01:30:33 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.236 2024/05/19 22:25:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.237 2024/05/20 01:30:33 christos Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -2462,21 +2462,21 @@ netbsd32__sched_protect(struct lwp *l, } int -netbsd32___dup3110(struct lwp *l, const struct netbsd32___dup3110_args *uap, - register_t *retval) +netbsd32___dup3100(struct lwp *l, const struct netbsd32___dup3100_args *uap, + register_t *retval) { /* { syscallarg(int) from; syscallarg(int) to; syscallarg(int) flags; } */ - struct sys___dup3110_args ua; + struct sys___dup3100_args ua; NETBSD32TO64_UAP(from); NETBSD32TO64_UAP(to); NETBSD32TO64_UAP(flags); - return sys___dup3110(l, &ua, retval); + return sys___dup3100(l, &ua, retval); } int diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master index 481579647da9..2f6c4268977d 100644 --- a/sys/compat/netbsd32/syscalls.master +++ b/sys/compat/netbsd32/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.145 2024/05/19 22:25:48 christos Exp $ + $NetBSD: syscalls.master,v 1.146 2024/05/20 01:30:33 christos Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -1069,7 +1069,7 @@ netbsd32_size_t fh_size, netbsd32_statp_t sb); } 452 OBSOL 5.99 quotactl 453 STD { int|netbsd32||pipe2(netbsd32_intp fildes, int flags); } -454 COMPAT_110 MODULAR compat_netbsd32_110 \ +454 COMPAT_100 MODULAR compat_netbsd32_100 \ { int|netbsd32||dup3(int from, int to, int flags); } 455 STD { int|netbsd32||kqueue1(int flags); } 456 STD { int|netbsd32||paccept(int s, \ @@ -1230,5 +1230,5 @@ netbsd32_epoll_eventp_t events, int maxevents, \ netbsd32_timespecp_t timeout, \ netbsd32_sigsetp_t sigmask); } -505 STD { int|netbsd32|110|dup3(int from, int to, \ +505 STD { int|netbsd32|100|dup3(int from, int to, \ int flags); } diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index bed427e90f75..bd2ee7b51f79 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.312 2024/05/19 22:25:48 christos Exp $ + $NetBSD: syscalls.master,v 1.313 2024/05/20 01:30:34 christos Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -954,7 +954,7 @@ ; 452 only ever appeared in 5.99.x and can be reused after netbsd-7 452 OBSOL 5.99 quotactl 453 STD RUMP { int|sys||pipe2(int *fildes, int flags); } -454 COMPAT_110 MODULAR compat_110 RUMP \ +454 COMPAT_100 MODULAR compat_100 RUMP \ { int|sys||dup3(int from, int to, int flags); } 455 STD RUMP { int|sys||kqueue1(int flags); } 456 STD RUMP { int|sys||paccept(int s, struct sockaddr *name, \ @@ -1064,4 +1064,4 @@ struct epoll_event *events, int maxevents, \ const struct timespec *timeout, \ const sigset_t *sigmask); } -505 STD RUMP { int|sys|110|dup3(int from, int to, int flags); } +505 STD RUMP { int|sys|100|dup3(int from, int to, int flags); } diff --git a/sys/modules/compat_110/Makefile b/sys/modules/compat_110/Makefile index 9c97af9eb299..644173b07e59 100644 --- a/sys/modules/compat_110/Makefile +++ b/sys/modules/compat_110/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2024/05/19 22:25:49 christos Exp $ +# $NetBSD: Makefile,v 1.2 2024/05/20 01:30:34 christos Exp $ .include "../Makefile.inc" @@ -8,6 +8,6 @@ KMOD= compat_110 CPPFLAGS+= -DCOMPAT_110 -SRCS+= compat_110_mod.c sys_decrip_110.c +SRCS+= compat_110_mod.c .include