version dup3

This commit is contained in:
christos 2024-05-19 22:25:47 +00:00
parent c86b32d1f8
commit 381b1356d0
23 changed files with 398 additions and 36 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.164 2024/01/19 18:40:35 christos Exp $ */
/* $NetBSD: unistd.h,v 1.165 2024/05/19 22:25:47 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@ -329,7 +329,9 @@ int acct(const char *);
int closefrom(int);
int des_cipher(const char *, char *, long, int);
int des_setkey(const char *);
int dup3(int, int, int);
#ifndef __LIBC12_SOURCE__
int dup3(int, int, int) __RENAME(__dup3110);
#endif
void endusershell(void);
int exect(const char *, char * const *, char * const *);
int execvpe(const char *, char * const *, char * const *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.3 2024/01/20 14:52:46 christos Exp $ */
/* $NetBSD: unistd.h,v 1.4 2024/05/19 22:25:47 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -64,8 +64,12 @@
#define _COMPAT_UNISTD_H_
__BEGIN_DECLS
pid_t vfork(void) __returns_twice;
pid_t __vfork14(void) __returns_twice;
pid_t vfork(void) __returns_twice;
pid_t __vfork14(void) __returns_twice;
int dup3(int, int, int);
int __dup3110(int, int, int);
__END_DECLS
#endif /* !_COMPAT_UNISTD_H_ */

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile.inc,v 1.11 2021/11/01 05:53:45 thorpej Exp $
# $NetBSD: Makefile.inc,v 1.12 2024/05/19 22:25:47 christos Exp $
.PATH: ${COMPATDIR}/sys
SRCS+= compat_getdents.c compat_getdirentries.c compat_msync.c \
compat_ntp_gettime.c compat_sched.c \
compat_ntp_gettime.c compat_sched.c compat_dup3.c \
compat_semctl.c compat_sigaltstack.c compat_stat.c compat___stat13.c \
compat_statfs.c compat_statvfs.c compat_socket.c compat_getfh.c \
compat_fhopen.c compat___fhstat30.c compat_fhstatvfs.c compat_fhstatvfs1.c \

View File

@ -0,0 +1,62 @@
/* $NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2024 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#define __LIBC12_SOURCE__
#include <fcntl.h>
#include <compat/include/unistd.h>
__warn_references(dup3,
"warning: reference to compatibility dup3(); include <unistd.h> to generate correct reference")
int
dup3(int oldfd, int newfd, int flags)
{
if (oldfd != newfd) {
return __dup3110(oldfd, newfd, flags);
}
if (flags & (O_NONBLOCK|O_NOSIGPIPE)) {
int e = fcntl(newfd, F_GETFL, 0);
if (e == -1)
return -1;
e |= flags & (O_NONBLOCK|O_NOSIGPIPE);
e = fcntl(newfd, F_SETFL, e);
if (e == -1)
return -1;
}
if (flags & O_CLOEXEC)
return fcntl(newfd, F_SETFD, FD_CLOEXEC);
return 0;
}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.253 2023/08/03 12:24:46 nia Exp $
# $NetBSD: Makefile.inc,v 1.254 2024/05/19 22:25:48 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 dup3.S \
dup.S dup2.S __dup3110.S \
eventfd.S \
extattrctl.S \
extattr_delete_fd.S extattr_delete_file.S \

View File

@ -0,0 +1,79 @@
/* $NetBSD: compat_110_mod.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software developed for The NetBSD Foundation
* by Paul Goyette
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Linkage for the compat module: spaghetti.
*/
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
#endif
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: compat_110_mod.c,v 1.1 2024/05/19 22:25:48 christos Exp $");
#include <sys/systm.h>
#include <sys/module.h>
#include <compat/common/compat_util.h>
#include <compat/common/compat_mod.h>
int
compat_110_init(void)
{
return sys_descrip_110_init();
}
int
compat_110_fini(void)
{
return sys_descrip_110_fini();
}
MODULE(MODULE_CLASS_EXEC, compat_110, NULL);
static int
compat_110_modcmd(modcmd_t cmd, void *arg)
{
switch (cmd) {
case MODULE_CMD_INIT:
return compat_110_init();
case MODULE_CMD_FINI:
return compat_110_fini();
default:
return ENOTTY;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_mod.h,v 1.10 2023/12/09 15:21:01 pgoyette Exp $ */
/* $NetBSD: compat_mod.h,v 1.11 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2013, 2019 The NetBSD Foundation, Inc.
@ -32,13 +32,18 @@
#ifndef _COMPAT_MOD_H
#define _COMPAT_MOD_H
#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
int compat_100_init(void);
int compat_100_fini(void);
int kern_event_100_init(void);
int kern_event_100_fini(void);
void usb_100_init(void);
void usb_100_fini(void);
#endif
#ifdef COMPAT_90

View File

@ -1,4 +1,4 @@
# $NetBSD: files.common,v 1.11 2023/12/09 15:21:01 pgoyette Exp $
# $NetBSD: files.common,v 1.12 2024/05/19 22:25:48 christos Exp $
#
# Generic utility files, used by various compat options.
@ -114,7 +114,10 @@ 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/usb_subr_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

@ -0,0 +1,74 @@
/* $NetBSD: sys_decrip_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2024 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* 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 $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
#endif
#include <sys/param.h>
#include <sys/filedesc.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
#include <compat/common/compat_mod.h>
static const struct syscall_package sys_descrip_110_syscalls[] = {
{ SYS_compat_110_dup3, 0,
(sy_call_t *)compat_110_sys_dup3 },
{ 0, 0, NULL },
};
int
sys_descrip_110_init(void)
{
return syscall_establish(NULL, sys_descrip_110_syscalls);
}
int
sys_descrip_110_fini(void)
{
return syscall_disestablish(NULL, sys_descrip_110_syscalls);
}
int
compat_110_sys_dup3(struct lwp *l, const struct compat_110_sys_dup3_args *uap,
register_t *retval)
{
/* {
syscallarg(int) from;
syscallarg(int) to;
syscallarg(int) flags;
} */
return dodup(l, SCARG(uap, from), SCARG(uap, to), SCARG(uap, flags),
retval);
}

View File

@ -1,4 +1,4 @@
# $NetBSD: files.netbsd32,v 1.55 2023/07/30 06:52:20 rin Exp $
# $NetBSD: files.netbsd32,v 1.56 2024/05/19 22:25:48 christos Exp $
#
# config file description for machine-independent netbsd32 compat code.
# included by ports that need it.
@ -66,3 +66,4 @@ file compat/netbsd32/netbsd32_compat_60.c compat_netbsd32 & compat_60
file compat/netbsd32/netbsd32_compat_80.c compat_netbsd32 & compat_80
file compat/netbsd32/netbsd32_compat_90.c compat_netbsd32 & compat_90
file compat/netbsd32/netbsd32_compat_100.c compat_netbsd32 & compat_100
file compat/netbsd32/netbsd32_compat_110.c compat_netbsd32 & compat_110

View File

@ -0,0 +1,88 @@
/* $NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2024 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software developed for The NetBSD Foundation
* by Christos Zoulas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_110.c,v 1.1 2024/05/19 22:25:48 christos Exp $");
#include <sys/types.h>
#include <sys/filedesc.h>
#include <sys/module.h>
#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
#include <sys/systm.h>
#include <compat/netbsd32/netbsd32.h>
#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 },
};
MODULE(MODULE_CLASS_EXEC, compat_netbsd32_110, "compat_netbsd32,compat_110");
static int
compat_netbsd32_110_modcmd(modcmd_t cmd, void *arg)
{
switch (cmd) {
case MODULE_CMD_INIT:
return syscall_establish(&emul_netbsd32,
compat_netbsd32_110_syscalls);
case MODULE_CMD_FINI:
return syscall_disestablish(&emul_netbsd32,
compat_netbsd32_110_syscalls);
default:
return ENOTTY;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.236 2024/05/19 22:25:48 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.235 2023/07/30 05:30:45 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.236 2024/05/19 22:25:48 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_dup3(struct lwp *l, const struct netbsd32_dup3_args *uap,
netbsd32___dup3110(struct lwp *l, const struct netbsd32___dup3110_args *uap,
register_t *retval)
{
/* {
@ -2470,13 +2470,13 @@ netbsd32_dup3(struct lwp *l, const struct netbsd32_dup3_args *uap,
syscallarg(int) to;
syscallarg(int) flags;
} */
struct sys_dup3_args ua;
struct sys___dup3110_args ua;
NETBSD32TO64_UAP(from);
NETBSD32TO64_UAP(to);
NETBSD32TO64_UAP(flags);
return sys_dup3(l, &ua, retval);
return sys___dup3110(l, &ua, retval);
}
int

View File

@ -1,4 +1,4 @@
# $NetBSD: syscalls.conf,v 1.18 2022/12/19 23:19:51 pgoyette Exp $
# $NetBSD: syscalls.conf,v 1.19 2024/05/19 22:25:48 christos Exp $
sysnames="netbsd32_syscalls.c"
sysnumhdr="netbsd32_syscall.h"
@ -6,7 +6,7 @@ syssw="netbsd32_sysent.c"
sysarghdr="netbsd32_syscallargs.h"
systrace="netbsd32_systrace_args.c"
sysautoload="netbsd32_syscalls_autoload.c"
compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90 compat_100"
compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90 compat_100 compat_110"
libcompatopts=""
switchname="netbsd32_sysent"

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp $
$NetBSD: syscalls.master,v 1.145 2024/05/19 22:25:48 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,8 @@
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 STD { int|netbsd32||dup3(int from, int to, int flags); }
454 COMPAT_110 MODULAR compat_netbsd32_110 \
{ int|netbsd32||dup3(int from, int to, int flags); }
455 STD { int|netbsd32||kqueue1(int flags); }
456 STD { int|netbsd32||paccept(int s, \
netbsd32_sockaddrp_t name, \
@ -1229,3 +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, \
int flags); }

View File

@ -0,0 +1,9 @@
# $NetBSD: compat_netbsd110.config,v 1.1 2024/05/19 22:25:48 christos Exp $
# Common fragment for all NetBSD targets wanting NetBSD 10.0 and newer
# compatibility support.
#
# Note that COMPAT_110 implies all newer COMPAT_XX options.
include "conf/compat_netbsd.config"
options COMPAT_110 # NetBSD 11.0 and beyond.

View File

@ -1,4 +1,4 @@
# $NetBSD: files,v 1.1312 2024/04/02 22:30:03 charlotte Exp $
# $NetBSD: files,v 1.1313 2024/05/19 22:25:48 christos Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@ -151,7 +151,8 @@ defflag opt_efi.h EFI_RUNTIME
# compatibility options
#
defflag opt_compat_netbsd.h COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_100: COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_110: COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_100: COMPAT_110, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_90: COMPAT_100, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_80: COMPAT_90, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_70: COMPAT_80, COMPAT_NETBSD

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_descrip.c,v 1.49 2024/05/19 15:56:55 christos Exp $ */
/* $NetBSD: sys_descrip.c,v 1.50 2024/05/19 22:25:48 christos Exp $ */
/*-
* Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.49 2024/05/19 15:56:55 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.50 2024/05/19 22:25:48 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -149,7 +149,7 @@ dodup(struct lwp *l, int from, int to, int flags, register_t *retval)
}
int
sys_dup3(struct lwp *l, const struct sys_dup3_args *uap, register_t *retval)
sys___dup3110(struct lwp *l, const struct sys___dup3110_args *uap, register_t *retval)
{
/* {
syscallarg(int) from;

View File

@ -1,4 +1,4 @@
# $NetBSD: syscalls.conf,v 1.32 2023/07/28 18:19:01 christos Exp $
# $NetBSD: syscalls.conf,v 1.33 2024/05/19 22:25:48 christos Exp $
sysnames="syscalls.c"
sysnumhdr="../sys/syscall.h"
@ -11,7 +11,7 @@ sysalign=1
rumpcalls="../rump/librump/rumpkern/rump_syscalls.c"
rumpcallshdr="../rump/include/rump/rump_syscalls.h"
rumpsysmap="../rump/rump.sysmap"
compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90 compat_100"
compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90 compat_100 compat_110"
libcompatopts=""
switchname="sysent"

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.311 2023/07/28 18:19:01 christos Exp $
$NetBSD: syscalls.master,v 1.312 2024/05/19 22:25:48 christos Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -954,7 +954,8 @@
; 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 STD RUMP { int|sys||dup3(int from, int to, int flags); }
454 COMPAT_110 MODULAR compat_110 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, \
socklen_t *anamelen, const sigset_t *mask, \
@ -1063,3 +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); }

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.286 2024/05/09 12:09:59 pho Exp $
# $NetBSD: Makefile,v 1.287 2024/05/19 22:25:49 christos Exp $
.include <bsd.own.mk>
@ -12,6 +12,7 @@ SUBDIR+= compat_43 compat_sysctl_09_43
SUBDIR+= compat_09 compat_10 compat_12 compat_13 compat_14
SUBDIR+= compat_16 compat_20 compat_30 compat_40 compat_50
SUBDIR+= compat_60 compat_70 compat_80 compat_90 compat_100
SUBDIR+= compat_110
SUBDIR+= compat_sysv_10 compat_sysv_14 compat_sysv_50
@ -318,6 +319,7 @@ SUBDIR+= compat_netbsd32_20 compat_netbsd32_30
SUBDIR+= compat_netbsd32_40 compat_netbsd32_50
SUBDIR+= compat_netbsd32_60 compat_netbsd32_80
SUBDIR+= compat_netbsd32_90 compat_netbsd32_100
SUBDIR+= compat_netbsd32_110
SUBDIR+= compat_netbsd32_43
SUBDIR+= compat_netbsd32_coredump
SUBDIR+= compat_netbsd32_mqueue

View File

@ -0,0 +1,13 @@
# $NetBSD: Makefile,v 1.1 2024/05/19 22:25:49 christos Exp $
.include "../Makefile.inc"
.PATH: ${S}/compat/common
KMOD= compat_110
CPPFLAGS+= -DCOMPAT_110
SRCS+= compat_110_mod.c sys_decrip_110.c
.include <bsd.kmodule.mk>

View File

@ -0,0 +1,14 @@
# $NetBSD: Makefile,v 1.1 2024/05/19 22:25:49 christos Exp $
.include "../Makefile.inc"
.PATH: ${S}/compat/netbsd32
KMOD= compat_netbsd32_110
CPPFLAGS+= -DCOMPAT_NETBSD32
CPPFLAGS+= -DCOMPAT_110
SRCS+= netbsd32_compat_110.c
.include <bsd.kmodule.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.rump,v 1.136 2024/02/04 18:52:36 andvar Exp $
# $NetBSD: Makefile.rump,v 1.137 2024/05/19 22:25:49 christos Exp $
#
.if !defined(_RUMP_MK)
@ -48,7 +48,7 @@ CPPFLAGS+= -DMIPS1=1
# which NetBSD compat to build
RUMP_NBCOMPAT?=default
.if ${RUMP_NBCOMPAT} == "all" || ${RUMP_NBCOMPAT} == "default"
RUMP_NBCOMPAT= 50 60 70 80 90 100
RUMP_NBCOMPAT= 50 60 70 80 90 100 110
.endif
.if ${RUMP_NBCOMPAT} == "none"
RUMP_NBCOMPAT=