CVS commit: src/sys/compat/linux/arch

2024-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 18:58:01 UTC 2024

Modified Files:
src/sys/compat/linux/arch/aarch64: Makefile
src/sys/compat/linux/arch/alpha: Makefile
src/sys/compat/linux/arch/amd64: Makefile
src/sys/compat/linux/arch/arm: Makefile
src/sys/compat/linux/arch/i386: Makefile
src/sys/compat/linux/arch/m68k: Makefile
src/sys/compat/linux/arch/mips: Makefile
src/sys/compat/linux/arch/powerpc: Makefile
src/sys/compat/linux/arch/sparc: Makefile
src/sys/compat/linux/arch/sparc64: Makefile

Log Message:
should not be using .include <> but .include "" here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/arch/aarch64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/alpha/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/amd64/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/arm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/i386/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/m68k/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/mips/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/powerpc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/sparc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/sparc64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/Makefile
diff -u src/sys/compat/linux/arch/aarch64/Makefile:1.1 src/sys/compat/linux/arch/aarch64/Makefile:1.2
--- src/sys/compat/linux/arch/aarch64/Makefile:1.1	Thu Sep 23 02:56:27 2021
+++ src/sys/compat/linux/arch/aarch64/Makefile	Wed May 29 14:58:00 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.1 2021/09/23 06:56:27 ryo Exp $
+#	$NetBSD: Makefile,v 1.2 2024/05/29 18:58:00 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/alpha/Makefile
diff -u src/sys/compat/linux/arch/alpha/Makefile:1.3 src/sys/compat/linux/arch/alpha/Makefile:1.4
--- src/sys/compat/linux/arch/alpha/Makefile:1.3	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/alpha/Makefile	Wed May 29 14:58:00 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.3 2014/04/08 11:39:57 njoly Exp $
+#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:00 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/amd64/Makefile
diff -u src/sys/compat/linux/arch/amd64/Makefile:1.3 src/sys/compat/linux/arch/amd64/Makefile:1.4
--- src/sys/compat/linux/arch/amd64/Makefile:1.3	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/amd64/Makefile	Wed May 29 14:58:00 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.3 2014/04/08 11:39:57 njoly Exp $ 
+#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:00 christos Exp $ 
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/arm/Makefile
diff -u src/sys/compat/linux/arch/arm/Makefile:1.2 src/sys/compat/linux/arch/arm/Makefile:1.3
--- src/sys/compat/linux/arch/arm/Makefile:1.2	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/arm/Makefile	Wed May 29 14:58:01 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.2 2014/04/08 11:39:57 njoly Exp $
+#	$NetBSD: Makefile,v 1.3 2024/05/29 18:58:01 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/i386/Makefile
diff -u src/sys/compat/linux/arch/i386/Makefile:1.3 src/sys/compat/linux/arch/i386/Makefile:1.4
--- src/sys/compat/linux/arch/i386/Makefile:1.3	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/i386/Makefile	Wed May 29 14:58:01 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.3 2014/04/08 11:39:57 njoly Exp $
+#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:01 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/m68k/Makefile
diff -u src/sys/compat/linux/arch/m68k/Makefile:1.3 src/sys/compat/linux/arch/m68k/Makefile:1.4
--- src/sys/compat/linux/arch/m68k/Makefile:1.3	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/m68k/Makefile	Wed May 29 14:58:01 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.3 2014/04/08 11:39:57 njoly Exp $
+#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:01 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/mips/Makefile
diff -u src/sys/compat/linux/arch/mips/Makefile:1.3 src/sys/compat/linux/arch/mips/Makefile:1.4
--- src/sys/compat/linux/arch/mips/Makefile:1.3	Tue Apr  8 07:39:57 2014
+++ src/sys/compat/linux/arch/mips/Makefile	Wed May 29 14:58:01 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.3 2014/04/08 11:39:57 njoly Exp $
+#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:01 christos Exp $
 
-.include <../../Makefile.inc>
+.include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/powerpc/Makefile
diff -u 

CVS commit: src/sys/compat/linux/arch

2024-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 18:58:01 UTC 2024

Modified Files:
src/sys/compat/linux/arch/aarch64: Makefile
src/sys/compat/linux/arch/alpha: Makefile
src/sys/compat/linux/arch/amd64: Makefile
src/sys/compat/linux/arch/arm: Makefile
src/sys/compat/linux/arch/i386: Makefile
src/sys/compat/linux/arch/m68k: Makefile
src/sys/compat/linux/arch/mips: Makefile
src/sys/compat/linux/arch/powerpc: Makefile
src/sys/compat/linux/arch/sparc: Makefile
src/sys/compat/linux/arch/sparc64: Makefile

Log Message:
should not be using .include <> but .include "" here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/arch/aarch64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/alpha/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/amd64/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/arm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/i386/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/m68k/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/mips/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/powerpc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/sparc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/sparc64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/common

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 02:36:33 UTC 2024

Modified Files:
src/sys/compat/common: files.common

Log Message:
remove dup line


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/common/files.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/files.common
diff -u src/sys/compat/common/files.common:1.13 src/sys/compat/common/files.common:1.14
--- src/sys/compat/common/files.common:1.13	Sun May 19 21:30:34 2024
+++ src/sys/compat/common/files.common	Sun May 19 22:36:33 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.common,v 1.13 2024/05/20 01:30:34 christos Exp $
+#	$NetBSD: files.common,v 1.14 2024/05/20 02:36:33 christos Exp $
 
 #
 # Generic utility files, used by various compat options.
@@ -114,7 +114,6 @@ file	compat/common/net_inet6_nd_90.c		co
 # 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



CVS commit: src/sys/compat/common

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 02:36:33 UTC 2024

Modified Files:
src/sys/compat/common: files.common

Log Message:
remove dup line


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/common/files.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 19:54:48 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
Add forward decl for procfs include.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_misc.h
diff -u src/sys/compat/linux/common/linux_misc.h:1.31 src/sys/compat/linux/common/linux_misc.h:1.32
--- src/sys/compat/linux/common/linux_misc.h:1.31	Sun May 12 15:50:42 2024
+++ src/sys/compat/linux/common/linux_misc.h	Sun May 12 15:54:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.h,v 1.31 2024/05/12 19:50:42 christos Exp $	*/
+/*	$NetBSD: linux_misc.h,v 1.32 2024/05/12 19:54:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -174,6 +174,7 @@ __packed
 
 #ifdef _KERNEL
 __BEGIN_DECLS
+struct linux_timeval;
 int bsd_to_linux_wstat(int);
 int linux_select1(struct lwp *, register_t *, int, fd_set *, fd_set *,
 		   fd_set *, struct linux_timeval *);



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 19:54:48 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
Add forward decl for procfs include.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 19:50:42 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
fix whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_misc.h
diff -u src/sys/compat/linux/common/linux_misc.h:1.30 src/sys/compat/linux/common/linux_misc.h:1.31
--- src/sys/compat/linux/common/linux_misc.h:1.30	Sun May 12 13:23:10 2024
+++ src/sys/compat/linux/common/linux_misc.h	Sun May 12 15:50:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.h,v 1.30 2024/05/12 17:23:10 christos Exp $	*/
+/*	$NetBSD: linux_misc.h,v 1.31 2024/05/12 19:50:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -94,11 +94,11 @@ struct linux_sysinfo {
 #define	LINUX_RLIMIT_MEMLOCK	8
 #define	LINUX_RLIMIT_AS		9
 #define	LINUX_RLIMIT_LOCKS	10
-#define LINUX_RLIMIT_SIGPENDING	11
-#define LINUX_RLIMIT_MSGQUEUE	12
-#define LINUX_RLIMIT_NICE	13
-#define LINUX_RLIMIT_RTPRIO	14
-#define LINUX_RLIMIT_RTTIME	15
+#define	LINUX_RLIMIT_SIGPENDING	11
+#define	LINUX_RLIMIT_MSGQUEUE	12
+#define	LINUX_RLIMIT_NICE	13
+#define	LINUX_RLIMIT_RTPRIO	14
+#define	LINUX_RLIMIT_RTTIME	15
 #ifdef __mips__  /* XXX only mips32. On mips64, it's ~0ul */
 #define	LINUX_RLIM_INFINITY	0x7fffUL
 #define	LINUX32_RLIM_INFINITY	0x7fffU



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 19:50:42 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
fix whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:23:10 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_limit.h linux_misc.h

Log Message:
PR/58240: Ricardo Branco: Add missing limits


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_limit.h
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_limit.h
diff -u src/sys/compat/linux/common/linux_limit.h:1.8 src/sys/compat/linux/common/linux_limit.h:1.9
--- src/sys/compat/linux/common/linux_limit.h:1.8	Wed Dec  1 23:29:48 2021
+++ src/sys/compat/linux/common/linux_limit.h	Sun May 12 13:23:10 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: linux_limit.h,v 1.8 2021/12/02 04:29:48 ryo Exp $ */
+/* 	$NetBSD: linux_limit.h,v 1.9 2024/05/12 17:23:10 christos Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -94,6 +94,11 @@ linux_to_bsd_limit(int lim)
 	case LINUX_RLIMIT_AS:
 		return RLIMIT_AS;
 	case LINUX_RLIMIT_LOCKS:
+	case LINUX_RLIMIT_SIGPENDING:
+	case LINUX_RLIMIT_MSGQUEUE:
+	case LINUX_RLIMIT_NICE:
+	case LINUX_RLIMIT_RTPRIO:
+	case LINUX_RLIMIT_RTTIME:
 		return -EOPNOTSUPP;
 	default:
 		return -EINVAL;

Index: src/sys/compat/linux/common/linux_misc.h
diff -u src/sys/compat/linux/common/linux_misc.h:1.29 src/sys/compat/linux/common/linux_misc.h:1.30
--- src/sys/compat/linux/common/linux_misc.h:1.29	Fri Aug 18 15:41:19 2023
+++ src/sys/compat/linux/common/linux_misc.h	Sun May 12 13:23:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.h,v 1.29 2023/08/18 19:41:19 christos Exp $	*/
+/*	$NetBSD: linux_misc.h,v 1.30 2024/05/12 17:23:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -94,6 +94,11 @@ struct linux_sysinfo {
 #define	LINUX_RLIMIT_MEMLOCK	8
 #define	LINUX_RLIMIT_AS		9
 #define	LINUX_RLIMIT_LOCKS	10
+#define LINUX_RLIMIT_SIGPENDING	11
+#define LINUX_RLIMIT_MSGQUEUE	12
+#define LINUX_RLIMIT_NICE	13
+#define LINUX_RLIMIT_RTPRIO	14
+#define LINUX_RLIMIT_RTTIME	15
 #ifdef __mips__  /* XXX only mips32. On mips64, it's ~0ul */
 #define	LINUX_RLIM_INFINITY	0x7fffUL
 #define	LINUX32_RLIM_INFINITY	0x7fffU



CVS commit: src/sys/compat/linux/common

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:23:10 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_limit.h linux_misc.h

Log Message:
PR/58240: Ricardo Branco: Add missing limits


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_limit.h
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-05-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 11 10:22:17 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
PR 58235: add support for SIOCGIFDATA and SIOCZIFDATA ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/netbsd32/netbsd32_ioctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.120 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.121
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.120	Wed Dec 22 00:21:32 2021
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Sat May 11 10:22:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.121 2024/05/11 10:22:17 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.121 2024/05/11 10:22:17 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -151,6 +151,20 @@ netbsd32_to_oifreq(struct netbsd32_oifre
 }
 
 static inline void
+netbsd32_to_ifdatareq(struct netbsd32_ifdatareq *s32p, struct ifdatareq *p, u_long cmd)
+{
+
+	memcpy(p, s32p, sizeof *s32p);
+	switch (cmd) {
+	case SIOCGIFDATA:
+	case SIOCZIFDATA:
+		netbsd32_to_timespec(>ifdr_data.ifi_lastchange,
+		>ifdr_data.ifi_lastchange);
+		break;
+	}
+}
+
+static inline void
 netbsd32_to_if_addrprefreq(const struct netbsd32_if_addrprefreq *ifap32,
 struct if_addrprefreq *ifap, u_long cmd)
 {
@@ -693,6 +707,20 @@ netbsd32_from_oifreq(struct oifreq *p,
 }
 
 static inline void
+netbsd32_from_ifdatareq(const struct ifdatareq *p, struct netbsd32_ifdatareq *p32, u_long cmd)
+{
+
+	memcpy(p32, p, sizeof *p32);
+	switch (cmd) {
+	case SIOCGIFDATA:
+	case SIOCZIFDATA:
+		netbsd32_from_timespec(>ifdr_data.ifi_lastchange,
+		>ifdr_data.ifi_lastchange);
+		break;
+	}
+}
+
+static inline void
 netbsd32_from_if_addrprefreq(const struct if_addrprefreq *ifap,
 struct netbsd32_if_addrprefreq *ifap32, u_long cmd)
 {
@@ -1537,6 +1565,10 @@ netbsd32_ioctl(struct lwp *l,
 	case SIOCSIFADDRPREF32:
 		IOCTL_STRUCT_CONV_TO(SIOCSIFADDRPREF, if_addrprefreq);
 
+	case SIOCGIFDATA32:
+		IOCTL_STRUCT_CONV_TO(SIOCGIFDATA, ifdatareq);
+	case SIOCZIFDATA32:
+		IOCTL_STRUCT_CONV_TO(SIOCZIFDATA, ifdatareq);
 
 	case OSIOCGIFFLAGS32:
 		IOCTL_STRUCT_CONV_TO(OSIOCGIFFLAGS, oifreq);

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.79 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.80
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.79	Wed Dec 22 00:21:32 2021
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Sat May 11 10:22:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.79 2021/12/22 00:21:32 roy Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.80 2024/05/11 10:22:17 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -316,6 +316,35 @@ struct netbsd32_if_clonereq {
 	netbsd32_charp ifcr_buffer;
 };
 
+struct netbsd32_if_data {
+	u_char	ifi_type;
+	u_char	ifi_addrlen;
+	u_char	ifi_hdrlen;
+	u_char  __pack_dummy;
+	int	ifi_link_state;
+	uint64_t ifi_mtu;
+	uint64_t ifi_metric;
+	uint64_t ifi_baudrate;
+	uint64_t ifi_ipackets;
+	uint64_t ifi_ierrors;
+	uint64_t ifi_opackets;
+	uint64_t ifi_oerrors;
+	uint64_t ifi_collisions;
+	uint64_t ifi_ibytes;
+	uint64_t ifi_obytes;
+	uint64_t ifi_imcasts;
+	uint64_t ifi_omcasts;
+	uint64_t ifi_iqdrops;
+	uint64_t ifi_noproto;
+	struct	netbsd32_timespec ifi_lastchange;
+} __packed;
+
+struct netbsd32_ifdatareq {
+	char	ifdr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
+	struct	netbsd32_if_data ifdr_data;
+};
+
+
 /* from  */
 #define	SIOCGADDRROM32		_IOW('i', 240, struct netbsd32_ifreq)	/* get 128 bytes of ROM */
 #define	SIOCGCHIPID32		_IOWR('i', 241, struct netbsd32_ifreq)	/* get chipid */
@@ -388,6 +417,10 @@ struct netbsd32_if_clonereq {
 
 #define	SIOCGIFMTU32	_IOWR('i', 126, struct netbsd32_ifreq)	/* get ifnet mtu */
 #define	OSIOCGIFMTU32	_IOWR('i', 126, struct netbsd32_oifreq)	/* get ifnet mtu */
+
+#define SIOCGIFDATA32	_IOWR('i', 133, struct netbsd32_ifdatareq)
+#define SIOCZIFDATA32	_IOWR('i', 134, struct netbsd32_ifdatareq)
+
 /* was 125 SIOCSIFASYNCMAP32 */
 /* was 124 SIOCGIFASYNCMAP32 */
 /* from  */



CVS commit: src/sys/compat/netbsd32

2024-05-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 11 10:22:17 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
PR 58235: add support for SIOCGIFDATA and SIOCZIFDATA ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/netbsd32/netbsd32_ioctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-05-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May  1 11:32:29 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_16.c

Log Message:
Enable compat sigreturn system call.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_compat_16.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-05-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May  1 11:32:29 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_16.c

Log Message:
Enable compat sigreturn system call.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_compat_16.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_16.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_16.c:1.4 src/sys/compat/netbsd32/netbsd32_compat_16.c:1.5
--- src/sys/compat/netbsd32/netbsd32_compat_16.c:1.4	Fri Nov 26 08:06:11 2021
+++ src/sys/compat/netbsd32/netbsd32_compat_16.c	Wed May  1 11:32:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_16.c,v 1.4 2021/11/26 08:06:11 ryo Exp $	*/
+/*	$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,13 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.4 2021/11/26 08:06:11 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -47,40 +48,87 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 
 struct uvm_object *emul_netbsd32_object;
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16, "compat_netbsd32_20,compat_16");
+static const struct syscall_package netbsd32_kern_sig_16_syscalls[] = {
+/* compat_16_netbs32___sigreturn14 is in MD code! */
+{ NETBSD32_SYS_compat_16_netbsd32___sigreturn14, 0,
+(sy_call_t *)compat_16_netbsd32___sigreturn14 },
+{ 0, 0, NULL }
+};
 
 static int
-compat_netbsd32_16_modcmd(modcmd_t cmd, void *arg)
+compat_netbsd32_16_init(void)
+{
+	int error;
+
+	error = syscall_establish(_netbsd32, netbsd32_kern_sig_16_syscalls);
+	if (error)
+		return error;
+
+	rw_enter(_lock, RW_WRITER);
+	emul_netbsd32.e_sigcode = netbsd32_sigcode;
+	emul_netbsd32.e_esigcode = netbsd32_esigcode;
+	emul_netbsd32.e_sigobject = _netbsd32_object;
+	error = exec_sigcode_alloc(_netbsd);
+	if (error) {
+		emul_netbsd32.e_sigcode = NULL;
+		emul_netbsd32.e_esigcode = NULL;
+		emul_netbsd32.e_sigobject = NULL;
+	}
+	rw_exit(_lock);
+	if (error)
+		return error;
+	netbsd32_machdep_md_16_init();
+	return 0;
+}
+
+static int
+compat_netbsd32_16_fini(void)
 {
+	proc_t *p;
 	int error;
 
+	error = syscall_disestablish(_netbsd32, netbsd32_kern_sig_16_syscalls);
+if (error)
+return error;
+/*
+ * Ensure sendsig_sigcontext() is not being used.
+ * module_lock prevents the flag being set on any
+ * further processes while we are here.  See
+ * sigaction1() for the opposing half.
+ */
+mutex_enter(_lock);
+PROCLIST_FOREACH(p, ) {
+if ((p->p_lflag & PL_SIGCOMPAT) != 0) {
+break;
+}
+}
+mutex_exit(_lock);
+if (p != NULL) {
+syscall_establish(_netbsd32, netbsd32_kern_sig_16_syscalls);
+return EBUSY;
+}
+
+	rw_enter(_lock, RW_WRITER);
+	exec_sigcode_free(_netbsd);
+	emul_netbsd32.e_sigcode = NULL;
+   	emul_netbsd32.e_esigcode = NULL;
+   	emul_netbsd32.e_sigobject = NULL;
+	rw_exit(_lock);
+	netbsd32_machdep_md_16_fini();
+	return 0;
+}
+
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16, "compat_netbsd32_20,compat_16");
+
+static int
+compat_netbsd32_16_modcmd(modcmd_t cmd, void *arg)
+{
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-		rw_enter(_lock, RW_WRITER);
-		emul_netbsd32.e_sigcode = netbsd32_sigcode;
-	emul_netbsd32.e_esigcode = netbsd32_esigcode;
-	emul_netbsd32.e_sigobject = _netbsd32_object;
-		error = exec_sigcode_alloc(_netbsd);
-		if (error) {
-			emul_netbsd32.e_sigcode = NULL;
-			emul_netbsd32.e_esigcode = NULL;
-			emul_netbsd32.e_sigobject = NULL;
-		}
-		rw_exit(_lock);
-		if (error)
-			return error;
-		netbsd32_machdep_md_16_init();
-		return 0;
+		return compat_netbsd32_16_init();
 
 	case MODULE_CMD_FINI:
-		rw_enter(_lock, RW_WRITER);
-		exec_sigcode_free(_netbsd);
-		emul_netbsd32.e_sigcode = NULL;
-	emul_netbsd32.e_esigcode = NULL;
-	emul_netbsd32.e_sigobject = NULL;
-		rw_exit(_lock);
-		netbsd32_machdep_md_16_fini();
-		return 0;
+		return compat_netbsd32_16_fini();
 
 	default:
 		return ENOTTY;



CVS commit: src/sys/compat/netbsd32

2024-05-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May  1 07:22:43 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysent.c

Log Message:
Revert previous, the syscall needs to be enabled at runtime.

The compat_16 module just enables it for the "netbsd" emulation, but
nothing enables it yet for "netbsd32".


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_sysent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.159 src/sys/compat/netbsd32/netbsd32_sysent.c:1.160
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.159	Tue Apr 30 17:10:22 2024
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Wed May  1 07:22:43 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.160 2024/05/01 07:22:43 mlelstv Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.160 2024/05/01 07:22:43 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1280,7 +1280,7 @@ struct sysent netbsd32_sysent[] = {
 	},		/* 294 = netbsd32___sigsuspend14 */
 	{
 		ns(struct compat_16_netbsd32___sigreturn14_args),
-		.sy_call = (sy_call_t *)compat_16_netbsd32___sigreturn14
+		.sy_call = (sy_call_t *)sys_nomodule
 	},		/* 295 = compat_16_netbsd32___sigreturn14 */
 	{
 		ns(struct netbsd32___getcwd_args),



CVS commit: src/sys/compat/netbsd32

2024-05-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May  1 07:22:43 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysent.c

Log Message:
Revert previous, the syscall needs to be enabled at runtime.

The compat_16 module just enables it for the "netbsd" emulation, but
nothing enables it yet for "netbsd32".


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_sysent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-04-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Apr 30 17:10:22 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysent.c

Log Message:
Enable compat sigreturn system call.

The previous bug in netbsd32___sigaction_sigtramp hid the problem,
as it failed all but the first installation of a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_sysent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.158 src/sys/compat/netbsd32/netbsd32_sysent.c:1.159
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.158	Sun Jul 30 06:53:13 2023
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Tue Apr 30 17:10:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.158 2023/07/30 06:53:13 rin Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.158 2023/07/30 06:53:13 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1280,7 +1280,7 @@ struct sysent netbsd32_sysent[] = {
 	},		/* 294 = netbsd32___sigsuspend14 */
 	{
 		ns(struct compat_16_netbsd32___sigreturn14_args),
-		.sy_call = (sy_call_t *)sys_nomodule
+		.sy_call = (sy_call_t *)compat_16_netbsd32___sigreturn14
 	},		/* 295 = compat_16_netbsd32___sigreturn14 */
 	{
 		ns(struct netbsd32___getcwd_args),



CVS commit: src/sys/compat/netbsd32

2024-04-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Apr 30 17:10:22 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysent.c

Log Message:
Enable compat sigreturn system call.

The previous bug in netbsd32___sigaction_sigtramp hid the problem,
as it failed all but the first installation of a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_sysent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-04-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 29 14:56:01 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_signal.c

Log Message:
In netbsd32___sigaction_sigtramp continue to use the compat module when
already locked for this process.

Needs pullup to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_signal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2024-04-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 29 14:56:01 UTC 2024

Modified Files:
src/sys/compat/netbsd32: netbsd32_signal.c

Log Message:
In netbsd32___sigaction_sigtramp continue to use the compat module when
already locked for this process.

Needs pullup to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_signal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.53 src/sys/compat/netbsd32/netbsd32_signal.c:1.54
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.53	Sat Nov  6 20:42:56 2021
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Mon Apr 29 14:56:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.53 2021/11/06 20:42:56 thorpej Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.54 2024/04/29 14:56:01 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.53 2021/11/06 20:42:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.54 2024/04/29 14:56:01 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -184,7 +184,7 @@ netbsd32___sigaction_sigtramp(struct lwp
 		 */
 #ifdef __HAVE_STRUCT_SIGCONTEXT
 		struct proc *p = l->l_proc;
-		bool sigcontext_valid = false;
+		bool sigcontext_valid;
 
 		/*
 		 * We need to ensure the compat_netbsd32_16 module
@@ -196,9 +196,7 @@ netbsd32___sigaction_sigtramp(struct lwp
 			kernconfig_lock();
 			(void)module_autoload("compat_netbsd32_16",
 			MODULE_CLASS_ANY);
-			if (netbsd32_sendsig_sigcontext_16_hook.hooked) {
-sigcontext_valid = true;
-			}
+			sigcontext_valid = netbsd32_sendsig_sigcontext_16_hook.hooked;
 			mutex_enter(_lock);
 			/*
 			 * Prevent unload of compat module while
@@ -207,6 +205,11 @@ netbsd32___sigaction_sigtramp(struct lwp
 			p->p_lflag |= PL_SIGCOMPAT;
 			mutex_exit(_lock);
 			kernconfig_unlock();
+		} else {
+			/*
+			 * Module is already loaded and locked in memory
+			 */
+			sigcontext_valid = netbsd32_sendsig_sigcontext_16_hook.hooked;
 		}
 		if (!sigcontext_valid) {
 			return EINVAL;



CVS commit: src/sys/compat/ufs/lfs

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 16:28:44 UTC 2024

Added Files:
src/sys/compat/ufs/lfs: lfs_extern.h

Log Message:
add compat decls


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/compat/ufs/lfs/lfs_extern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/ufs/lfs

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 16:28:44 UTC 2024

Added Files:
src/sys/compat/ufs/lfs: lfs_extern.h

Log Message:
add compat decls


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/compat/ufs/lfs/lfs_extern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/compat/ufs/lfs/lfs_extern.h
diff -u /dev/null src/sys/compat/ufs/lfs/lfs_extern.h:1.1
--- /dev/null	Sat Jan 20 11:28:44 2024
+++ src/sys/compat/ufs/lfs/lfs_extern.h	Sat Jan 20 11:28:43 2024
@@ -0,0 +1,13 @@
+/*	$NetBSD: lfs_extern.h,v 1.1 2024/01/20 16:28:43 christos Exp $	*/
+
+#ifndef _COMPAT_UFS_LFS_LFS_EXTERN_H_
+#define _COMPAT_UFS_LFS_LFS_EXTERN_H_
+
+__BEGIN_DECLS
+#ifndef _KERNEL
+int lfs_segwait(fsid_t *, struct timeval50 *);
+int __lfs_segwait50(fsid_t *, struct timeval *);
+#endif
+__END_DECLS
+
+#endif /* !_COMPAT_UFS_LFS_LFS_EXTERN_H_ */



CVS commit: src/sys/compat/sys

2024-01-20 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Jan 20 08:40:37 UTC 2024

Modified Files:
src/sys/compat/sys: resource.h

Log Message:
Now that rusage_to_rusage50() has switched from being an external
function, to a static inline, we need  for it to work.
Not all callers provide that (and nor should they need to), so include
it here.

Should unbreak the builds.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/resource.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/sys/resource.h
diff -u src/sys/compat/sys/resource.h:1.6 src/sys/compat/sys/resource.h:1.7
--- src/sys/compat/sys/resource.h:1.6	Fri Jan 19 18:39:15 2024
+++ src/sys/compat/sys/resource.h	Sat Jan 20 08:40:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: resource.h,v 1.6 2024/01/19 18:39:15 christos Exp $	*/
+/*	$NetBSD: resource.h,v 1.7 2024/01/20 08:40:37 kre Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -35,6 +35,7 @@
 #define	_COMPAT_SYS_RESOURCE_H_
 
 #include 
+#include 
 #include 
 #include 
 



CVS commit: src/sys/compat/sys

2024-01-20 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Jan 20 08:40:37 UTC 2024

Modified Files:
src/sys/compat/sys: resource.h

Log Message:
Now that rusage_to_rusage50() has switched from being an external
function, to a static inline, we need  for it to work.
Not all callers provide that (and nor should they need to), so include
it here.

Should unbreak the builds.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/resource.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat

2024-01-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 19 18:39:15 UTC 2024

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/compat/sys: mount.h resource.h statvfs.h

Log Message:
Add missing decls, make rusage_to_rusage50 static inline.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/sys/mount.h
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/resource.h
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/statvfs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.37 src/sys/compat/common/kern_time_50.c:1.38
--- src/sys/compat/common/kern_time_50.c:1.37	Tue Sep  7 07:43:02 2021
+++ src/sys/compat/common/kern_time_50.c	Fri Jan 19 13:39:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.37 2021/09/07 11:43:02 riastradh Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.38 2024/01/19 18:39:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.37 2021/09/07 11:43:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.38 2024/01/19 18:39:15 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -456,18 +456,6 @@ compat_50_sys_mq_timedreceive(struct lwp
 #endif
 }
 
-void
-rusage_to_rusage50(const struct rusage *ru, struct rusage50 *ru50)
-{
-	memset(ru50, 0, sizeof(*ru50));
-	(void)memcpy(>ru_first, >ru_first,
-	(char *)>ru_last - (char *)>ru_first +
-	sizeof(ru50->ru_last));
-	ru50->ru_maxrss = ru->ru_maxrss;
-	timeval_to_timeval50(>ru_utime, >ru_utime);
-	timeval_to_timeval50(>ru_stime, >ru_stime);
-}
-
 int
 compat_50_sys_getrusage(struct lwp *l,
 const struct compat_50_sys_getrusage_args *uap, register_t *retval)

Index: src/sys/compat/sys/mount.h
diff -u src/sys/compat/sys/mount.h:1.15 src/sys/compat/sys/mount.h:1.16
--- src/sys/compat/sys/mount.h:1.15	Mon Aug 30 04:40:00 2021
+++ src/sys/compat/sys/mount.h	Fri Jan 19 13:39:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.15 2021/08/30 08:40:00 riastradh Exp $	*/
+/*	$NetBSD: mount.h,v 1.16 2024/01/19 18:39:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -194,6 +194,12 @@ int	__compat___fhstat30(const struct com
 int	__compat___fhstat40(const void *, size_t, struct stat30 *) __dso_hidden;
 struct stat;
 int	__fhstat50(const void *, size_t, struct stat *);
+int	__fhopen40(const void *, size_t, int);
+int	fhopen(const struct compat_30_fhandle *, int);
+int __getfh30(const char *, void*, size_t *);
+int	getfh(const char *path, struct compat_30_fhandle *fhp);
+int	mount(const char *, const char *, int, void *);
+int	__mount50(const char *, const char *, int, void *, size_t);
 #endif /* _NETBSD_SOURCE */
 __END_DECLS
 

Index: src/sys/compat/sys/resource.h
diff -u src/sys/compat/sys/resource.h:1.5 src/sys/compat/sys/resource.h:1.6
--- src/sys/compat/sys/resource.h:1.5	Fri Oct  4 17:07:37 2013
+++ src/sys/compat/sys/resource.h	Fri Jan 19 13:39:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: resource.h,v 1.5 2013/10/04 21:07:37 christos Exp $	*/
+/*	$NetBSD: resource.h,v 1.6 2024/01/19 18:39:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -57,7 +57,17 @@ struct	rusage50 {
 	long	ru_nivcsw;		/* involuntary " */
 };
 
-void rusage_to_rusage50(const struct rusage *, struct rusage50 *);
+static __inline void
+rusage_to_rusage50(const struct rusage *ru, struct rusage50 *ru50)
+{
+	memset(ru50, 0, sizeof(*ru50));
+	(void)memcpy(>ru_first, >ru_first,
+	(char *)>ru_last - (char *)>ru_first +
+	sizeof(ru50->ru_last));
+	ru50->ru_maxrss = ru->ru_maxrss;
+	timeval_to_timeval50(>ru_utime, >ru_utime);
+	timeval_to_timeval50(>ru_stime, >ru_stime);
+}
 
 #ifndef _KERNEL
 __BEGIN_DECLS

Index: src/sys/compat/sys/statvfs.h
diff -u src/sys/compat/sys/statvfs.h:1.4 src/sys/compat/sys/statvfs.h:1.5
--- src/sys/compat/sys/statvfs.h:1.4	Tue Sep  7 07:43:05 2021
+++ src/sys/compat/sys/statvfs.h	Fri Jan 19 13:39:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: statvfs.h,v 1.4 2021/09/07 11:43:05 riastradh Exp $	 */
+/*	$NetBSD: statvfs.h,v 1.5 2024/01/19 18:39:15 christos Exp $	 */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -155,6 +155,10 @@ int	__getvfsstat90(struct statvfs *, siz
 
 int	__getmntinfo90(struct statvfs **, int);
 
+struct compat_30_fhandle;
+int	fhstatvfs(const struct compat_30_fhandle *, struct statvfs90 *);
+int	fhstatvfs1(const struct compat_30_fhandle *, struct statvfs90 *, int);
+
 #endif /* __LIBC12_SOURCE__ */
 
 #endif /* _KERNEL */



CVS commit: src/sys/compat

2024-01-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 19 18:39:15 UTC 2024

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/compat/sys: mount.h resource.h statvfs.h

Log Message:
Add missing decls, make rusage_to_rusage50 static inline.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/sys/mount.h
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/resource.h
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/statvfs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/common

2023-12-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sat Dec  9 20:31:57 UTC 2023

Modified Files:
src/sys/compat/common: compat_90_mod.c net_inet6_nd_90.c

Log Message:
Allow kernels builds which don't define INET6 to compile compat bits too.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_90_mod.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/net_inet6_nd_90.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/common

2023-12-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sat Dec  9 20:31:57 UTC 2023

Modified Files:
src/sys/compat/common: compat_90_mod.c net_inet6_nd_90.c

Log Message:
Allow kernels builds which don't define INET6 to compile compat bits too.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_90_mod.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/net_inet6_nd_90.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/compat_90_mod.c
diff -u src/sys/compat/common/compat_90_mod.c:1.5 src/sys/compat/common/compat_90_mod.c:1.6
--- src/sys/compat/common/compat_90_mod.c:1.5	Sat Dec  9 15:21:01 2023
+++ src/sys/compat/common/compat_90_mod.c	Sat Dec  9 20:31:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_90_mod.c,v 1.5 2023/12/09 15:21:01 pgoyette Exp $	*/
+/*	$NetBSD: compat_90_mod.c,v 1.6 2023/12/09 20:31:57 oster Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.5 2023/12/09 15:21:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.6 2023/12/09 20:31:57 oster Exp $");
 
 #include 
 #include 
@@ -50,7 +50,9 @@ int
 compat_90_init(void)
 {
 
+#ifdef INET6
 	net_inet6_nd_90_init();
+#endif
 	return vfs_syscalls_90_init();
 }
 
@@ -63,7 +65,9 @@ compat_90_fini(void)
 	if (error != 0)
 		return error;
 
+#ifdef INET6
 	net_inet6_nd_90_fini();
+#endif
 	return error;
 }
 

Index: src/sys/compat/common/net_inet6_nd_90.c
diff -u src/sys/compat/common/net_inet6_nd_90.c:1.1 src/sys/compat/common/net_inet6_nd_90.c:1.2
--- src/sys/compat/common/net_inet6_nd_90.c:1.1	Sat Dec  9 15:21:01 2023
+++ src/sys/compat/common/net_inet6_nd_90.c	Sat Dec  9 20:31:57 2023
@@ -1,6 +1,6 @@
-/*	$NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $ */
+/*	$NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $ */
 
-/*  $NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $*/
+/*  $NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $*/
 /*  $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $   */
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: net_inet6_nd
 
 #include 
 
+#ifdef INET6
+
 static struct sysctllog *nd6_clog;
 
 /*
@@ -128,3 +130,6 @@ net_inet6_nd_90_fini(void)
 	MODULE_HOOK_UNSET(net_inet6_nd_90_hook);
 	return 0;
 }
+
+#endif /* INET6 */
+



CVS commit: src/sys/compat/netbsd32

2023-09-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  2 21:11:54 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
redo previous: use same variable type for the interator as the comparison


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_epoll.c
diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.4 src/sys/compat/netbsd32/netbsd32_epoll.c:1.5
--- src/sys/compat/netbsd32/netbsd32_epoll.c:1.4	Wed Aug 30 22:15:06 2023
+++ src/sys/compat/netbsd32/netbsd32_epoll.c	Sat Sep  2 21:11:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $	*/
+/*	$NetBSD: netbsd32_epoll.c,v 1.5 2023/09/02 21:11:54 mrg Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.5 2023/09/02 21:11:54 mrg Exp $");
 
 #include 
 #include 
@@ -135,7 +135,7 @@ netbsd32_epoll_pwait2(struct lwp *l,
 	struct netbsd32_epoll_event *events32 =
 	kmem_alloc(*retval * sizeof(*events32), KM_SLEEP);
 
-	for (unsigned i = 0; i < *retval; i++)
+	for (register_t i = 0; i < *retval; i++)
 		netbsd32_from_epoll_event([i], [i]);
 
 	error = copyout(events, SCARG_P32(uap, events),



CVS commit: src/sys/compat/netbsd32

2023-09-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  2 21:11:54 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
redo previous: use same variable type for the interator as the comparison


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-08-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Aug 30 22:15:06 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
use unsigned for iterator, fixes -Wsigned-comapre issue in module build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_epoll.c
diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.3 src/sys/compat/netbsd32/netbsd32_epoll.c:1.4
--- src/sys/compat/netbsd32/netbsd32_epoll.c:1.3	Sun Jul 30 07:56:15 2023
+++ src/sys/compat/netbsd32/netbsd32_epoll.c	Wed Aug 30 22:15:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $	*/
+/*	$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $");
 
 #include 
 #include 
@@ -135,7 +135,7 @@ netbsd32_epoll_pwait2(struct lwp *l,
 	struct netbsd32_epoll_event *events32 =
 	kmem_alloc(*retval * sizeof(*events32), KM_SLEEP);
 
-	for (int i = 0; i < *retval; i++)
+	for (unsigned i = 0; i < *retval; i++)
 		netbsd32_from_epoll_event([i], [i]);
 
 	error = copyout(events, SCARG_P32(uap, events),



CVS commit: src/sys/compat/netbsd32

2023-08-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Aug 30 22:15:06 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
use unsigned for iterator, fixes -Wsigned-comapre issue in module build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Theodore Preduta
On 2023-08-25 13:30, Taylor R Campbell wrote:
> Since VOP_READDIR requires vp to be locked, I can infer that the
> handle_write caller must already hold vp locked.  But that means that
> we have ifd_lock -> vnode lock in one path, and vnode lock -> ifd_lock
> in another path, which is forbidden (unless there's some reason we can
> prove these paths never happen concurrently).

Hmm... I did not realize this, so I don't think NOTE_WRITE
disambiguation is (or has ever been) safe.

The real pain here is that we inherit a held vp_interlock and vnode lock
in the needs_lock=false case from the kevent callback.  So this may
require a pretty substantial locking revision(?)

Anyways, I'll take a closer look later this weekend.

> I'm also suspicious of logic like this:
> 
> mutex_enter(>f_lock);
> uio.uio_offset = fp->f_offset;
> mutex_exit(>f_lock);
> ...
> mutex_enter(>f_lock);
> fp->f_offset = uio.uio_offset;
> mutex_exit(>f_lock);
> 
> If fp->f_offset can change concurrently while f_lock is released, this
> looks like a problem.  But if it can't, why do we need the lock at
> all?  I suspect this really does need a lock over the whole
> transaction (maybe fp->f_lock, maybe something else), which is not
> released while I/O is happening -- possibly not with mutex(9) but
> something interruptible instead.

I think you're right about needing a lock for the whole transaction.
Since this is called from get_inotify_dir_entries(), perhaps it would be
better for get_inotify_dir_entries() to keep track of the offset and
pass it in instead?

Theo(dore)



Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Date: Fri, 25 Aug 2023 13:38:02 -0400
> From: Theodore Preduta 
> 
> On 2023-08-25 13:13, Taylor R Campbell wrote:
> > This can't be right, and it's a little unsettling that the problem
> > isn't caught by any automatic tests.
> > 
> > As I understand it, the `ie_name' member is supposed to provide
> > storage for the `ie_event.name' array.
> > 
> > So this looks like this change is going to lead either to a buffer
> > overrun -- reading someone else's heap memory, or scribbling all over
> > someone else's heap memory -- or to uninitialized or zero-filled
> > memory being published to userland where there should be a pathname.
> 
> I don't think so.  Notice that in inotify_read() two calls to uiomove()
> are made, one on ie_event and one on ie_name... and in general this code
> never accesses ie_event.name directly.
> 
> The reason I separated the fields in the first place was to make
> allocation/deallocation simpler, not to use ie_name as storage for
> ie_event.name.

Got it!  So that would explain why automatic tests didn't catch
anything.  Thanks!  Maybe we should have a comment about this to
clarify for future readers.

Side note: I realize there's a KASSERT protecting one of the strcpy
calls, and the other one is limited to copying from values of struct
dirent::d_name created by VOP_READDIR which should be limited to
NAME_MAX (plus NUL terminator).  But I'd be a little more comfortable
if we didn't use strcpy at all -- strlcpy is probably the right choice
here.  Might prefer to set buf->ie_event.len to MIN(strlen(name) + 1,
sizeof(buf->ie_name)) too, so that non-DIAGNOSTIC builds will truncate
the data rather than overrun the buffer.


Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Theodore Preduta
On 2023-08-25 13:13, Taylor R Campbell wrote:
>> Module Name:src
>> Committed By:   christos
>> Date:   Wed Aug 23 19:17:59 UTC 2023
>>
>> Modified Files:
>> src/sys/compat/linux/common: linux_inotify.c
>>
>> Log Message:
>> put variable length structure at the end, so that clang does not complain.
>>
>>  struct inotify_entry {
>> TAILQ_ENTRY(inotify_entry)  ie_entries;
>> +   charie_name[NAME_MAX + 1];
>> struct linux_inotify_event  ie_event;
>> -   charie_name[NAME_MAX+1];
>>  };
> 
> This can't be right, and it's a little unsettling that the problem
> isn't caught by any automatic tests.
> 
> As I understand it, the `ie_name' member is supposed to provide
> storage for the `ie_event.name' array.
> 
> So this looks like this change is going to lead either to a buffer
> overrun -- reading someone else's heap memory, or scribbling all over
> someone else's heap memory -- or to uninitialized or zero-filled
> memory being published to userland where there should be a pathname.

I don't think so.  Notice that in inotify_read() two calls to uiomove()
are made, one on ie_event and one on ie_name... and in general this code
never accesses ie_event.name directly.

The reason I separated the fields in the first place was to make
allocation/deallocation simpler, not to use ie_name as storage for
ie_event.name.

Theo(dore)



Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Module Name:src
> Committed By:   christos
> Date:   Thu Aug 24 19:51:24 UTC 2023
> 
> Modified Files:
> src/sys/compat/linux/common: linux_inotify.c
> 
> Log Message:
> fix a locking bug (Theodore Preduta)
> 
> if (needs_lock)
> vn_lock(vp, LK_SHARED | LK_RETRY);
> +   else
> +   /*
> +* XXX We need to temprarily drop v_interlock because
> +* it may be temporarily acquired by biowait().
> +*/
> +   mutex_exit(vp->v_interlock);
> +   KASSERT(!mutex_owned(vp->v_interlock));
> error = VOP_READDIR(vp, , fp->f_cred, , NULL, NULL);
> if (needs_lock)
> VOP_UNLOCK(vp);
> +   else
> +   mutex_enter(vp->v_interlock);

This looks questionable.

1. Why is v_interlock held in the first place?

2. Why is it safe to release v_interlock here, if the caller holds it?

3. What is the lock order for all the locks involved?

I see that inotify_readdir via get_inotify_dir_entries has two call
sites, leading to the following lock orders:

- linux_sys_inotify_add_watch
  -> mutex_enter(>ifd_lock)
  -> get_inotify_dir_entries(..., needs_lock=true)
 -> inotify_readdir(..., needs_lock=true)
-> vn_lock(vp)
-> VOP_READDIR(vp)

- handle_write
  -> mutex_enter(>ifd_lock)
  -> get_inotify_dir_entries(..., needs_lock=false)
 -> inotify_readdir(..., needs_lock=true)
-> mutex_exit(vp->v_interlock)
-> VOP_READDIR(vp)

Since VOP_READDIR requires vp to be locked, I can infer that the
handle_write caller must already hold vp locked.  But that means that
we have ifd_lock -> vnode lock in one path, and vnode lock -> ifd_lock
in another path, which is forbidden (unless there's some reason we can
prove these paths never happen concurrently).

I'm also suspicious of logic like this:

mutex_enter(>f_lock);
uio.uio_offset = fp->f_offset;
mutex_exit(>f_lock);
...
mutex_enter(>f_lock);
fp->f_offset = uio.uio_offset;
mutex_exit(>f_lock);

If fp->f_offset can change concurrently while f_lock is released, this
looks like a problem.  But if it can't, why do we need the lock at
all?  I suspect this really does need a lock over the whole
transaction (maybe fp->f_lock, maybe something else), which is not
released while I/O is happening -- possibly not with mutex(9) but
something interruptible instead.


Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Module Name:src
> Committed By:   christos
> Date:   Wed Aug 23 19:17:59 UTC 2023
> 
> Modified Files:
> src/sys/compat/linux/common: linux_inotify.c
> 
> Log Message:
> put variable length structure at the end, so that clang does not complain.
> 
>  struct inotify_entry {
> TAILQ_ENTRY(inotify_entry)  ie_entries;
> +   charie_name[NAME_MAX + 1];
> struct linux_inotify_event  ie_event;
> -   charie_name[NAME_MAX+1];
>  };

This can't be right, and it's a little unsettling that the problem
isn't caught by any automatic tests.

As I understand it, the `ie_name' member is supposed to provide
storage for the `ie_event.name' array.

So this looks like this change is going to lead either to a buffer
overrun -- reading someone else's heap memory, or scribbling all over
someone else's heap memory -- or to uninitialized or zero-filled
memory being published to userland where there should be a pathname.

We need to do this in a different way.  (It's annoying that C doesn't
formally allow the original code, since in principle it is sensible.)
Perhaps we can delete the struct inotify_entry::ie_name member, and
instead of using

struct inotify_event *ie = kmem_zalloc(sizeof(*ie), ...);

do

struct inotify_event *ie = kmem_zalloc(
offsetof(struct inotify_event, ie_event.name[NAME_MAX + 1]),
...);

and similarly for kmem_free.


CVS commit: src/sys/compat/linux/common

2023-08-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 24 19:51:24 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
fix a locking bug (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-08-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 24 19:51:24 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
fix a locking bug (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_inotify.c
diff -u src/sys/compat/linux/common/linux_inotify.c:1.4 src/sys/compat/linux/common/linux_inotify.c:1.5
--- src/sys/compat/linux/common/linux_inotify.c:1.4	Wed Aug 23 15:17:59 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Thu Aug 24 15:51:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_inotify.c,v 1.4 2023/08/23 19:17:59 christos Exp $	*/
+/*	$NetBSD: linux_inotify.c,v 1.5 2023/08/24 19:51:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.4 2023/08/23 19:17:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.5 2023/08/24 19:51:24 christos Exp $");
 
 #include 
 #include 
@@ -790,9 +790,18 @@ inotify_readdir(file_t *fp, struct diren
 	/* XXX: should pass whether to lock or not */
 	if (needs_lock)
 		vn_lock(vp, LK_SHARED | LK_RETRY);
+	else
+		/*
+		 * XXX We need to temprarily drop v_interlock because
+		 * it may be temporarily acquired by biowait().
+		 */
+		mutex_exit(vp->v_interlock);
+	KASSERT(!mutex_owned(vp->v_interlock));
 	error = VOP_READDIR(vp, , fp->f_cred, , NULL, NULL);
 	if (needs_lock)
 		VOP_UNLOCK(vp);
+	else
+		mutex_enter(vp->v_interlock);
 
 	mutex_enter(>f_lock);
 	fp->f_offset = uio.uio_offset;
@@ -1107,7 +1116,7 @@ inotify_filt_event(struct knote *kn, lon
 		cv_signal(>ifd_qcv);
 
 		mutex_enter(>ifd_lock);
-		selnotify(>ifd_sel, 0, 0);
+		selnotify(>ifd_sel, 0, NOTE_LOWAT);
 		mutex_exit(>ifd_lock);
 	} else
 		DPRINTF(("%s: hint=%lx resulted in 0 inotify events\n",
@@ -1295,14 +1304,17 @@ inotify_read_filt_detach(struct knote *k
 static int
 inotify_read_filt_event(struct knote *kn, long hint)
 {
-	int rv;
 	struct inotifyfd *ifd = ((file_t *)kn->kn_obj)->f_data;
 
-	mutex_enter(>ifd_qlock);
-	rv = (ifd->ifd_qcount > 0);
-	mutex_exit(>ifd_qlock);
+	if (hint != 0) {
+		KASSERT(mutex_owned(>ifd_lock));
+		KASSERT(mutex_owned(>ifd_qlock));
+		KASSERT(hint == NOTE_LOWAT);
+
+		kn->kn_data = ifd->ifd_qcount;
+	}
 
-	return rv;
+	return kn->kn_data > 0;
 }
 
 /*



CVS commit: src/sys/compat/linux/common

2023-08-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 23 19:17:59 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
put variable length structure at the end, so that clang does not complain.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_inotify.c
diff -u src/sys/compat/linux/common/linux_inotify.c:1.3 src/sys/compat/linux/common/linux_inotify.c:1.4
--- src/sys/compat/linux/common/linux_inotify.c:1.3	Tue Aug 22 08:02:34 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Wed Aug 23 15:17:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $	*/
+/*	$NetBSD: linux_inotify.c,v 1.4 2023/08/23 19:17:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.4 2023/08/23 19:17:59 christos Exp $");
 
 #include 
 #include 
@@ -84,8 +84,8 @@ __KERNEL_RCSID(0, "$NetBSD: linux_inotif
 
 struct inotify_entry {
 	TAILQ_ENTRY(inotify_entry)	ie_entries;
+	charie_name[NAME_MAX + 1];
 	struct linux_inotify_event	ie_event;
-	charie_name[NAME_MAX+1];
 };
 
 struct inotify_dir_entries {



CVS commit: src/sys/compat/linux/common

2023-08-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 23 19:17:59 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
put variable length structure at the end, so that clang does not complain.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 12:02:34 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
aarch64 does not have sys_inotify_init()...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_inotify.c
diff -u src/sys/compat/linux/common/linux_inotify.c:1.2 src/sys/compat/linux/common/linux_inotify.c:1.3
--- src/sys/compat/linux/common/linux_inotify.c:1.2	Sun Aug 20 14:09:25 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Tue Aug 22 08:02:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $	*/
+/*	$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $");
 
 #include 
 #include 
@@ -331,6 +331,7 @@ leave0:
 	return error;
 }
 
+#ifndef __aarch64__
 /*
  * inotify_init(2).  Initialize a new inotify fd with flags=0.
  */
@@ -339,6 +340,7 @@ linux_sys_inotify_init(struct lwp *l, co
 {
 	return do_inotify_init(l, retval, 0);
 }
+#endif
 
 /*
  * inotify_init(2).  Initialize a new inotify fd with the given flags.



CVS commit: src/sys/compat/linux/common

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 12:02:34 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
aarch64 does not have sys_inotify_init()...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/compat/linux

2023-08-21 Thread Christos Zoulas
Yes, I committed it (I had the change in my tree).

Best,

christos

> On Aug 21, 2023, at 3:40 PM, Ryo ONODERA  wrote:
> 
> Hi,
> 
> "Christos Zoulas"  writes:
> 
>> Module Name: src
>> Committed By:christos
>> Date:Sun Aug 20 18:08:57 UTC 2023
>> 
>> Modified Files:
>>  src/sys/compat/linux: files.linux
>> 
>> Log Message:
>> add inotify (forgot to commit this)
>> 
>> 
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/files.linux
>> 
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
> 
> The compat_linux kernel module is also required to have inotify.
> The following patch fixes my error from 'modload compat_linux'.
> 
> # modload compat_linux
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_sys_inotify_add_watch' not found
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_sys_inotify_init1' not found
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_sys_inotify_rm_watch' not found
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_inotify_init' not found
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_sys_inotify_init' not found
> [ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
> `linux_inotify_fini' not found
> [ 14619.3999280] WARNING: module error: unable to affix module 
> `compat_linux', error 8
> 
> Patch:
> Index: sys/modules/compat_linux/Makefile
> ===
> RCS file: /cvsroot/src/sys/modules/compat_linux/Makefile,v
> retrieving revision 1.6
> diff -u -r1.6 Makefile
> --- sys/modules/compat_linux/Makefile 9 Oct 2021 07:01:35 -   1.6
> +++ sys/modules/compat_linux/Makefile 21 Aug 2023 19:37:08 -
> @@ -9,7 +9,8 @@
> 
> .PATH:${S}/compat/linux/common
> SRCS= linux_blkio.c linux_cdrom.c linux_errno.c linux_exec.c
> -SRCS+=   linux_fdio.c linux_file.c linux_hdio.c linux_ioctl.c
> +SRCS+=   linux_fdio.c linux_file.c linux_hdio.c linux_inotify.c
> +SRCS+=   linux_ioctl.c
> SRCS+=linux_ipc.c linux_misc.c linux_mtio.c linux_sched.c
> SRCS+=linux_sg.c linux_signal.c linux_signo.c linux_socket.c
> SRCS+=linux_sysctl.c linux_termios.c linux_time.c linux_mod.c
> 
> Thank you.
> 
> --
> Ryo ONODERA // r...@tetera.org
> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3



signature.asc
Description: Message signed with OpenPGP


Re: CVS commit: src/sys/compat/linux

2023-08-21 Thread Ryo ONODERA
Hi,

"Christos Zoulas"  writes:

> Module Name:  src
> Committed By: christos
> Date: Sun Aug 20 18:08:57 UTC 2023
>
> Modified Files:
>   src/sys/compat/linux: files.linux
>
> Log Message:
> add inotify (forgot to commit this)
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/files.linux
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.

The compat_linux kernel module is also required to have inotify.
The following patch fixes my error from 'modload compat_linux'.

# modload compat_linux
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_sys_inotify_add_watch' not found
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_sys_inotify_init1' not found
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_sys_inotify_rm_watch' not found
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_inotify_init' not found
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_sys_inotify_init' not found
[ 14619.3999280] kobj_checksyms, 1013: [compat_linux]: linker error: symbol 
`linux_inotify_fini' not found
[ 14619.3999280] WARNING: module error: unable to affix module `compat_linux', 
error 8

Patch:
Index: sys/modules/compat_linux/Makefile
===
RCS file: /cvsroot/src/sys/modules/compat_linux/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- sys/modules/compat_linux/Makefile   9 Oct 2021 07:01:35 -   1.6
+++ sys/modules/compat_linux/Makefile   21 Aug 2023 19:37:08 -
@@ -9,7 +9,8 @@
 
 .PATH: ${S}/compat/linux/common
 SRCS=  linux_blkio.c linux_cdrom.c linux_errno.c linux_exec.c
-SRCS+= linux_fdio.c linux_file.c linux_hdio.c linux_ioctl.c
+SRCS+= linux_fdio.c linux_file.c linux_hdio.c linux_inotify.c
+SRCS+= linux_ioctl.c
 SRCS+= linux_ipc.c linux_misc.c linux_mtio.c linux_sched.c
 SRCS+= linux_sg.c linux_signal.c linux_signo.c linux_socket.c
 SRCS+= linux_sysctl.c linux_termios.c linux_time.c linux_mod.c

Thank you.

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/sys/compat/linux/common

2023-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 20 18:09:25 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
fix locking: eliminate using mutex_owned() (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_inotify.c
diff -u src/sys/compat/linux/common/linux_inotify.c:1.1 src/sys/compat/linux/common/linux_inotify.c:1.2
--- src/sys/compat/linux/common/linux_inotify.c:1.1	Sat Aug 19 13:57:54 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Sun Aug 20 14:09:25 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_inotify.c,v 1.1 2023/08/19 17:57:54 christos Exp $	*/
+/*	$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.1 2023/08/19 17:57:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $");
 
 #include 
 #include 
@@ -135,8 +135,8 @@ static void	do_kevent_to_inotify(int32_t
 struct inotify_entry *, size_t *, char *);
 static int	kevent_to_inotify(struct inotifyfd *, int, enum vtype, uint32_t,
 uint32_t, struct inotify_entry *, size_t *);
-static int	inotify_readdir(file_t *, struct dirent *, int *);
-static struct inotify_dir_entries *get_inotify_dir_entries(int);
+static int	inotify_readdir(file_t *, struct dirent *, int *, bool);
+static struct inotify_dir_entries *get_inotify_dir_entries(int, bool);
 
 static int	inotify_filt_attach(struct knote *);
 static void	inotify_filt_detach(struct knote *);
@@ -417,15 +417,15 @@ linux_sys_inotify_add_watch(struct lwp *
 		syscallarg(const char *) pathname;
 		syscallarg(uint32_t) mask;
 	} */
-	int wd, dup_of_wd, i, error = 0;
+	int wd, i, error = 0;
 	file_t *fp, *wp, *cur_fp;
-	struct stat wst, cur_st;
 	struct inotifyfd *ifd;
 	struct inotify_dir_entries **new_wds;
 	struct knote *kn, *tmpkn;
 	struct sys_open_args oa;
 	struct kevent kev;
-	enum vtype wtype;
+	struct vnode *wvp;
+	namei_simple_flags_t sflags;
 	struct kevent_ops k_ops = {
 		.keo_private = NULL,
 		.keo_fetch_timeout = NULL,
@@ -452,38 +452,16 @@ linux_sys_inotify_add_watch(struct lwp *
 
 	mutex_enter(>ifd_lock);
 
-	/* open a new file descriptor for the watch descriptor */
-	SCARG(, path) = SCARG(uap, pathname);
-	SCARG(, mode) = 0;
-	SCARG(, flags) = O_RDONLY;
 	if (mask & LINUX_IN_DONT_FOLLOW)
-		SCARG(, flags) |= O_NOFOLLOW;
-	if (mask & LINUX_IN_ONLYDIR)
-		SCARG(, flags) |= O_DIRECTORY;
-
-	error = sys_open(l, , retval);
+		sflags = NSM_NOFOLLOW_TRYEMULROOT;
+	else
+		sflags = NSM_FOLLOW_TRYEMULROOT;
+	error = namei_simple_user(SCARG(uap, pathname), sflags, );
 	if (error != 0)
 		goto leave1;
-	wd = *retval;
-
-	wp = fd_getfile(wd);
-	KASSERT(wp != NULL);
-	wtype = wp->f_vnode->v_type;
-	error = vn_stat(wp->f_vnode, );
-	fd_putfile(wd);
-	if (error != 0)
-		goto leave1;
-
-	/* translate the flags */
-	memset(, 0, sizeof(kev));
-	EV_SET(, wd, inotify_filtid, EV_ADD|EV_ENABLE,
-	NOTE_DELETE|NOTE_REVOKE, 0, ifd);
-	if (mask & LINUX_IN_ONESHOT)
-		kev.flags |= EV_ONESHOT;
-	kev.fflags |= inotify_mask_to_kevent_fflags(mask, wtype);
 
 	/* Check to see if we already have a descriptor to wd's file. */
-dup_of_wd = -1;
+wd = -1;
 	for (i = 0; i < ifd->ifd_nwds; i++) {
 		if (ifd->ifd_wds[i] != NULL) {
 			cur_fp = fd_getfile(i);
@@ -498,24 +476,47 @@ linux_sys_inotify_add_watch(struct lwp *
 "with a non-vnode\n", __func__, i));
 error = EBADF;
 			}
-			if (error == 0)
-error = vn_stat(cur_fp->f_vnode, _st);
+			if (error == 0 && cur_fp->f_vnode == wvp)
+wd = i;
 			fd_putfile(i);
 			if (error != 0)
 goto leave1;
 
-			if (wst.st_ino == cur_st.st_ino) {
-			dup_of_wd = i;
+			if (wd != -1)
 break;
-			}
 		}
 	}
 
-	if (dup_of_wd != -1) {
+	if (wd == -1) {
 		/*
-		 * If we do not have a descriptor to wd's file, we need to add
-		 * a knote.
+		 * If we do not have a descriptor to wd's file, we
+		 * need to open the watch descriptor.
 		 */
+		SCARG(, path) = SCARG(uap, pathname);
+		SCARG(, mode) = 0;
+		SCARG(, flags) = O_RDONLY;
+		if (mask & LINUX_IN_DONT_FOLLOW)
+			SCARG(, flags) |= O_NOFOLLOW;
+		if (mask & LINUX_IN_ONLYDIR)
+			SCARG(, flags) |= O_DIRECTORY;
+
+		error = sys_open(l, , retval);
+		if (error != 0)
+			goto leave1;
+		wd = *retval;
+		wp = fd_getfile(wd);
+	KASSERT(wp != NULL);
+		KASSERT(wp->f_type == DTYPE_VNODE);
+
+		/* translate the flags */
+		memset(, 0, sizeof(kev));
+		EV_SET(, wd, inotify_filtid, EV_ADD|EV_ENABLE,
+		NOTE_DELETE|NOTE_REVOKE, 0, ifd);
+		if (mask & LINUX_IN_ONESHOT)
+			kev.flags |= EV_ONESHOT;
+		kev.fflags |= 

CVS commit: src/sys/compat/linux/common

2023-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 20 18:09:25 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
fix locking: eliminate using mutex_owned() (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/common/linux_inotify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux

2023-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 20 18:08:57 UTC 2023

Modified Files:
src/sys/compat/linux: files.linux

Log Message:
add inotify (forgot to commit this)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/files.linux

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/files.linux
diff -u src/sys/compat/linux/files.linux:1.22 src/sys/compat/linux/files.linux:1.23
--- src/sys/compat/linux/files.linux:1.22	Sat Jan 26 21:08:39 2019
+++ src/sys/compat/linux/files.linux	Sun Aug 20 14:08:57 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.linux,v 1.22 2019/01/27 02:08:39 pgoyette Exp $
+#	$NetBSD: files.linux,v 1.23 2023/08/20 18:08:57 christos Exp $
 #
 # Config file description for machine-independent Linux compat code.
 # Included by ports that need it.
@@ -17,6 +17,7 @@ file	compat/linux/common/linux_exec_aout
 file	compat/linux/common/linux_fdio.c	compat_linux
 file	compat/linux/common/linux_file.c	compat_linux
 file	compat/linux/common/linux_hdio.c	compat_linux
+file	compat/linux/common/linux_inotify.c	compat_linux
 file	compat/linux/common/linux_ioctl.c	compat_linux
 file	compat/linux/common/linux_ipc.c		compat_linux
 file	compat/linux/common/linux_misc.c	compat_linux



CVS commit: src/sys/compat/linux

2023-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 20 18:08:57 UTC 2023

Modified Files:
src/sys/compat/linux: files.linux

Log Message:
add inotify (forgot to commit this)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/files.linux

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:57:55 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_fcntl.h linux_mod.c
Added Files:
src/sys/compat/linux/common: linux_inotify.c linux_inotify.h

Log Message:
new inotify support GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/linux/common/linux_fcntl.h
cvs rdiff -u -r0 -r1.1 src/sys/compat/linux/common/linux_inotify.c \
src/sys/compat/linux/common/linux_inotify.h
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux/common/linux_mod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:57:55 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_fcntl.h linux_mod.c
Added Files:
src/sys/compat/linux/common: linux_inotify.c linux_inotify.h

Log Message:
new inotify support GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/linux/common/linux_fcntl.h
cvs rdiff -u -r0 -r1.1 src/sys/compat/linux/common/linux_inotify.c \
src/sys/compat/linux/common/linux_inotify.h
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux/common/linux_mod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_fcntl.h
diff -u src/sys/compat/linux/common/linux_fcntl.h:1.21 src/sys/compat/linux/common/linux_fcntl.h:1.22
--- src/sys/compat/linux/common/linux_fcntl.h:1.21	Sun Jul  9 22:31:55 2023
+++ src/sys/compat/linux/common/linux_fcntl.h	Sat Aug 19 13:57:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_fcntl.h,v 1.21 2023/07/10 02:31:55 christos Exp $	*/
+/*	$NetBSD: linux_fcntl.h,v 1.22 2023/08/19 17:57:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -32,6 +32,11 @@
 #ifndef _LINUX_FCNTL_H
 #define _LINUX_FCNTL_H
 
+#ifdef _KERNEL
+#include  /* For linux_off_t */
+struct stat;
+#endif
+
 /*
  * The arguments in the flock structure have a different order from the
  * BSD structure.
@@ -50,6 +55,7 @@
 #define LINUX_AT_NO_AUTOMOUNT		0x0800
 #define LINUX_AT_EMPTY_PATH		0x1000
 
+#ifdef _KERNEL
 int linux_to_bsd_ioflags(int);
 int linux_to_bsd_atflags(int);
 int bsd_to_linux_statx(struct stat *, struct linux_statx *, unsigned int);
@@ -70,6 +76,7 @@ struct linux_flock64 {
 	off_t	l_len;
 	linux_pid_t l_pid;
 };
+#endif /* _KERNEL */
 
 #if defined(__i386__)
 #include 
@@ -103,6 +110,7 @@ struct linux_flock64 {
 #define	LINUX_F_ADD_SEALS	(LINUX_F_SPECIFIC_BASE + 9)
 #define	LINUX_F_GET_SEALS	(LINUX_F_SPECIFIC_BASE + 10)
 
+#ifdef _KERNEL
 /*
  * We have to have 4 copies of the code that converts linux fcntl() file
  * locking to native form because there are 4 layouts for the structures.
@@ -171,6 +179,6 @@ LINUX##_to_bsd_##FLOCK(struct flock *bfp
 	LINUX##_to_bsd_##FLOCK(, ); \
 	return do_fcntl_lock(fd, cmd == setlk ? F_SETLK : F_SETLKW, ); \
 } while (0)
-
+#endif /* _KERNEL */
 
 #endif /* !_LINUX_FCNTL_H */

Index: src/sys/compat/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.14 src/sys/compat/linux/common/linux_mod.c:1.15
--- src/sys/compat/linux/common/linux_mod.c:1.14	Sun Apr 26 14:53:33 2020
+++ src/sys/compat/linux/common/linux_mod.c	Sat Aug 19 13:57:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.14 2020/04/26 18:53:33 thorpej Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.15 2023/08/19 17:57:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.14 2020/04/26 18:53:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.15 2023/08/19 17:57:54 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_mod.c,
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -162,7 +163,12 @@ compat_linux_modcmd(modcmd_t cmd, void *
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
+		error = linux_inotify_init();
+		if (error != 0)
+			return error;
 		error = exec_add(linux_execsw, __arraycount(linux_execsw));
+		if (error)
+			linux_inotify_fini();
 		return error;
 
 	case MODULE_CMD_FINI:
@@ -170,6 +176,7 @@ compat_linux_modcmd(modcmd_t cmd, void *
 		if (error)
 			return error;
 		linux_sysctl_fini();
+		linux_inotify_fini();
 		return 0;
 
 	default:

Added files:

Index: src/sys/compat/linux/common/linux_inotify.c
diff -u /dev/null src/sys/compat/linux/common/linux_inotify.c:1.1
--- /dev/null	Sat Aug 19 13:57:55 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Sat Aug 19 13:57:54 2023
@@ -0,0 +1,1317 @@
+/*	$NetBSD: linux_inotify.c,v 1.1 2023/08/19 17:57:54 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Theodore Preduta.
+ *
+ * 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, 

CVS commit: src/sys/compat/linux/arch

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:50:25 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.118 -r1.119 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.117 -r1.118 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.119 -r1.120 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.95 -r1.96 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.94 -r1.95 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/linux_syscall.h
diff -u src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.9 src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.10
--- src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.9	Fri Aug 18 15:42:05 2023
+++ src/sys/compat/linux/arch/aarch64/linux_syscall.h	Sat Aug 19 13:50:24 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.9 2023/08/18 19:42:05 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.10 2023/08/19 17:50:24 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.10 2023/08/18 19:41:19 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.11 2023/08/19 17:49:49 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -72,6 +72,15 @@
 /* syscall: "fcntl" ret: "int" args: "int" "int" "void *" */
 #define	LINUX_SYS_fcntl	25
 
+/* syscall: "inotify_init1" ret: "int" args: "int" */
+#define	LINUX_SYS_inotify_init1	26
+
+/* syscall: "inotify_add_watch" ret: "int" args: "int" "const char *" "uint32_t" */
+#define	LINUX_SYS_inotify_add_watch	27
+
+/* syscall: "inotify_rm_watch" ret: "int" args: "int" "int" */
+#define	LINUX_SYS_inotify_rm_watch	28
+
 /* syscall: "ioctl" 

CVS commit: src/sys/compat/linux/arch

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:50:25 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.118 -r1.119 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.117 -r1.118 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.119 -r1.120 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.95 -r1.96 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.94 -r1.95 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/arch

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:49:50 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master

Log Message:
Add inotify* syscalls GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.71 -r1.72 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.133 -r1.134 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.83 -r1.84 src/sys/compat/linux/arch/powerpc/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.10 src/sys/compat/linux/arch/aarch64/syscalls.master:1.11
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.10	Fri Aug 18 15:41:19 2023
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Sat Aug 19 13:49:49 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.10 2023/08/18 19:41:19 christos Exp $
+	$NetBSD: syscalls.master,v 1.11 2023/08/19 17:49:49 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -106,9 +106,10 @@
 23	NOARGS		{ int|sys||dup(int fd); }
 24	STD		{ int|linux_sys||dup3(int from, int to, int flags); }
 25	STD		{ int|linux_sys||fcntl(int fd, int cmd, void *arg); }
-26	UNIMPL		inotify_init1
-27	UNIMPL		inotify_add_watch
-28	UNIMPL		inotify_rm_watch
+26	STD		{ int|linux_sys||inotify_init1(int flags); }
+27	STD	{ int|linux_sys||inotify_add_watch(int fd, \
+			const char *pathname, uint32_t mask); }
+28	STD		{ int|linux_sys||inotify_rm_watch(int fd, int wd); }
 29	STD		{ int|linux_sys||ioctl(int fd, u_long com, \
 			void *data); }
 30	UNIMPL		ioprio_set
@@ -216,7 +217,7 @@
 92	STD		{ int|linux_sys||personality(unsigned long per); }
 93	STD		{ int|linux_sys||exit(int rval); }
 94	STD		{ int|linux_sys||exit_group(int error_code); }
-95  STD		{ int|linux_sys||waitid(int idtype, id_t id, \
+95	STD		{ int|linux_sys||waitid(int idtype, id_t id, \
 			linux_siginfo_t *infop, int options, \
 			struct rusage50 *rusage); }
 96	STD		{ int|linux_sys||set_tid_address(int *tid); }

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.105 src/sys/compat/linux/arch/alpha/syscalls.master:1.106
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.105	Fri Aug 18 15:41:19 2023
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sat Aug 19 13:49:49 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.105 2023/08/18 19:41:19 christos Exp $
+	$NetBSD: syscalls.master,v 1.106 2023/08/19 17:49:49 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -703,7 +703,7 @@
 435	UNIMPL		mq_timedreceive
 436	UNIMPL		mq_notify
 437	UNIMPL		mq_getsetattr
-438 STD		{ int|linux_sys||waitid(int idtype, id_t id, \
+438	STD		{ int|linux_sys||waitid(int idtype, id_t id, \
 			linux_siginfo_t *infop, int options, \
 			struct rusage50 *rusage); }
 439	UNIMPL		add_key
@@ -711,9 +711,10 @@
 441	UNIMPL		keyctl
 442	UNIMPL		ioprio_set
 443	UNIMPL		ioprio_get
-444	UNIMPL		inotify_init
-445	UNIMPL		inotify_add_watch
-446	UNIMPL		inotify_rm_watch
+444	STD		{ int|linux_sys||inotify_init(void); }
+445	STD		{ int|linux_sys||inotify_add_watch(int fd, \
+			const char *pathname, uint32_t mask); }
+446	STD		{ int|linux_sys||inotify_rm_watch(int fd, int wd); }
 447	UNIMPL		fdatasync
 448	UNIMPL		kexec_load
 449	UNIMPL		migrate_pages
@@ -791,7 +792,7 @@
 486	STD		{ int|linux_sys||epoll_create1(int flags); }
 487	STD		{ int|linux_sys||dup3(int from, int to, int flags); }
 488	STD		{ int|linux_sys||pipe2(int *pfds, int flags); }
-489	UNIMPL		inotify_init1
+489	STD		{ int|linux_sys||inotify_init1(int flags); }
 490	STD		{ int|linux_sys||preadv(int fd, \
 			const struct iovec *iovp, int iovcnt, \
 			unsigned long off_lo, unsigned long off_hi); }
@@ -833,7 +834,7 @@
 519	UNIMPL
 520	UNIMPL
 521	UNIMPL
-522 STD		{ int|linux_sys||statx(int fd, const char *path, \
+522	STD		{ int|linux_sys||statx(int fd, const char *path, \
 			int flag, unsigned int mask, \
 			struct linux_statx *sp); }
 523	UNIMPL

Index: 

CVS commit: src/sys/compat/linux/arch

2023-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 19 17:49:50 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master

Log Message:
Add inotify* syscalls GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.71 -r1.72 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.133 -r1.134 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.83 -r1.84 src/sys/compat/linux/arch/powerpc/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/arch

2023-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 18 19:42:06 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.116 -r1.117 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.118 -r1.119 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.19 -r1.20 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.94 -r1.95 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.93 -r1.94 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/linux_syscall.h
diff -u src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.8 src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.9
--- src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.8	Sat Jul 29 11:05:45 2023
+++ src/sys/compat/linux/arch/aarch64/linux_syscall.h	Fri Aug 18 15:42:05 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.8 2023/07/29 15:05:45 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.9 2023/08/18 19:42:05 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.9 2023/07/29 15:04:28 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.10 2023/08/18 19:41:19 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -222,6 +222,9 @@
 /* syscall: "exit_group" ret: "int" args: "int" */
 #define	LINUX_SYS_exit_group	94
 
+/* syscall: "waitid" ret: "int" args: "int" "id_t" "linux_siginfo_t *" "int" "struct rusage50 *" */
+#define	LINUX_SYS_waitid	95
+
 /* syscall: "set_tid_address" ret: "int" args: "int *" */
 #define	LINUX_SYS_set_tid_address	96
 
Index: src/sys/compat/linux/arch/aarch64/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/aarch64/linux_syscallargs.h:1.8 src/sys/compat/linux/arch/aarch64/linux_syscallargs.h:1.9
--- src/sys/compat/linux/arch/aarch64/linux_syscallargs.h:1.8	Sat Jul 29 11:05:45 2023
+++ src/sys/compat/linux/arch/aarch64/linux_syscallargs.h	Fri Aug 18 15:42:05 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.8 2023/07/29 15:05:45 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.9 2023/08/18 19:42:05 

CVS commit: src/sys/compat/linux/arch

2023-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 18 19:42:06 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.116 -r1.117 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.118 -r1.119 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.19 -r1.20 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.94 -r1.95 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.93 -r1.94 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat

2023-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 18 19:41:20 UTC 2023

Modified Files:
src/sys/compat/common: compat_mod.h files.common
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_misc.c linux_misc.h linux_signal.c
src/sys/compat/linux32/common: linux32_wait.c

Log Message:
Add linux waitid(2) from GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/files.common
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.261 -r1.262 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/linux32/common/linux32_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat

2023-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 18 19:41:20 UTC 2023

Modified Files:
src/sys/compat/common: compat_mod.h files.common
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_misc.c linux_misc.h linux_signal.c
src/sys/compat/linux32/common: linux32_wait.c

Log Message:
Add linux waitid(2) from GSoC 2023 (Theodore Preduta)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/files.common
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.261 -r1.262 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/linux32/common/linux32_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/compat_mod.h
diff -u src/sys/compat/common/compat_mod.h:1.8 src/sys/compat/common/compat_mod.h:1.9
--- src/sys/compat/common/compat_mod.h:1.8	Fri Jul 28 14:19:00 2023
+++ src/sys/compat/common/compat_mod.h	Fri Aug 18 15:41:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_mod.h,v 1.8 2023/07/28 18:19:00 christos Exp $	*/
+/*	$NetBSD: compat_mod.h,v 1.9 2023/08/18 19:41:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013, 2019 The NetBSD Foundation, Inc.
@@ -37,6 +37,8 @@ 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

Index: src/sys/compat/common/files.common
diff -u src/sys/compat/common/files.common:1.9 src/sys/compat/common/files.common:1.10
--- src/sys/compat/common/files.common:1.9	Fri Jul 28 14:19:00 2023
+++ src/sys/compat/common/files.common	Fri Aug 18 15:41:18 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.common,v 1.9 2023/07/28 18:19:00 christos Exp $
+#	$NetBSD: files.common,v 1.10 2023/08/18 19:41:18 christos Exp $
 
 #
 # Generic utility files, used by various compat options.
@@ -113,6 +113,7 @@ file	compat/common/vfs_syscalls_90.c		co
 # 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
 
 #
 # Sources for sysv ipc compatibility across the versions.

Index: src/sys/compat/linux/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.9 src/sys/compat/linux/arch/aarch64/syscalls.master:1.10
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.9	Sat Jul 29 11:04:28 2023
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Fri Aug 18 15:41:19 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.9 2023/07/29 15:04:28 christos Exp $
+	$NetBSD: syscalls.master,v 1.10 2023/08/18 19:41:19 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -216,7 +216,9 @@
 92	STD		{ int|linux_sys||personality(unsigned long per); }
 93	STD		{ int|linux_sys||exit(int rval); }
 94	STD		{ int|linux_sys||exit_group(int error_code); }
-95	UNIMPL		waitid
+95  STD		{ int|linux_sys||waitid(int idtype, id_t id, \
+			linux_siginfo_t *infop, int options, \
+			struct rusage50 *rusage); }
 96	STD		{ int|linux_sys||set_tid_address(int *tid); }
 97	UNIMPL		unshare
 98	STD		{ int|linux_sys||futex(int *uaddr, int op, int val, \

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.104 src/sys/compat/linux/arch/alpha/syscalls.master:1.105
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.104	Sat Jul 29 11:04:28 2023
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Fri Aug 18 15:41:19 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.104 2023/07/29 15:04:28 christos Exp $
+	$NetBSD: syscalls.master,v 1.105 2023/08/18 19:41:19 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -703,7 +703,9 @@
 435	UNIMPL		mq_timedreceive
 436	UNIMPL		mq_notify
 437	UNIMPL		mq_getsetattr

CVS commit: src/sys/compat/ultrix

2023-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 08:32:52 UTC 2023

Modified Files:
src/sys/compat/ultrix: ultrix_misc.c

Log Message:
avoid uninitialised accesses

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/ultrix/ultrix_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/ultrix/ultrix_misc.c
diff -u src/sys/compat/ultrix/ultrix_misc.c:1.126 src/sys/compat/ultrix/ultrix_misc.c:1.127
--- src/sys/compat/ultrix/ultrix_misc.c:1.126	Tue Sep  7 11:43:05 2021
+++ src/sys/compat/ultrix/ultrix_misc.c	Thu Aug  3 08:32:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ultrix_misc.c,v 1.126 2021/09/07 11:43:05 riastradh Exp $	*/
+/*	$NetBSD: ultrix_misc.c,v 1.127 2023/08/03 08:32:52 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.126 2021/09/07 11:43:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.127 2023/08/03 08:32:52 mrg Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sysv.h"
@@ -648,7 +648,7 @@ ultrix_sys_shmsys(struct lwp *l, const s
 	/* Ultrix SVSHM weirndess: */
 	struct sys_shmat_args shmat_args;
 	struct compat_14_sys_shmctl_args shmctl_args;
-	struct sys_shmdt_args shmdt_args;
+	struct sys_shmdt_args shmdt_args = {0};
 	struct sys_shmget_args shmget_args;
 
 



CVS commit: src/sys/compat/ultrix

2023-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 08:32:52 UTC 2023

Modified Files:
src/sys/compat/ultrix: ultrix_misc.c

Log Message:
avoid uninitialised accesses

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/ultrix/ultrix_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 07:56:15 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
netbsd32_epoll_pwait2: Dedup slightly. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_epoll.c
diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.2 src/sys/compat/netbsd32/netbsd32_epoll.c:1.3
--- src/sys/compat/netbsd32/netbsd32_epoll.c:1.2	Sun Jul 30 07:48:54 2023
+++ src/sys/compat/netbsd32/netbsd32_epoll.c	Sun Jul 30 07:56:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $	*/
+/*	$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $");
 
 #include 
 #include 
@@ -129,10 +129,8 @@ netbsd32_epoll_pwait2(struct lwp *l,
 
 	error = epoll_wait_common(l, retval, SCARG(uap, epfd), events,
 	maxevents, tsp, ssp);
-	if (error != 0 || *retval == 0) {
-		kmem_free(events, maxevents * sizeof(*events));
-		return error;
-	}
+	if (error != 0 || *retval == 0)
+		goto out;
 
 	struct netbsd32_epoll_event *events32 =
 	kmem_alloc(*retval * sizeof(*events32), KM_SLEEP);
@@ -140,12 +138,12 @@ netbsd32_epoll_pwait2(struct lwp *l,
 	for (int i = 0; i < *retval; i++)
 		netbsd32_from_epoll_event([i], [i]);
 
-	kmem_free(events, maxevents * sizeof(*events));
-
 	error = copyout(events, SCARG_P32(uap, events),
 	*retval * sizeof(*events32));
 
 	kmem_free(events32, *retval * sizeof(*events32));
 
+ out:
+	kmem_free(events, maxevents * sizeof(*events));
 	return error;
 }



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 07:56:15 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
netbsd32_epoll_pwait2: Dedup slightly. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 07:48:54 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
netbsd32_epoll_pwait2: Early return if no event arrived;
Do not attempt to allocate 0-byte buffer by kmem_alloc(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_epoll.c
diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.1 src/sys/compat/netbsd32/netbsd32_epoll.c:1.2
--- src/sys/compat/netbsd32/netbsd32_epoll.c:1.1	Sun Jul 30 06:52:20 2023
+++ src/sys/compat/netbsd32/netbsd32_epoll.c	Sun Jul 30 07:48:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_epoll.c,v 1.1 2023/07/30 06:52:20 rin Exp $	*/
+/*	$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.1 2023/07/30 06:52:20 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $");
 
 #include 
 #include 
@@ -129,7 +129,7 @@ netbsd32_epoll_pwait2(struct lwp *l,
 
 	error = epoll_wait_common(l, retval, SCARG(uap, epfd), events,
 	maxevents, tsp, ssp);
-	if (error != 0) {
+	if (error != 0 || *retval == 0) {
 		kmem_free(events, maxevents * sizeof(*events));
 		return error;
 	}



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 07:48:54 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
netbsd32_epoll_pwait2: Early return if no event arrived;
Do not attempt to allocate 0-byte buffer by kmem_alloc(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_epoll.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 06:53:13 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPAT_NETBSD32: Regen for syscalls.master,v 1.144


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.38 -r1.39 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.159 src/sys/compat/netbsd32/netbsd32_syscall.h:1.160
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.159	Sun Jul 30 05:31:30 2023
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sun Jul 30 06:53:13 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.159 2023/07/30 05:31:30 rin Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.160 2023/07/30 06:53:13 rin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1344,6 +1344,15 @@
 /* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */
 #define	NETBSD32_SYS_netbsd32___kevent100	501
 
+/* syscall: "netbsd32_epoll_create1" ret: "int" args: "int" */
+#define	NETBSD32_SYS_netbsd32_epoll_create1	502
+
+/* syscall: "netbsd32_epoll_ctl" ret: "int" args: "int" "int" "int" "netbsd32_epoll_eventp_t" */
+#define	NETBSD32_SYS_netbsd32_epoll_ctl	503
+
+/* syscall: "netbsd32_epoll_pwait2" ret: "int" args: "int" "netbsd32_epoll_eventp_t" "int" "netbsd32_timespecp_t" "netbsd32_sigsetp_t" */
+#define	NETBSD32_SYS_netbsd32_epoll_pwait2	504
+
 #define	NETBSD32_SYS_MAXSYSCALL	505
 #define	NETBSD32_SYS_NSYSENT	512
 #endif /* _NETBSD32_SYS_SYSCALL_H_ */

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.159
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158	Sun Jul 30 05:31:30 2023
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sun Jul 30 06:53:13 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.158 2023/07/30 05:31:30 rin Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.159 2023/07/30 06:53:13 rin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2805,6 +2805,28 @@ struct netbsd32___kevent100_args {
 };
 check_syscall_args(netbsd32___kevent100)
 
+struct netbsd32_epoll_create1_args {
+	syscallarg(int) flags;
+};
+check_syscall_args(netbsd32_epoll_create1)
+
+struct netbsd32_epoll_ctl_args {
+	syscallarg(int) epfd;
+	syscallarg(int) op;
+	syscallarg(int) fd;
+	syscallarg(netbsd32_epoll_eventp_t) event;
+};
+check_syscall_args(netbsd32_epoll_ctl)
+
+struct netbsd32_epoll_pwait2_args {
+	syscallarg(int) epfd;
+	syscallarg(netbsd32_epoll_eventp_t) events;
+	syscallarg(int) maxevents;
+	syscallarg(netbsd32_timespecp_t) timeout;
+	syscallarg(netbsd32_sigsetp_t) sigmask;
+};
+check_syscall_args(netbsd32_epoll_pwait2)
+
 /*
  * System call prototypes.
  */
@@ -3679,4 +3701,10 @@ int	netbsd32_memfd_create(struct lwp *, 
 
 int	netbsd32___kevent100(struct lwp *, const struct netbsd32___kevent100_args *, register_t *);
 
+int	netbsd32_epoll_create1(struct lwp *, const struct netbsd32_epoll_create1_args *, register_t *);
+
+int	netbsd32_epoll_ctl(struct lwp *, const struct netbsd32_epoll_ctl_args *, register_t *);
+
+int	netbsd32_epoll_pwait2(struct lwp *, const struct netbsd32_epoll_pwait2_args *, register_t *);
+
 #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.159
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158	Sun Jul 30 05:31:30 2023
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sun Jul 30 06:53:13 2023
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.159 2023/07/30 

CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 06:53:13 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPAT_NETBSD32: Regen for syscalls.master,v 1.144


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.38 -r1.39 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 06:52:21 UTC 2023

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h
syscalls.master
Added Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
COMPAT_NETBSD32: Add support for epoll(2).


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_epoll.c
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 06:52:21 UTC 2023

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h
syscalls.master
Added Files:
src/sys/compat/netbsd32: netbsd32_epoll.c

Log Message:
COMPAT_NETBSD32: Add support for epoll(2).


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_epoll.c
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/files.netbsd32
diff -u src/sys/compat/netbsd32/files.netbsd32:1.54 src/sys/compat/netbsd32/files.netbsd32:1.55
--- src/sys/compat/netbsd32/files.netbsd32:1.54	Mon Dec 19 23:19:51 2022
+++ src/sys/compat/netbsd32/files.netbsd32	Sun Jul 30 06:52:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netbsd32,v 1.54 2022/12/19 23:19:51 pgoyette Exp $
+#	$NetBSD: files.netbsd32,v 1.55 2023/07/30 06:52:20 rin Exp $
 #
 # config file description for machine-independent netbsd32 compat code.
 # included by ports that need it.
@@ -16,6 +16,7 @@ file	compat/netbsd32/netbsd32_exec_elf32
 file	compat/netbsd32/netbsd32_exec_aout.c	compat_netbsd32 & exec_aout
 file	compat/netbsd32/netbsd32_netbsd.c	compat_netbsd32
 #file	compat/netbsd32/netbsd32_drm.c		compat_netbsd32 & drmkms
+file	compat/netbsd32/netbsd32_epoll.c	compat_netbsd32
 file	compat/netbsd32/netbsd32_event.c	compat_netbsd32
 file	compat/netbsd32/netbsd32_execve.c	compat_netbsd32
 file	compat/netbsd32/netbsd32_fd.c		compat_netbsd32

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.142 src/sys/compat/netbsd32/netbsd32.h:1.143
--- src/sys/compat/netbsd32/netbsd32.h:1.142	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32.h	Sun Jul 30 06:52:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.142 2023/07/29 12:38:25 rin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.143 2023/07/30 06:52:20 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -208,6 +208,15 @@ typedef netbsd32_int64 netbsd32_off_t;
 typedef netbsd32_uint64 netbsd32_ino_t;
 typedef netbsd32_int64 netbsd32_blkcnt_t;
 
+/* from  */
+typedef netbsd32_uint64 netbsd32_epoll_data_t;
+
+typedef netbsd32_pointer_t netbsd32_epoll_eventp_t;
+struct netbsd32_epoll_event {
+	uint32_t		events;
+	netbsd32_epoll_data_t	data;
+};
+
 /* from  */
 typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actionsp;
 typedef netbsd32_pointer_t netbsd32_posix_spawnattrp;

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.47 src/sys/compat/netbsd32/netbsd32_conv.h:1.48
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.47	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Sun Jul 30 06:52:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.47 2023/07/29 12:38:25 rin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.48 2023/07/30 06:52:20 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -956,4 +957,24 @@ netbsd32_from_mq_attr(const struct mq_at
 	a32->mq_curmsgs = attr->mq_curmsgs;
 }
 
+static __inline void
+netbsd32_to_epoll_event(const struct netbsd32_epoll_event *ee32,
+struct epoll_event *ee)
+{
+
+	memset(ee, 0, sizeof(*ee));
+	ee->events = ee32->events;
+	ee->data = ee32->data;
+}
+
+static __inline void
+netbsd32_from_epoll_event(const struct epoll_event *ee,
+struct netbsd32_epoll_event *ee32)
+{
+
+	memset(ee32, 0, sizeof(*ee32));
+	ee32->events = ee->events;
+	ee32->data = ee->data;
+}
+
 #endif /* _COMPAT_NETBSD32_NETBSD32_CONV_H_ */

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.143 src/sys/compat/netbsd32/syscalls.master:1.144
--- src/sys/compat/netbsd32/syscalls.master:1.143	Sun Jul 30 05:30:45 2023
+++ src/sys/compat/netbsd32/syscalls.master	Sun Jul 30 06:52:20 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp $
+	$NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1222,6 +1222,10 @@
 			netbsd32_keventp_t eventlist, \
 			netbsd32_size_t nevents, \
 			const netbsd32_timespecp_t timeout); }
-502	UNIMPL		epoll_create1
-503	UNIMPL		epoll_ctl
-504	UNIMPL		epoll_pwait2
+502	STD		{ int|netbsd32||epoll_create1(int flags); }
+503	STD		{ int|netbsd32||epoll_ctl(int epfd, int op, int fd, \
+			netbsd32_epoll_eventp_t event); }
+504	STD		{ int|netbsd32||epoll_pwait2(int epfd, \
+			netbsd32_epoll_eventp_t events, int maxevents, \
+			  

CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:31:30 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPANT_NETBSD32: Regen for syscalls.master,v 1.143


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.37 -r1.38 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.158 src/sys/compat/netbsd32/netbsd32_syscall.h:1.159
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.158	Sat Jul 29 12:39:20 2023
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sun Jul 30 05:31:30 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.158 2023/07/29 12:39:20 rin Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.159 2023/07/30 05:31:30 rin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1338,6 +1338,9 @@
 /* syscall: "netbsd32_lpathconf" ret: "long" args: "const netbsd32_charp" "int" */
 #define	NETBSD32_SYS_netbsd32_lpathconf	499
 
+/* syscall: "netbsd32_memfd_create" ret: "int" args: "const netbsd32_charp" "unsigned int" */
+#define	NETBSD32_SYS_netbsd32_memfd_create	500
+
 /* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */
 #define	NETBSD32_SYS_netbsd32___kevent100	501
 

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157	Sat Jul 29 12:39:20 2023
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sun Jul 30 05:31:30 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.157 2023/07/29 12:39:20 rin Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.158 2023/07/30 05:31:30 rin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2789,6 +2789,12 @@ struct netbsd32_lpathconf_args {
 };
 check_syscall_args(netbsd32_lpathconf)
 
+struct netbsd32_memfd_create_args {
+	syscallarg(const netbsd32_charp) name;
+	syscallarg(unsigned int) flags;
+};
+check_syscall_args(netbsd32_memfd_create)
+
 struct netbsd32___kevent100_args {
 	syscallarg(int) fd;
 	syscallarg(const netbsd32_keventp_t) changelist;
@@ -3669,6 +3675,8 @@ int	netbsd32___acl_aclcheck_fd(struct lw
 
 int	netbsd32_lpathconf(struct lwp *, const struct netbsd32_lpathconf_args *, register_t *);
 
+int	netbsd32_memfd_create(struct lwp *, const struct netbsd32_memfd_create_args *, register_t *);
+
 int	netbsd32___kevent100(struct lwp *, const struct netbsd32___kevent100_args *, register_t *);
 
 #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.157 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.157	Sat Jul 29 12:39:20 2023
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sun Jul 30 05:31:30 2023
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.157 2023/07/29 12:39:20 rin Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.157 2023/07/29 12:39:20 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -538,7 +538,7 @@ const char *const netbsd32_syscallnames[
 	/* 497 */	"netbsd32___acl_aclcheck_file",
 	/* 498 */	"netbsd32___acl_aclcheck_fd",
 	/* 499 */	"netbsd32_lpathconf",
-	/* 500 */	"#500 (unimplemented 

CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:31:30 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPANT_NETBSD32: Regen for syscalls.master,v 1.143


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.37 -r1.38 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:30:45 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master

Log Message:
COMPAT_NETBSD32: Add support for memfd_create(2).


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.235
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234	Sun Jul 30 05:10:47 2023
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Sun Jul 30 05:30:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $");
 
 /*
  * below are all the standard NetBSD system calls, in the 32bit
@@ -2648,6 +2648,21 @@ netbsd32_eventfd(struct lwp *l,
 	return sys_eventfd(l, , retval);
 }
 
+int
+netbsd32_memfd_create(struct lwp *l,
+const struct netbsd32_memfd_create_args *uap, register_t *retval)
+{
+	/* {
+		syscallarg(const netbsd32_charp)	name;
+		syscallarg(unsigned int)		flags;
+	} */
+	struct sys_memfd_create_args ua;
+
+	NETBSD32TOP_UAP(name, const char);
+	NETBSD32TO64_UAP(flags);
+	return sys_memfd_create(l, , retval);
+}
+
 /*
  * MI indirect system call support.
  * Only used if the MD netbsd32_syscall.c doesn't intercept the calls.

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.142 src/sys/compat/netbsd32/syscalls.master:1.143
--- src/sys/compat/netbsd32/syscalls.master:1.142	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/syscalls.master	Sun Jul 30 05:30:45 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp $
+	$NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1214,7 +1214,8 @@
 			acl_type_t type, netbsd32_aclp_t aclp); }
 499	STD		{ long|netbsd32||lpathconf(const netbsd32_charp path, \
 			int name); }
-500	UNIMPL		memfd_create
+500	STD		{ int|netbsd32||memfd_create( \
+			const netbsd32_charp name, unsigned int flags); }
 501	STD		{ int|netbsd32|100|kevent(int fd, \
 			const netbsd32_keventp_t changelist, \
 			netbsd32_size_t nchanges, \



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:30:45 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master

Log Message:
COMPAT_NETBSD32: Add support for memfd_create(2).


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:10:48 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c

Log Message:
netbsd32_netbsd: Sort headers. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 30 05:10:48 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c

Log Message:
netbsd32_netbsd: Sort headers. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.233 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.233	Mon Sep 20 01:07:45 2021
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Sun Jul 30 05:10:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $");
 
 /*
  * below are all the standard NetBSD system calls, in the 32bit
@@ -57,45 +57,44 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net
 #endif
 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 



CVS commit: src/sys/compat/linux/arch

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:05:46 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.18 -r1.19 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.114 -r1.115 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.92 -r1.93 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/linux_syscall.h
diff -u src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.7 src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.8
--- src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.7	Sat Jul 29 02:50:47 2023
+++ src/sys/compat/linux/arch/aarch64/linux_syscall.h	Sat Jul 29 11:05:45 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.7 2023/07/29 06:50:47 rin Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.8 2023/07/29 15:05:45 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.8 2023/07/29 06:47:26 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.9 2023/07/29 15:04:28 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -528,6 +528,9 @@
 /* syscall: "recvmsg" ret: "ssize_t" args: "int" "struct linux_msghdr *" "int" */
 #define	LINUX_SYS_recvmsg	212
 
+/* syscall: "readahead" ret: "ssize_t" args: "int" "off_t" "size_t" */
+#define	LINUX_SYS_readahead	213
+
 /* syscall: "brk" ret: "int" args: "char *" */
 #define	LINUX_SYS_brk	214
 
@@ -603,6 +606,9 @@
 /* syscall: "statx" ret: "int" args: "int" "const char *" "int" "unsigned int" "struct linux_statx *" */
 #define	LINUX_SYS_statx	

CVS commit: src/sys/compat/linux/arch

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:05:46 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.18 -r1.19 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.114 -r1.115 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.92 -r1.93 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/arch/mips

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:05:31 UTC 2023

Modified Files:
src/sys/compat/linux/arch/mips: syscalls.master

Log Message:
typo


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/linux/arch/mips/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/mips/syscalls.master
diff -u src/sys/compat/linux/arch/mips/syscalls.master:1.76 src/sys/compat/linux/arch/mips/syscalls.master:1.77
--- src/sys/compat/linux/arch/mips/syscalls.master:1.76	Sat Jul 29 11:04:29 2023
+++ src/sys/compat/linux/arch/mips/syscalls.master	Sat Jul 29 11:05:31 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.76 2023/07/29 15:04:29 christos Exp $  
+	$NetBSD: syscalls.master,v 1.77 2023/07/29 15:05:31 christos Exp $  
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -601,7 +601,7 @@
 356	UNIMPL		execveat
 357	UNIMPL		userfaultfd
 358	UNIMPL		membarrier
-369	UNIMPL		mlock2
+359	UNIMPL		mlock2
 360	UNIMPL		copy_file_range
 361	UNIMPL		preadv2
 362	UNIMPL		pwritev2



CVS commit: src/sys/compat/linux/arch/mips

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:05:31 UTC 2023

Modified Files:
src/sys/compat/linux/arch/mips: syscalls.master

Log Message:
typo


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/linux/arch/mips/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:04:29 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_file64.c linux_misc.c

Log Message:
Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.131 -r1.132 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.259 -r1.260 src/sys/compat/linux/common/linux_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.8 src/sys/compat/linux/arch/aarch64/syscalls.master:1.9
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.8	Sat Jul 29 02:47:26 2023
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Sat Jul 29 11:04:28 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.8 2023/07/29 06:47:26 rin Exp $
+	$NetBSD: syscalls.master,v 1.9 2023/07/29 15:04:28 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -433,7 +433,8 @@
 			const struct linux_msghdr *msg, int flags); }
 212	STD		{ ssize_t|linux_sys||recvmsg(int s, \
 			struct linux_msghdr *msg, int flags); }
-213	UNIMPL		readahead
+213	STD		{ ssize_t|linux_sys||readahead(int fd, off_t offset, \
+			size_t count); }
 214	STD		{ int|linux_sys||brk(char *nsize); }
 215	NOARGS		{ int|sys||munmap(void *addr, size_t len); }
 216	STD		{ void *|linux_sys||mremap(void *old_address, \
@@ -675,7 +676,8 @@
 433	UNIMPL		fspick
 434	UNIMPL		pidfd_open
 435	UNIMPL		clone3
-436	UNIMPL
+436	STD		{ int|linux_sys||close_range(unsigned int first, \
+			unsigned int last, unsigned int flags); }
 437	UNIMPL		openat2
 438	UNIMPL		pidfd_getfd
 439	UNIMPL		faccessat2

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.103 src/sys/compat/linux/arch/alpha/syscalls.master:1.104
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.103	Fri Jul 28 15:01:11 2023
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sat Jul 29 11:04:28 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.103 2023/07/28 19:01:11 christos Exp $
+	$NetBSD: syscalls.master,v 1.104 2023/07/29 15:04:28 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -614,7 +614,8 @@
 377	STD		{ int|linux_sys||getdents64(int fd, \
 			struct linux_dirent64 *dent, unsigned int count); }
 378	NOARGS		{ pid_t|linux_sys||gettid(void); }
-379	UNIMPL		readahead
+379	STD		{ ssize_t|linux_sys||readahead(int fd, off_t offset, \
+			size_t count); }
 380	UNIMPL		/* unused */
 381	STD		{ int|linux_sys||tkill(int tid, int sig); }
 382	STD		{ int|linux_sys||setxattr(char *path, char *name, \
@@ -830,7 +831,9 @@
 519	UNIMPL
 520	UNIMPL
 521	UNIMPL
-522	UNIMPL
+522 STD		{ int|linux_sys||statx(int fd, const char *path, \
+			int flag, unsigned int mask, \
+			struct linux_statx *sp); }
 523	UNIMPL
 524	UNIMPL
 525	UNIMPL
@@ -854,7 +857,8 @@
 543	UNIMPL
 544	UNIMPL
 545	UNIMPL
-546	UNIMPL
+546	STD		{ int|linux_sys||close_range(unsigned int first, \
+			unsigned int last, unsigned int flags); }
 547	UNIMPL
 548	UNIMPL
 549	UNIMPL

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.69 src/sys/compat/linux/arch/amd64/syscalls.master:1.70
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.69	Fri Jul 28 14:19:00 2023
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Sat Jul 29 11:04:28 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.69 2023/07/28 18:19:00 christos Exp $
+	$NetBSD: syscalls.master,v 1.70 2023/07/29 15:04:28 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -374,7 +374,8 @@
 184	UNIMPL		tuxcall
 185	UNIMPL		security
 186	STD		{ pid_t|linux_sys||gettid(void); }
-187	UNIMPL		readahead
+187	STD		{ 

CVS commit: src/sys/compat/linux

2023-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 29 15:04:29 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_file64.c linux_misc.c

Log Message:
Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.131 -r1.132 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.259 -r1.260 src/sys/compat/linux/common/linux_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama

Oops, thanks for quick fix, and it seems that I need a cup of coffee...

Thanks,
rin

On 2023/07/29 22:57, Paul Goyette wrote:

Module Name:src
Committed By:   pgoyette
Date:   Sat Jul 29 13:57:28 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c

Log Message:
Don't skip compat_netbsd32_90 in the dependency chain.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jul 29 13:57:28 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c

Log Message:
Don't skip compat_netbsd32_90 in the dependency chain.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_80.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c:1.8
--- src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7	Sat Jul 29 13:40:51 2023
+++ src/sys/compat/netbsd32/netbsd32_compat_80.c	Sat Jul 29 13:57:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $	*/
+/*	$NetBSD: netbsd32_compat_80.c,v 1.8 2023/07/29 13:57:28 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.8 2023/07/29 13:57:28 pgoyette Exp $");
 
 #include 
 #include 
@@ -175,7 +175,7 @@ netbsd32_80_modctl(struct lwp *lwp, cons
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_100,compat_80");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_90,compat_80");
 
 static int
 compat_netbsd32_80_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_90.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_90.c:1.1 src/sys/compat/netbsd32/netbsd32_compat_90.c:1.2
--- src/sys/compat/netbsd32/netbsd32_compat_90.c:1.1	Sun Sep 22 22:59:38 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_90.c	Sat Jul 29 13:57:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_90.c,v 1.1 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: netbsd32_compat_90.c,v 1.2 2023/07/29 13:57:28 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_90.c,v 1.1 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_90.c,v 1.2 2023/07/29 13:57:28 pgoyette Exp $");
 
 #include 
 #include 
@@ -152,7 +152,8 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 }; 
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_90, "compat_netbsd32,compat_90");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_90, "compat_netbsd32_100,compat_90");
+
 
 static int
 compat_netbsd32_90_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jul 29 13:57:28 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c

Log Message:
Don't skip compat_netbsd32_90 in the dependency chain.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 13:40:51 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_compat_80.c

Log Message:
COMPAT_NETBSD32: Reorganize the previous; Make compat_netbsd32_50 recursively
depended on compat_netbsd32_100, rather than directly depended on it.

Thanks pgoyette@ again for useful comments!


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.56
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55	Sat Jul 29 13:13:50 2023
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sat Jul 29 13:40:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.56 2023/07/29 13:40:51 rin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.56 2023/07/29 13:40:51 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -974,8 +974,7 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 }; 
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50,
-"compat_netbsd32_100,compat_netbsd32_60,compat_50");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, "compat_netbsd32_60,compat_50");
 
 static int
 compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_80.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_80.c:1.6 src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7
--- src/sys/compat/netbsd32/netbsd32_compat_80.c:1.6	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_80.c	Sat Jul 29 13:40:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $");
 
 #include 
 #include 
@@ -175,7 +175,7 @@ netbsd32_80_modctl(struct lwp *lwp, cons
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32,compat_80");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_100,compat_80");
 
 static int
 compat_netbsd32_80_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 13:40:51 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_compat_80.c

Log Message:
COMPAT_NETBSD32: Reorganize the previous; Make compat_netbsd32_50 recursively
depended on compat_netbsd32_100, rather than directly depended on it.

Thanks pgoyette@ again for useful comments!


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama

On 2023/07/29 22:13, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Sat Jul 29 13:13:50 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c

Log Message:
Now, netbsd32_compat_50 module requires netbsd32_compat_100.
Thanks pgoyette@ for hints.


Hmm, file name is netbsd32_compat_x.c but module name is
compat_netbsd32_x. Diff was correct :)

Thanks,
rin


CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 13:13:50 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c

Log Message:
Now, netbsd32_compat_50 module requires netbsd32_compat_100.
Thanks pgoyette@ for hints.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.54	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sat Jul 29 13:13:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.54 2023/07/29 12:38:25 rin Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.54 2023/07/29 12:38:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -974,7 +974,8 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 }; 
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, "compat_netbsd32_60,compat_50");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50,
+"compat_netbsd32_100,compat_netbsd32_60,compat_50");
 
 static int
 compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 13:13:50 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c

Log Message:
Now, netbsd32_compat_50 module requires netbsd32_compat_100.
Thanks pgoyette@ for hints.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:58:51 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
Add comment on packed attribution for struct linux_epoll_event on amd64.
NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_misc.h
diff -u src/sys/compat/linux/common/linux_misc.h:1.27 src/sys/compat/linux/common/linux_misc.h:1.28
--- src/sys/compat/linux/common/linux_misc.h:1.27	Fri Jul 28 18:19:01 2023
+++ src/sys/compat/linux/common/linux_misc.h	Sat Jul 29 12:58:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.h,v 1.27 2023/07/28 18:19:01 christos Exp $	*/
+/*	$NetBSD: linux_misc.h,v 1.28 2023/07/29 12:58:51 rin Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -146,6 +146,7 @@ struct linux_epoll_event {
 	uint64_t	data;
 }
 #if defined(__amd64__)
+/* Only for x86_64. See include/uapi/linux/eventpoll.h. */
 __packed
 #endif
 ;



CVS commit: src/sys/compat/linux/common

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:58:51 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_misc.h

Log Message:
Add comment on packed attribution for struct linux_epoll_event on amd64.
NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/compat/linux/common/linux_misc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:48:15 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_100.c netbsd32_event.c
netbsd32_event.h

Log Message:
COMPAT_NETBSD32: No need to have compat_100_netbsd32_kevent_fetch_timeout.
NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_compat_100.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/netbsd32/netbsd32_event.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_100.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c:1.3
--- src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32_compat_100.c	Sat Jul 29 12:48:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $ */
+/*	$NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $ */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $");
 
 #include 
 #include 
@@ -46,22 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 #include 
 #include 
 
-static int
-compat_100_netbsd32_kevent_fetch_timeout(const void *src, void *dest,
-size_t length)
-{
-	struct netbsd32_timespec ts32;
-	int error;
-
-	KASSERT(length == sizeof(struct timespec));
-
-	error = copyin(src, , sizeof(ts32));
-	if (error)
-		return error;
-	netbsd32_to_timespec(, (struct timespec *)dest);
-	return 0;
-}
-
 static void
 compat_100_netbsd32_to_kevent(const struct netbsd32_kevent100 *ke32,
 struct kevent *ke)
@@ -134,7 +118,7 @@ compat_100_netbsd32___kevent50(struct lw
 		syscallarg(netbsd32_timespecp_t) timeout;
 	} */
 	struct kevent_ops netbsd32_kevent_ops = {
-		.keo_fetch_timeout = compat_100_netbsd32_kevent_fetch_timeout,
+		.keo_fetch_timeout = netbsd32_kevent_fetch_timeout,
 		.keo_fetch_changes = compat_100_netbsd32_kevent_fetch_changes,
 		.keo_put_events = compat_100_netbsd32_kevent_put_events,
 	};

Index: src/sys/compat/netbsd32/netbsd32_event.c
diff -u src/sys/compat/netbsd32/netbsd32_event.c:1.13 src/sys/compat/netbsd32/netbsd32_event.c:1.14
--- src/sys/compat/netbsd32/netbsd32_event.c:1.13	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32_event.c	Sat Jul 29 12:48:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_event.c,v 1.13 2023/07/29 12:38:25 rin Exp $	*/
+/*	$NetBSD: netbsd32_event.c,v 1.14 2023/07/29 12:48:15 rin Exp $	*/
 
 /*
  *  Copyright (c) 2005 The NetBSD Foundation.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.13 2023/07/29 12:38:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.14 2023/07/29 12:48:15 rin Exp $");
 
 #include 
 #include 
@@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_eve
 #include 
 #include 
 
-static int
+int
 netbsd32_kevent_fetch_timeout(const void *src, void *dest, size_t length)
 {
 	struct netbsd32_timespec ts32;

Index: src/sys/compat/netbsd32/netbsd32_event.h
diff -u src/sys/compat/netbsd32/netbsd32_event.h:1.1 src/sys/compat/netbsd32/netbsd32_event.h:1.2
--- src/sys/compat/netbsd32/netbsd32_event.h:1.1	Sat Jul 29 12:38:25 2023
+++ src/sys/compat/netbsd32/netbsd32_event.h	Sat Jul 29 12:48:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_event.h,v 1.1 2023/07/29 12:38:25 rin Exp $	*/
+/*	$NetBSD: netbsd32_event.h,v 1.2 2023/07/29 12:48:15 rin Exp $	*/
 
 /*
  * Copyright (c) 2023 NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include 
 
 /* netbsd32_event.c */
+int netbsd32_kevent_fetch_timeout(const void *, void *, size_t);
 int netbsd32_kevent1(register_t *, int, const netbsd32_kevent100p_t,
 netbsd32_size_t, netbsd32_kevent100p_t, netbsd32_size_t,
 netbsd32_timespecp_t, struct kevent_ops *);



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:48:15 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_100.c netbsd32_event.c
netbsd32_event.h

Log Message:
COMPAT_NETBSD32: No need to have compat_100_netbsd32_kevent_fetch_timeout.
NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_compat_100.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/netbsd32/netbsd32_event.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:39:20 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPAT_NETBSD32: Regen for syscalls.master,v 1.142


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.36 -r1.37 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.157 src/sys/compat/netbsd32/netbsd32_syscall.h:1.158
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.157	Mon Sep 20 01:07:56 2021
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sat Jul 29 12:39:20 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.157 2021/09/20 01:07:56 thorpej Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.158 2023/07/29 12:39:20 rin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp
+ * created from	NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -917,7 +917,7 @@
 /* syscall: "kqueue" ret: "int" args: */
 #define	NETBSD32_SYS_kqueue	344
 
-/* syscall: "compat_50_netbsd32_kevent" ret: "int" args: "int" "netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_timespec50p_t" */
+/* syscall: "compat_50_netbsd32_kevent" ret: "int" args: "int" "netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_timespec50p_t" */
 #define	NETBSD32_SYS_compat_50_netbsd32_kevent	345
 
 /* syscall: "netbsd32__sched_setparam" ret: "int" args: "pid_t" "lwpid_t" "int" "const netbsd32_sched_paramp_t" */
@@ -1144,8 +1144,8 @@
 /* syscall: "compat_60_netbsd32__lwp_park" ret: "int" args: "const netbsd32_timespecp_t" "lwpid_t" "const netbsd32_voidp" "const netbsd32_voidp" */
 #define	NETBSD32_SYS_compat_60_netbsd32__lwp_park	434
 
-/* syscall: "netbsd32___kevent50" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */
-#define	NETBSD32_SYS_netbsd32___kevent50	435
+/* syscall: "compat_100_netbsd32___kevent50" ret: "int" args: "int" "const netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_kevent100p_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */
+#define	NETBSD32_SYS_compat_100_netbsd32___kevent50	435
 
 /* syscall: "netbsd32___pselect50" ret: "int" args: "int" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "const netbsd32_timespecp_t" "const netbsd32_sigsetp_t" */
 #define	NETBSD32_SYS_netbsd32___pselect50	436
@@ -1338,6 +1338,9 @@
 /* syscall: "netbsd32_lpathconf" ret: "long" args: "const netbsd32_charp" "int" */
 #define	NETBSD32_SYS_netbsd32_lpathconf	499
 
-#define	NETBSD32_SYS_MAXSYSCALL	500
+/* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */
+#define	NETBSD32_SYS_netbsd32___kevent100	501
+
+#define	NETBSD32_SYS_MAXSYSCALL	505
 #define	NETBSD32_SYS_NSYSENT	512
 #endif /* _NETBSD32_SYS_SYSCALL_H_ */

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.156 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.156	Mon Sep 20 01:07:56 2021
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sat Jul 29 12:39:20 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.156 2021/09/20 01:07:56 thorpej Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.157 2023/07/29 12:39:20 rin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp
+ * created from	NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -1777,9 +1777,9 @@ check_syscall_args(netbsd32_rasctl)
 
 struct compat_50_netbsd32_kevent_args {
 	syscallarg(int) fd;
-	syscallarg(netbsd32_keventp_t) changelist;
+	syscallarg(netbsd32_kevent100p_t) changelist;
 	syscallarg(netbsd32_size_t) nchanges;
-	syscallarg(netbsd32_keventp_t) eventlist;
+	syscallarg(netbsd32_kevent100p_t) eventlist;
 	syscallarg(netbsd32_size_t) nevents;
 	

CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:39:20 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
COMPAT_NETBSD32: Regen for syscalls.master,v 1.142


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.36 -r1.37 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_systrace_args.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:38:25 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_100.c
netbsd32_compat_50.c netbsd32_conv.h netbsd32_event.c
syscalls.master
Added Files:
src/sys/compat/netbsd32: netbsd32_event.h

Log Message:
COMPAT_NETBSD32: Catch up with sys___kevent100() addition.

XXX
Add epoll_* and memfd_create.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32.h \
src/sys/compat/netbsd32/syscalls.master
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c
cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/netbsd32/netbsd32_event.c
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.141 src/sys/compat/netbsd32/netbsd32.h:1.142
--- src/sys/compat/netbsd32/netbsd32.h:1.141	Sun Feb 12 16:28:32 2023
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Jul 29 12:38:25 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.141 2023/02/12 16:28:32 andvar Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.142 2023/07/29 12:38:25 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -1024,6 +1024,19 @@ struct netbsd32_kevent {
 	uint32_t		fflags;
 	netbsd32_int64		data;
 	netbsd32_pointer_t	udata;
+	netbsd32_uint64		ext[4];
+};
+
+/* from  */
+typedef netbsd32_pointer_t netbsd32_kevent100p_t;
+
+struct netbsd32_kevent100 {
+	netbsd32_uintptr_t	ident;
+	uint32_t		filter;
+	uint32_t		flags;
+	uint32_t		fflags;
+	netbsd32_int64		data;
+	netbsd32_pointer_t	udata;
 };
 
 /* from  */
Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.141 src/sys/compat/netbsd32/syscalls.master:1.142
--- src/sys/compat/netbsd32/syscalls.master:1.141	Mon Sep 20 01:07:45 2021
+++ src/sys/compat/netbsd32/syscalls.master	Sat Jul 29 12:38:25 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp $
+	$NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -783,9 +783,9 @@
 344	NOARGS		{ int|sys||kqueue(void); }
 345	COMPAT_50 MODULAR compat_netbsd32_50	\
 			{ int|netbsd32||kevent(int fd, \
-			netbsd32_keventp_t changelist, \
+			netbsd32_kevent100p_t changelist, \
 			netbsd32_size_t nchanges, \
-			netbsd32_keventp_t eventlist, \
+			netbsd32_kevent100p_t eventlist, \
 			netbsd32_size_t nevents, \
 			netbsd32_timespec50p_t timeout); }
 ; Scheduling system calls.
@@ -1016,10 +1016,11 @@
 			const netbsd32_timespecp_t ts, \
 			lwpid_t unpark, const netbsd32_voidp hint, \
 			const netbsd32_voidp unparkhint); }
-435	STD 		{ int|netbsd32|50|kevent(int fd, \
-			const netbsd32_keventp_t changelist, \
+435	COMPAT_100 MODULAR compat_netbsd32_100	\
+			{ int|netbsd32|50|kevent(int fd, \
+			const netbsd32_kevent100p_t changelist, \
 			netbsd32_size_t nchanges, \
-			netbsd32_keventp_t eventlist, \
+			netbsd32_kevent100p_t eventlist, \
 			netbsd32_size_t nevents, \
 			const netbsd32_timespecp_t timeout); }
 436	STD 		{ int|netbsd32|50|pselect(int nd, \
@@ -1213,3 +1214,13 @@
 			acl_type_t type, netbsd32_aclp_t aclp); }
 499	STD		{ long|netbsd32||lpathconf(const netbsd32_charp path, \
 			int name); }
+500	UNIMPL		memfd_create
+501	STD		{ int|netbsd32|100|kevent(int fd, \
+			const netbsd32_keventp_t changelist, \
+			netbsd32_size_t nchanges, \
+			netbsd32_keventp_t eventlist, \
+			netbsd32_size_t nevents, \
+			const netbsd32_timespecp_t timeout); }
+502	UNIMPL		epoll_create1
+503	UNIMPL		epoll_ctl
+504	UNIMPL		epoll_pwait2

Index: src/sys/compat/netbsd32/netbsd32_compat_100.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_100.c:1.1 src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2
--- src/sys/compat/netbsd32/netbsd32_compat_100.c:1.1	Mon Dec 19 23:19:51 2022
+++ src/sys/compat/netbsd32/netbsd32_compat_100.c	Sat Jul 29 12:38:25 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $ */
+/*	$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $ */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,14 +30,126 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $");
 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
 #include 
 #include 

CVS commit: src/sys/compat/netbsd32

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 12:38:25 UTC 2023

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_100.c
netbsd32_compat_50.c netbsd32_conv.h netbsd32_event.c
syscalls.master
Added Files:
src/sys/compat/netbsd32: netbsd32_event.h

Log Message:
COMPAT_NETBSD32: Catch up with sys___kevent100() addition.

XXX
Add epoll_* and memfd_create.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32.h \
src/sys/compat/netbsd32/syscalls.master
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c
cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/netbsd32/netbsd32_event.c
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/sys

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 11:58:53 UTC 2023

Modified Files:
src/sys/compat/sys: event.h

Log Message:
Sprinkle __inline to compat_100___kevent50_{fetch_changes,put_events}


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/sys/event.h
diff -u src/sys/compat/sys/event.h:1.3 src/sys/compat/sys/event.h:1.4
--- src/sys/compat/sys/event.h:1.3	Fri Jul 28 18:19:01 2023
+++ src/sys/compat/sys/event.h	Sat Jul 29 11:58:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.3 2023/07/28 18:19:01 christos Exp $	*/
+/*	$NetBSD: event.h,v 1.4 2023/07/29 11:58:53 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon 
@@ -63,7 +63,7 @@ kevent_to_kevent100(const struct kevent 
 }
 
 #ifdef _KERNEL
-static int
+static __inline int
 compat_100___kevent50_fetch_changes(void *ctx, const struct kevent *changelist,
 struct kevent *changes, size_t index, int n)
 {
@@ -88,7 +88,7 @@ leave:
 	return error;
 }
 
-static int
+static __inline int
 compat_100___kevent50_put_events(void *ctx, struct kevent *events,
 struct kevent *eventlist, size_t index, int n)
 {



CVS commit: src/sys/compat/sys

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 11:58:53 UTC 2023

Modified Files:
src/sys/compat/sys: event.h

Log Message:
Sprinkle __inline to compat_100___kevent50_{fetch_changes,put_events}


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/compat/linux/common

2023-07-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 29 07:00:00 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_misc.c

Log Message:
compat/linux: aarch64 does not have epoll_create(2) nor epoll_wait(2)

Note that for Linux, new architectures like arm64 use MI system call
table in include/uapi/asm-generic/unistd.h, instead of MD syscall.tbl.

XXX
Too many ifdef's like this. We should be smarter...


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/sys/compat/linux/common/linux_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.258 src/sys/compat/linux/common/linux_misc.c:1.259
--- src/sys/compat/linux/common/linux_misc.c:1.258	Fri Jul 28 18:19:01 2023
+++ src/sys/compat/linux/common/linux_misc.c	Sat Jul 29 07:00:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.258 2023/07/28 18:19:01 christos Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.259 2023/07/29 07:00:00 rin Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.258 2023/07/28 18:19:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.259 2023/07/29 07:00:00 rin Exp $");
 
 #include 
 #include 
@@ -1683,6 +1683,7 @@ linux_sys_eventfd2(struct lwp *l, const 
  retval);
 }
 
+#ifndef __aarch64__
 /*
  * epoll_create(2).  Check size and call sys_epoll_create1.
  */
@@ -1705,6 +1706,7 @@ linux_sys_epoll_create(struct lwp *l,
 	SCARG(, flags) = 0;
 	return sys_epoll_create1(l, , retval);
 }
+#endif /* !__aarch64__ */
 
 /*
  * epoll_create1(2).  Translate the flags and call sys_epoll_create1.
@@ -1768,6 +1770,7 @@ linux_sys_epoll_ctl(struct lwp *l, const
 	SCARG(uap, fd), eep);
 }
 
+#ifndef __aarch64__
 /*
  * epoll_wait(2).  Call sys_epoll_pwait().
  */
@@ -1791,6 +1794,7 @@ linux_sys_epoll_wait(struct lwp *l,
 
 	return linux_sys_epoll_pwait(l, , retval);
 }
+#endif /* !__aarch64__ */
 
 /*
  * Main body of epoll_pwait2(2).  Translate timeout and sigmask and



  1   2   3   4   5   6   7   8   9   10   >