Rename dup3110 to dup3100 to match historical practice for NetBSD-11,

because we already have kevent100. Fix compat_dup3 to belong in compat_100
not compat_110.
This commit is contained in:
christos 2024-05-20 01:30:33 +00:00
parent 8ba66bcbe2
commit 679926ade6
13 changed files with 67 additions and 59 deletions

View File

@ -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 *);

View File

@ -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 \

View File

@ -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 <sys/cdefs.h>
__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 <sys/systm.h>
#include <sys/module.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/systm.h>
#include <sys/module.h>
@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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 <sys/cdefs.h>
__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"

View File

@ -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 <sys/cdefs.h>
__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 <sys/types.h>
#include <sys/filedesc.h>
#include <sys/event.h>
#include <sys/eventvar.h>
#include <sys/module.h>
@ -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 },
};

View File

@ -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 <sys/cdefs.h>
__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 <sys/types.h>
#include <sys/filedesc.h>
#include <sys/module.h>
#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
@ -43,27 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 chri
#include <compat/netbsd32/netbsd32_syscall.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
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 },
};

View File

@ -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 <sys/cdefs.h>
__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,7 +2462,7 @@ netbsd32__sched_protect(struct lwp *l,
}
int
netbsd32___dup3110(struct lwp *l, const struct netbsd32___dup3110_args *uap,
netbsd32___dup3100(struct lwp *l, const struct netbsd32___dup3100_args *uap,
register_t *retval)
{
/* {
@ -2470,13 +2470,13 @@ netbsd32___dup3110(struct lwp *l, const struct netbsd32___dup3110_args *uap,
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

View File

@ -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); }

View File

@ -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); }

View File

@ -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 <bsd.kmodule.mk>