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

2024-10-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Oct  3 12:56:50 UTC 2024

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

Log Message:
Fix fallout from DPRINTF conversion.

Kernels ALL/i386 and ALL/amd64 compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/common/linux_sched.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_sched.c
diff -u src/sys/compat/linux/common/linux_sched.c:1.82 src/sys/compat/linux/common/linux_sched.c:1.83
--- src/sys/compat/linux/common/linux_sched.c:1.82	Tue Oct  1 16:41:29 2024
+++ src/sys/compat/linux/common/linux_sched.c	Thu Oct  3 12:56:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sched.c,v 1.82 2024/10/01 16:41:29 riastradh Exp $	*/
+/*	$NetBSD: linux_sched.c,v 1.83 2024/10/03 12:56:49 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.82 2024/10/01 16:41:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.83 2024/10/03 12:56:49 hannken Exp $");
 
 #include 
 #include 
@@ -189,13 +189,13 @@ linux_sys_clone3(struct lwp *l, const st
 
 	/* Define allowed flags */
 	if (cl_args.flags & LINUX_CLONE_UNIMPLEMENTED_FLAGS) {
-		DPRINTF("%s: Unsupported flags for clone3: %#x\n", __func__,
-		cl_args.flags & LINUX_CLONE_UNIMPLEMENTED_FLAGS);
+		DPRINTF("%s: Unsupported flags for clone3: %#" PRIx64 "\n",
+		__func__, cl_args.flags & LINUX_CLONE_UNIMPLEMENTED_FLAGS);
 		return EOPNOTSUPP;
 	}
 	if (cl_args.flags & ~LINUX_CLONE_ALLOWED_FLAGS) {
-		DPRINTF("%s: Disallowed flags for clone3: %#x\n", __func__,
-		cl_args.flags & ~LINUX_CLONE_ALLOWED_FLAGS);
+		DPRINTF("%s: Disallowed flags for clone3: %#" PRIx64 "\n",
+		__func__, cl_args.flags & ~LINUX_CLONE_ALLOWED_FLAGS);
 		return EINVAL;
 	}
 
@@ -274,7 +274,7 @@ linux_clone_nptl(struct lwp *l, const st
 	SCARG(uap, stack), 0, child_return, NULL, &l2, l->l_class,
 	&l->l_sigmask, &l->l_sigstk);
 	if (__predict_false(error)) {
-		DPRINTF(("%s: lwp_create error=%d\n", __func__, error));
+		DPRINTF("%s: lwp_create error=%d\n", __func__, error);
 		uvm_uarea_free(uaddr);
 		return error;
 	}
@@ -305,8 +305,8 @@ linux_clone_nptl(struct lwp *l, const st
 	if (flags & LINUX_CLONE_SETTLS) {
 		error = LINUX_LWP_SETPRIVATE(l2, tls);
 		if (error) {
-			DPRINTF(("%s: LINUX_LWP_SETPRIVATE %d\n", __func__,
-			error));
+			DPRINTF("%s: LINUX_LWP_SETPRIVATE %d\n", __func__,
+			error);
 			lwp_exit(l2);
 			return error;
 		}



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

2024-10-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Oct  3 12:56:50 UTC 2024

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

Log Message:
Fix fallout from DPRINTF conversion.

Kernels ALL/i386 and ALL/amd64 compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/common/linux_sched.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:05:17 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: Fix blank lines and comments.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:46:51 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Nix unused variable new_size.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:46:51 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Nix unused variable new_size.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.132 src/sys/compat/linux/common/linux_file.c:1.133
--- src/sys/compat/linux/common/linux_file.c:1.132	Tue Oct  1 17:18:45 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:46:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.132 2024/10/01 17:18:45 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.133 2024/10/01 17:46:51 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.132 2024/10/01 17:18:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.133 2024/10/01 17:46:51 riastradh Exp $");
 
 #include 
 #include 
@@ -1162,7 +1162,6 @@ linux_sys_copy_file_range(lwp_t *l,
 		error = EFBIG;
 		goto out;
 	}
-	const off_t new_size = off_out + len;
 
 	/* Identify overlapping ranges */
 	if ((invp == outvp) &&



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:05:17 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: Fix blank lines and comments.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.127 src/sys/compat/linux/common/linux_file.c:1.128
--- src/sys/compat/linux/common/linux_file.c:1.127	Tue Oct  1 17:00:27 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:05:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.127 2024/10/01 17:00:27 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.128 2024/10/01 17:05:16 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.127 2024/10/01 17:00:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.128 2024/10/01 17:05:16 riastradh Exp $");
 
 #include 
 #include 
@@ -912,7 +912,6 @@ linux_sys_dup3(struct lwp *l, const stru
 	return dodup(l, SCARG(uap, from), SCARG(uap, to), flags, retval);
 }
 
-
 int
 linux_to_bsd_atflags(int lflags)
 {
@@ -937,7 +936,7 @@ linux_sys_faccessat2(lwp_t *l, const str
 		syscallarg(const char *) path;
 		syscallarg(int) amode;
 		syscallarg(int) flags;
-	}*/
+	} */
 	int flag = linux_to_bsd_atflags(SCARG(uap, flags));
 	int mode = SCARG(uap, amode);
 	int fd = SCARG(uap, fd);
@@ -946,7 +945,6 @@ linux_sys_faccessat2(lwp_t *l, const str
 	return do_sys_accessat(l, fd, path, mode, flag);
 }
 
-
 int
 linux_sys_sync_file_range(lwp_t *l,
 const struct linux_sys_sync_file_range_args *uap, register_t *retval)
@@ -1083,12 +1081,11 @@ linux_sys_copy_file_range(lwp_t *l,
 	int error = 0;
 	size_t len = SCARG(uap, len);
 	unsigned int flags = SCARG(uap, flags);
-	// Structures for actual copy
+	/* Structures for actual copy */
 	char *buffer = NULL;
 	struct uio auio;
 	struct iovec aiov;
 
-
 	if (len > SSIZE_MAX) {
 		DPRINTF("%s: len is greater than SSIZE_MAX\n",
 		__func__);
@@ -1284,7 +1281,6 @@ out:
 	return error;
 }
 
-
 #define LINUX_NOT_SUPPORTED(fun) \
 int \
 fun(struct lwp *l, const struct fun##_args *uap, register_t *retval) \



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:18:46 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Avoid more UB arithmetic overflow.

Need to check the input offset too, not just the output offset.

No functional change in the non-UB case.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.131 src/sys/compat/linux/common/linux_file.c:1.132
--- src/sys/compat/linux/common/linux_file.c:1.131	Tue Oct  1 17:15:59 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:18:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.131 2024/10/01 17:15:59 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.132 2024/10/01 17:18:45 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.131 2024/10/01 17:15:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.132 2024/10/01 17:18:45 riastradh Exp $");
 
 #include 
 #include 
@@ -1156,7 +1156,8 @@ linux_sys_copy_file_range(lwp_t *l,
 		have_off_out = true;
 	}
 
-	if (off_out < 0 || len > OFF_MAX - off_out) {
+	if (off_out < 0 || len > OFF_MAX - off_out ||
+	off_in < 0 || len > OFF_MAX - off_in) {
 		DPRINTF("%s: New size is greater than OFF_MAX\n", __func__);
 		error = EFBIG;
 		goto out;



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:15:59 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Avoid UB arithmetic overflow.

No functional change intended in the non-UB case.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:18:46 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Avoid more UB arithmetic overflow.

Need to check the input offset too, not just the output offset.

No functional change in the non-UB case.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:15:59 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Avoid UB arithmetic overflow.

No functional change intended in the non-UB case.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.130 src/sys/compat/linux/common/linux_file.c:1.131
--- src/sys/compat/linux/common/linux_file.c:1.130	Tue Oct  1 17:11:39 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:15:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.130 2024/10/01 17:11:39 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.131 2024/10/01 17:15:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.130 2024/10/01 17:11:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.131 2024/10/01 17:15:59 riastradh Exp $");
 
 #include 
 #include 
@@ -1069,7 +1069,7 @@ linux_sys_copy_file_range(lwp_t *l,
 		syscallarg(size_t) len;
 		syscallarg(unsigned int) flags;
 	} */
-
+	const off_t OFF_MAX = __type_max(off_t);
 	int fd_in, fd_out;
 	file_t *fp_in, *fp_out;
 	struct vnode *invp, *outvp;
@@ -1156,12 +1156,12 @@ linux_sys_copy_file_range(lwp_t *l,
 		have_off_out = true;
 	}
 
-	off_t new_size = off_out + len;
-	if (new_size < 0) {
+	if (off_out < 0 || len > OFF_MAX - off_out) {
 		DPRINTF("%s: New size is greater than OFF_MAX\n", __func__);
 		error = EFBIG;
 		goto out;
 	}
+	const off_t new_size = off_out + len;
 
 	/* Identify overlapping ranges */
 	if ((invp == outvp) &&



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:11:39 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: KNF

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:11:39 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: KNF

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.129 src/sys/compat/linux/common/linux_file.c:1.130
--- src/sys/compat/linux/common/linux_file.c:1.129	Tue Oct  1 17:08:47 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:11:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.129 2024/10/01 17:08:47 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.130 2024/10/01 17:11:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.129 2024/10/01 17:08:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.130 2024/10/01 17:11:39 riastradh Exp $");
 
 #include 
 #include 
@@ -1092,7 +1092,7 @@ linux_sys_copy_file_range(lwp_t *l,
 		return EOVERFLOW;
 	}
 
-	if(flags != 0) {
+	if (flags != 0) {
 		DPRINTF("%s: unsupported flags %#x\n", __func__, flags);
 		return EINVAL;
 	}
@@ -1106,8 +1106,8 @@ linux_sys_copy_file_range(lwp_t *l,
 
 	error = fd_getvnode(fd_out, &fp_out);
 	if (error) {
-		fd_putfile(fd_in);
-		return error;
+		fd_putfile(fd_in);
+		return error;
 	}
 
 	invp = fp_in->f_vnode;
@@ -1124,16 +1124,16 @@ linux_sys_copy_file_range(lwp_t *l,
 		goto out;
 	}
 	if ((SCARG(uap, off_in) != NULL && *SCARG(uap, off_in) < 0) ||
-	   (SCARG(uap, off_out) != NULL && *SCARG(uap, off_out) < 0) ||
-	   vattr_in.va_type != VREG || vattr_out.va_type != VREG)
-{
+	(SCARG(uap, off_out) != NULL && *SCARG(uap, off_out) < 0) ||
+	vattr_in.va_type != VREG || vattr_out.va_type != VREG) {
 		error = EINVAL;
 		DPRINTF("%s: Invalid offset or file type\n", __func__);
 		goto out;
 	}
 
 	if ((fp_in->f_flag & FREAD) == 0 ||
-	(fp_out->f_flag & FWRITE) == 0 || (fp_out->f_flag & FAPPEND) != 0) {
+	(fp_out->f_flag & FWRITE) == 0 ||
+	(fp_out->f_flag & FAPPEND) != 0) {
 		DPRINTF("%s: input file can't be read or output file "
 		"can't be written\n", __func__);
 		error = EBADF;
@@ -1141,19 +1141,19 @@ linux_sys_copy_file_range(lwp_t *l,
 	}
 	/* Retrieve and validate offsets if provided */
 	if (SCARG(uap, off_in) != NULL) {
-	error = copyin(SCARG(uap, off_in), &off_in, sizeof(off_in));
-	if (error) {
-		goto out;
-	}
-	have_off_in = true;
+		error = copyin(SCARG(uap, off_in), &off_in, sizeof(off_in));
+		if (error) {
+			goto out;
+		}
+		have_off_in = true;
 	}
 
 	if (SCARG(uap, off_out) != NULL) {
-	error = copyin(SCARG(uap, off_out), &off_out, sizeof(off_out));
-	if (error) {
-		goto out;
-	}
-	have_off_out = true;
+		error = copyin(SCARG(uap, off_out), &off_out, sizeof(off_out));
+		if (error) {
+			goto out;
+		}
+		have_off_out = true;
 	}
 
 	off_t new_size = off_out + len;
@@ -1166,7 +1166,7 @@ linux_sys_copy_file_range(lwp_t *l,
 	/* Identify overlapping ranges */
 	if ((invp == outvp) &&
 	((off_in <= off_out && off_in + (off_t)len > off_out) ||
-	(off_in > off_out && off_out + (off_t)len > off_in))) {
+		(off_in > off_out && off_out + (off_t)len > off_in))) {
 		DPRINTF("%s: Ranges overlap\n", __func__);
 		error = EINVAL;
 		goto out;



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:08:47 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Prune dead branch.

kmem_alloc(KM_SLEEP) can't fail.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.128 src/sys/compat/linux/common/linux_file.c:1.129
--- src/sys/compat/linux/common/linux_file.c:1.128	Tue Oct  1 17:05:16 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:08:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.128 2024/10/01 17:05:16 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.129 2024/10/01 17:08:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.128 2024/10/01 17:05:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.129 2024/10/01 17:08:47 riastradh Exp $");
 
 #include 
 #include 
@@ -1173,11 +1173,6 @@ linux_sys_copy_file_range(lwp_t *l,
 	}
 
 	buffer = kmem_alloc(LINUX_COPY_FILE_RANGE_MAX_CHUNK, KM_SLEEP);
-	/* Allocation cannot fail, so no need for error handling? */
-	if (buffer == NULL) {
-		error = ENOMEM;
-		goto out;
-	}
 
 	bytes_left = len;
 



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:08:47 UTC 2024

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

Log Message:
linux_sys_copy_file_range: Prune dead branch.

kmem_alloc(KM_SLEEP) can't fail.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:00:27 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: KNF in function heads.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/linux/common/linux_file.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_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.126 src/sys/compat/linux/common/linux_file.c:1.127
--- src/sys/compat/linux/common/linux_file.c:1.126	Tue Oct  1 16:41:29 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 17:00:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.126 2024/10/01 16:41:29 riastradh Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.127 2024/10/01 17:00:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.126 2024/10/01 16:41:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.127 2024/10/01 17:00:27 riastradh Exp $");
 
 #include 
 #include 
@@ -174,7 +174,8 @@ linux_hilo_to_off_t(unsigned long hi, un
  * Just call open(2) with the TRUNC, CREAT and WRONLY flags.
  */
 int
-linux_sys_creat(struct lwp *l, const struct linux_sys_creat_args *uap, register_t *retval)
+linux_sys_creat(struct lwp *l, const struct linux_sys_creat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(const char *) path;
@@ -223,7 +224,8 @@ linux_open_ctty(struct lwp *l, int flags
  * (XXX is this necessary?)
  */
 int
-linux_sys_open(struct lwp *l, const struct linux_sys_open_args *uap, register_t *retval)
+linux_sys_open(struct lwp *l, const struct linux_sys_open_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(const char *) path;
@@ -247,7 +249,8 @@ linux_sys_open(struct lwp *l, const stru
 }
 
 int
-linux_sys_openat(struct lwp *l, const struct linux_sys_openat_args *uap, register_t *retval)
+linux_sys_openat(struct lwp *l, const struct linux_sys_openat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(int) fd;
@@ -279,7 +282,8 @@ linux_sys_openat(struct lwp *l, const st
  * because the flag values and lock structure are different.
  */
 int
-linux_sys_fcntl(struct lwp *l, const struct linux_sys_fcntl_args *uap, register_t *retval)
+linux_sys_fcntl(struct lwp *l, const struct linux_sys_fcntl_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(int) fd;
@@ -511,7 +515,8 @@ bsd_to_linux_stat(struct stat *bsp, stru
  * by one function to avoid code duplication.
  */
 int
-linux_sys_fstat(struct lwp *l, const struct linux_sys_fstat_args *uap, register_t *retval)
+linux_sys_fstat(struct lwp *l, const struct linux_sys_fstat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(int) fd;
@@ -530,7 +535,8 @@ linux_sys_fstat(struct lwp *l, const str
 }
 
 static int
-linux_stat1(const struct linux_sys_stat_args *uap, register_t *retval, int flags)
+linux_stat1(const struct linux_sys_stat_args *uap, register_t *retval,
+int flags)
 {
 	struct linux_stat tmplst;
 	struct stat tmpst;
@@ -546,7 +552,8 @@ linux_stat1(const struct linux_sys_stat_
 }
 
 int
-linux_sys_stat(struct lwp *l, const struct linux_sys_stat_args *uap, register_t *retval)
+linux_sys_stat(struct lwp *l, const struct linux_sys_stat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(const char *) path;
@@ -559,7 +566,8 @@ linux_sys_stat(struct lwp *l, const stru
 /* Note: this is "newlstat" in the Linux sources */
 /*	(we don't bother with the old lstat currently) */
 int
-linux_sys_lstat(struct lwp *l, const struct linux_sys_lstat_args *uap, register_t *retval)
+linux_sys_lstat(struct lwp *l, const struct linux_sys_lstat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(const char *) path;
@@ -575,7 +583,8 @@ linux_sys_lstat(struct lwp *l, const str
  */
 
 int
-linux_sys_linkat(struct lwp *l, const struct linux_sys_linkat_args *uap, register_t *retval)
+linux_sys_linkat(struct lwp *l, const struct linux_sys_linkat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(int) fd1;
@@ -629,7 +638,8 @@ linux_unlink_dircheck(const char *path)
 }
 
 int
-linux_sys_unlink(struct lwp *l, const struct linux_sys_unlink_args *uap, register_t *retval)
+linux_sys_unlink(struct lwp *l, const struct linux_sys_unlink_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(const char *) path;
@@ -644,7 +654,8 @@ linux_sys_unlink(struct lwp *l, const st
 }
 
 int
-linux_sys_unlinkat(struct lwp *l, const struct linux_sys_unlinkat_args *uap, register_t *retval)
+linux_sys_unlinkat(struct lwp *l, const struct linux_sys_unlinkat_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(int) fd;
@@ -666,7 +677,8 @@ linux_sys_unlinkat(struct lwp *l, const 
 }
 
 int
-linux_sys_mknod(struct lwp *l, const struct linux_sys

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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 17:00:27 UTC 2024

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

Log Message:
sys/compat/linux/common/linux_file.c: KNF in function heads.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/compat/linux/common/linux_file.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:41:29 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_cdrom.c linux_file.c linux_inotify.c
linux_ioctl.c linux_ioctl.h linux_limit.h linux_misc.c linux_misc.h
linux_mod.c linux_msg.h linux_mtio.c linux_prctl.h linux_sched.c
linux_signal.c linux_socket.c linux_sockio.h

Log Message:
sys/compat/linux/common: Nix trailing whitespace, and one blank line.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_cdrom.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_inotify.c
cvs rdiff -u -r1.59 -r1.60 src/sys/compat/linux/common/linux_ioctl.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/common/linux_ioctl.h
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/common/linux_limit.h
cvs rdiff -u -r1.266 -r1.267 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/common/linux_msg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_mtio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/common/linux_prctl.h
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/common/linux_sched.c
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.155 -r1.156 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/common/linux_sockio.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_cdrom.c
diff -u src/sys/compat/linux/common/linux_cdrom.c:1.28 src/sys/compat/linux/common/linux_cdrom.c:1.29
--- src/sys/compat/linux/common/linux_cdrom.c:1.28	Tue Sep  7 11:43:04 2021
+++ src/sys/compat/linux/common/linux_cdrom.c	Tue Oct  1 16:41:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_cdrom.c,v 1.28 2021/09/07 11:43:04 riastradh Exp $ */
+/*	$NetBSD: linux_cdrom.c,v 1.29 2024/10/01 16:41:29 riastradh Exp $ */
 
 /*
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.28 2021/09/07 11:43:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.29 2024/10/01 16:41:29 riastradh Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ linux_ioctl_cdrom(struct lwp *l, const s
 	file_t *fp;
 	int (*ioctlf)(file_t *, u_long, void *);
 
-	union { 
+	union {
 		struct linux_cdrom_blk ll_blk;
 		struct linux_cdrom_msf ll_msf;
 		struct linux_cdrom_ti ll_ti;

Index: src/sys/compat/linux/common/linux_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.125 src/sys/compat/linux/common/linux_file.c:1.126
--- src/sys/compat/linux/common/linux_file.c:1.125	Sat Sep 28 19:35:56 2024
+++ src/sys/compat/linux/common/linux_file.c	Tue Oct  1 16:41:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file.c,v 1.125 2024/09/28 19:35:56 christos Exp $	*/
+/*	$NetBSD: linux_file.c,v 1.126 2024/10/01 16:41:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.125 2024/09/28 19:35:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.126 2024/10/01 16:41:29 riastradh Exp $");
 
 #include 
 #include 
@@ -156,7 +156,7 @@ linux_hilo_to_off_t(unsigned long hi, un
 	 * argument regardless, the "lo" argument has all the bits in
 	 * this case.
 	 */
-	(void) hi; 
+	(void) hi;
 	return (off_t)lo;
 #else
 	return (((off_t)hi) << 32) | lo;
@@ -928,7 +928,7 @@ linux_sys_faccessat2(lwp_t *l, const str
 }
 
 
-int	
+int
 linux_sys_sync_file_range(lwp_t *l,
 const struct linux_sys_sync_file_range_args *uap, register_t *retval)
 {
@@ -938,7 +938,7 @@ linux_sys_sync_file_range(lwp_t *l,
 		syscallarg(off_t) nbytes;
 		syscallarg(unsigned int) flags;
 	} */
-	
+
 	struct sys_fsync_range_args ua;
 
 	if (SCARG(uap, offset) < 0 || SCARG(uap, nbytes) < 0 ||
@@ -955,13 +955,13 @@ linux_sys_sync_file_range(lwp_t *l,
 	if (SCARG(&ua, length) != 0) {
 		/* Round up length to nbytes+offset to page boundary */
 		SCARG(&ua, length) = roundup(SCARG(uap, nbytes)
-		+ SCARG(uap, offset) - SCARG(&ua, start), PAGE_SIZE);	
+		+ SCARG(uap, offset) - SCARG(&ua, start), PAGE_SIZE);
 	}
-	
+
 	return sys_fsync_range(l, &ua, retval);
 }
 
-int	
+int
 linux_sys_syncfs(lwp_t *l, const struct linux_sys_syncfs_args *uap,
 register_t *retval)
 {
@@ -974,15 +974,15 @@ linux_sys_syncfs(lwp_t *l, const struct 
 	file_t *fp;
 	int error, fd;
 	fd = SCARG(uap, fd);
-	
+
 	/* Get file pointer */
 	if ((error = fd_getvnode(fd, &fp)) != 0)
 		return error;
-
+
 	/* Get vnode and mount point */
 	vp = fp->f_vnode;
 	mp = vp->v_mount;
-
+
 	mutex_

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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:41:29 UTC 2024

Modified Files:
src/sys/compat/linux/common: linux_cdrom.c linux_file.c linux_inotify.c
linux_ioctl.c linux_ioctl.h linux_limit.h linux_misc.c linux_misc.h
linux_mod.c linux_msg.h linux_mtio.c linux_prctl.h linux_sched.c
linux_signal.c linux_socket.c linux_sockio.h

Log Message:
sys/compat/linux/common: Nix trailing whitespace, and one blank line.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_cdrom.c
cvs rdiff -u -r1.125 -r1.126 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_inotify.c
cvs rdiff -u -r1.59 -r1.60 src/sys/compat/linux/common/linux_ioctl.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/common/linux_ioctl.h
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/common/linux_limit.h
cvs rdiff -u -r1.266 -r1.267 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/common/linux_msg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_mtio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/common/linux_prctl.h
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/common/linux_sched.c
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.155 -r1.156 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/common/linux_sockio.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/arch

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:29:15 UTC 2024

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

Log Message:
sys/compat/linux/arch/*/syscalls.master: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.87 -r1.88 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/mips/syscalls.master
diff -u src/sys/compat/linux/arch/mips/syscalls.master:1.82 src/sys/compat/linux/arch/mips/syscalls.master:1.83
--- src/sys/compat/linux/arch/mips/syscalls.master:1.82	Sat Sep 28 19:35:56 2024
+++ src/sys/compat/linux/arch/mips/syscalls.master	Tue Oct  1 16:29:15 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.82 2024/09/28 19:35:56 christos Exp $  
+	$NetBSD: syscalls.master,v 1.83 2024/10/01 16:29:15 riastradh Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 

Index: src/sys/compat/linux/arch/powerpc/syscalls.master
diff -u src/sys/compat/linux/arch/powerpc/syscalls.master:1.87 src/sys/compat/linux/arch/powerpc/syscalls.master:1.88
--- src/sys/compat/linux/arch/powerpc/syscalls.master:1.87	Sat Sep 28 19:35:56 2024
+++ src/sys/compat/linux/arch/powerpc/syscalls.master	Tue Oct  1 16:29:15 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.87 2024/09/28 19:35:56 christos Exp $  
+	$NetBSD: syscalls.master,v 1.88 2024/10/01 16:29:15 riastradh Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 



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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:35:42 UTC 2024

Modified Files:
src/sys/compat/linux/arch/alpha: linux_osf1.c linux_types.h
src/sys/compat/linux/arch/amd64: Makefile linux_errno.h linux_exec.h
linux_exec_machdep.c linux_fcntl.h linux_ioctl.h linux_machdep.c
linux_machdep.h linux_mmap.h linux_prctl.h linux_sigarray.c
linux_siginfo.h linux_signal.h linux_socket.h linux_termios.h
linux_types.h
src/sys/compat/linux/arch/m68k: linux_machdep.c

Log Message:
sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/alpha/linux_osf1.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/alpha/linux_types.h
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/arch/amd64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/amd64/linux_errno.h \
src/sys/compat/linux/arch/amd64/linux_mmap.h \
src/sys/compat/linux/arch/amd64/linux_socket.h \
src/sys/compat/linux/arch/amd64/linux_termios.h
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/arch/amd64/linux_exec.h \
src/sys/compat/linux/arch/amd64/linux_types.h
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/amd64/linux_exec_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/amd64/linux_fcntl.h \
src/sys/compat/linux/arch/amd64/linux_signal.h
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/amd64/linux_ioctl.h \
src/sys/compat/linux/arch/amd64/linux_prctl.h \
src/sys/compat/linux/arch/amd64/linux_sigarray.c
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/arch/amd64/linux_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux/arch/amd64/linux_machdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/arch/amd64/linux_siginfo.h
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/linux/arch/m68k/linux_machdep.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/alpha/linux_osf1.c
diff -u src/sys/compat/linux/arch/alpha/linux_osf1.c:1.5 src/sys/compat/linux/arch/alpha/linux_osf1.c:1.6
--- src/sys/compat/linux/arch/alpha/linux_osf1.c:1.5	Tue Sep  7 11:43:03 2021
+++ src/sys/compat/linux/arch/alpha/linux_osf1.c	Tue Oct  1 16:35:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_osf1.c,v 1.5 2021/09/07 11:43:03 riastradh Exp $	*/
+/*	$NetBSD: linux_osf1.c,v 1.6 2024/10/01 16:35:41 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_osf1.c,v 1.5 2021/09/07 11:43:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_osf1.c,v 1.6 2024/10/01 16:35:41 riastradh Exp $");
 
 #include 
 #include 
@@ -372,7 +372,7 @@ linux_sys_osf1_setitimer(struct lwp *l, 
 		if (error)
 			return error;
 	}
-		
+
 	error = dosetitimer(l->l_proc, which, &b_itv);
 
 	if (error == 0 || SCARG(uap, oitv) == NULL)

Index: src/sys/compat/linux/arch/alpha/linux_types.h
diff -u src/sys/compat/linux/arch/alpha/linux_types.h:1.8 src/sys/compat/linux/arch/alpha/linux_types.h:1.9
--- src/sys/compat/linux/arch/alpha/linux_types.h:1.8	Sun Feb 12 14:59:22 2023
+++ src/sys/compat/linux/arch/alpha/linux_types.h	Tue Oct  1 16:35:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_types.h,v 1.8 2023/02/12 14:59:22 andvar Exp $	*/
+/*	$NetBSD: linux_types.h,v 1.9 2024/10/01 16:35:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@ struct linux_stat64 {
 	unsigned int		__pad0;
 
 	unsigned long		lst_atime;
-	unsigned long		lst_atime_nsec; 
+	unsigned long		lst_atime_nsec;
 	unsigned long		lst_mtime;
 	unsigned long		lst_mtime_nsec;
 	unsigned long		lst_ctime;

Index: src/sys/compat/linux/arch/amd64/Makefile
diff -u src/sys/compat/linux/arch/amd64/Makefile:1.4 src/sys/compat/linux/arch/amd64/Makefile:1.5
--- src/sys/compat/linux/arch/amd64/Makefile:1.4	Wed May 29 18:58:00 2024
+++ src/sys/compat/linux/arch/amd64/Makefile	Tue Oct  1 16:35:42 2024
@@ -1,3 +1,3 @@
-#	$NetBSD: Makefile,v 1.4 2024/05/29 18:58:00 christos Exp $ 
+#	$NetBSD: Makefile,v 1.5 2024/10/01 16:35:42 riastradh Exp $
 
 .include "../../Makefile.inc"

Index: src/sys/compat/linux/arch/amd64/linux_errno.h
diff -u src/sys/compat/linux/arch/amd64/linux_errno.h:1.3 src/sys/compat/linux/arch/amd64/linux_errno.h:1.4
--- src/sys/compat/linux/arch/amd64/linux_errno.h:1.3	Tue Dec 17 22:14:24 2013
+++ src/sys/compat/linux/arch/amd64/linux_errno.h	Tue Oct  1 16:35:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_errno.h,v 1.3 2013/12/17 22:14:24 njoly Exp $ */
+/*	$NetBSD: linux_errno.h,v 1.4 2024/10/01 16:35:42 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -14,14 +14,14 @@
  * 3. All advertising materials mentioning features or use of this software
  *must display the following acknowledgement:
  *	This product inclu

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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:35:42 UTC 2024

Modified Files:
src/sys/compat/linux/arch/alpha: linux_osf1.c linux_types.h
src/sys/compat/linux/arch/amd64: Makefile linux_errno.h linux_exec.h
linux_exec_machdep.c linux_fcntl.h linux_ioctl.h linux_machdep.c
linux_machdep.h linux_mmap.h linux_prctl.h linux_sigarray.c
linux_siginfo.h linux_signal.h linux_socket.h linux_termios.h
linux_types.h
src/sys/compat/linux/arch/m68k: linux_machdep.c

Log Message:
sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/alpha/linux_osf1.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/alpha/linux_types.h
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/arch/amd64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/amd64/linux_errno.h \
src/sys/compat/linux/arch/amd64/linux_mmap.h \
src/sys/compat/linux/arch/amd64/linux_socket.h \
src/sys/compat/linux/arch/amd64/linux_termios.h
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/arch/amd64/linux_exec.h \
src/sys/compat/linux/arch/amd64/linux_types.h
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/linux/arch/amd64/linux_exec_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/amd64/linux_fcntl.h \
src/sys/compat/linux/arch/amd64/linux_signal.h
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/amd64/linux_ioctl.h \
src/sys/compat/linux/arch/amd64/linux_prctl.h \
src/sys/compat/linux/arch/amd64/linux_sigarray.c
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/arch/amd64/linux_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux/arch/amd64/linux_machdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/arch/amd64/linux_siginfo.h
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/linux/arch/m68k/linux_machdep.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

2024-10-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct  1 16:29:15 UTC 2024

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

Log Message:
sys/compat/linux/arch/*/syscalls.master: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.87 -r1.88 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.



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

2024-09-30 Thread Christos Zoulas

> 
> This code could have done that - implemented linux's clone3() and then
> redefined clone() to be a particular way of calling clone3() (which is
> what I'd guess linux implementations might do, if they don't just have
> both versions in full).   That would have worked, but requires updating
> the clone() implementation to be clone3() (even if on NetBSD lots of the
> added stuff is simply meaningless).

Stay tuned for that. Shivraj is working on it.

christos


signature.asc
Description: Message signed with OpenPGP


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

2024-09-30 Thread Robert Elz
Date:Mon, 30 Sep 2024 09:09:04 -0400
From:Christos Zoulas 
Message-ID:  <2f4ec894-d66f-4608-84b1-7dd8433eb...@zoulas.com>

  | [quoting mrg@]
  | > this looks like it should use NETBSD32IPTR64(),

No, that would be wrong (even if it happened to work), it is expecting
to be given a 32 bit pointer (as an int) and converts that to a regular
pointer for 64 bit arch's.   Here we have 64 bit pointers (as integers)
to be treated as 32 bit pointers (when built on a 32 bit arch).

  | See the comment in /usr/src/sys/compat/netbsd32/netbsd32.h:
  |
  |  *  NETBSD32_POINTER_TYPE
  |  *  - 32-bit pointer type, normally uint32_t but can be int32_t
  |  *for platforms which rely on sign-extension of pointers
  |  *such as SH-5.
  |  *eg:   #define NETBSD32_POINTER_TYPE uint32_t

All of this is more or less assuming that the desire is to run 32 bit
applications on a 64 bit system, which is no surprise, as that's what
it is all for.

What's happening in the file in question (linux compat mode) when running
(or building) on i386 is taking a linux defined interface, defined to work
for 64 bit systems (even when used on a 32 bit host), and running it on a
32 bit system.   This is all more or less the direct opposite of what
the netbsd32 compat stiff is designed for.

It is even more messed up, as the code is trying to implement a new
interface in terms of the older one it is to replace, which isn't
something that is normally done.

When an interface is enhanced, the usual practice is to redefine the
older version in terms of the newer, with some form of default settings
for the new features, so the new interface behaves the same way as the
more limited older one would have.

This code could have done that - implemented linux's clone3() and then
redefined clone() to be a particular way of calling clone3() (which is
what I'd guess linux implementations might do, if they don't just have
both versions in full).   That would have worked, but requires updating
the clone() implementation to be clone3() (even if on NetBSD lots of the
added stuff is simply meaningless).

kre



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

2024-09-30 Thread Christos Zoulas


> On Sep 29, 2024, at 10:27 PM, matthew green  wrote:
> 
> thanks for fixing the build.
> 
> "Robert Elz" writes:
>> Module Name: src
>> Committed By:kre
>> Date:Mon Sep 30 01:26:48 UTC 2024
>> 
>> Modified Files:
>>  src/sys/compat/linux/common: linux_sched.c
>> 
>> Log Message:
>> Supply a missing cast, which fixes the i386 (other 32 bit too probably)
>> builds.
>> 
>> Note I used uintptr_t rather than intptr_t which other similar
>> lines nearby use - the int being converted to a ptr is uint64_t
>> so using unsigned seemed safer to me.   Feel free to change it.
> 
> this looks like it should use NETBSD32IPTR64(), but that uses
> intptr_t for reasons i don't recall but that may matter.  maybe
> we need better checking in general - does linux reject this one
> 32-bit platforms if 'stack' has high half set, or perhaps the code
> just assigns 64-bit input to a 32-it pointer and ignores them.
> 
> christos?  do you know?


See the comment in /usr/src/sys/compat/netbsd32/netbsd32.h:

 *  NETBSD32_POINTER_TYPE
 *  - 32-bit pointer type, normally uint32_t but can be int32_t
 *for platforms which rely on sign-extension of pointers
 *such as SH-5.
 *eg:   #define NETBSD32_POINTER_TYPE uint32_t

And then:

http://bxr.su/search?q=&defs=&refs=NETBSD32_POINTER_TYPE&path=&project=NetBSD

mips and riscv use int32_t and the rest use uint32_t.

christos

signature.asc
Description: Message signed with OpenPGP


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

2024-09-29 Thread matthew green
thanks for fixing the build.

"Robert Elz" writes:
> Module Name:  src
> Committed By: kre
> Date: Mon Sep 30 01:26:48 UTC 2024
>
> Modified Files:
>   src/sys/compat/linux/common: linux_sched.c
>
> Log Message:
> Supply a missing cast, which fixes the i386 (other 32 bit too probably)
> builds.
>
> Note I used uintptr_t rather than intptr_t which other similar
> lines nearby use - the int being converted to a ptr is uint64_t
> so using unsigned seemed safer to me.   Feel free to change it.

this looks like it should use NETBSD32IPTR64(), but that uses
intptr_t for reasons i don't recall but that may matter.  maybe
we need better checking in general - does linux reject this one
32-bit platforms if 'stack' has high half set, or perhaps the code
just assigns 64-bit input to a 32-it pointer and ignores them.

christos?  do you know?


.mrg.


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

2024-09-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Sep 30 01:26:48 UTC 2024

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

Log Message:
Supply a missing cast, which fixes the i386 (other 32 bit too probably)
builds.

Note I used uintptr_t rather than intptr_t which other similar
lines nearby use - the int being converted to a ptr is uint64_t
so using unsigned seemed safer to me.   Feel free to change it.

Not sure if the code will work though - linux's clone3() is
being emulated via its clone() sys call - I know nothing about
linux sys calls, but my impression of these two is that in
clone() the "stack" arg points at the logical stack start
(usually the highest addr in the stack segment - though there
are some systems with upward growing stacks) whereas for
clone3() it looks to me as if the stack arg is always intended
to be the lowest addr in the stack segment (with a new size
field added to compute the top).  Simply copying that arg to the
clone() arg of the same name might not work.  (I am surmising).
I'd expect the code to need to vary based upon in which direction
the architecture's stack grows.   Maybe.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/common/linux_sched.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

2024-09-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Sep 30 01:26:48 UTC 2024

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

Log Message:
Supply a missing cast, which fixes the i386 (other 32 bit too probably)
builds.

Note I used uintptr_t rather than intptr_t which other similar
lines nearby use - the int being converted to a ptr is uint64_t
so using unsigned seemed safer to me.   Feel free to change it.

Not sure if the code will work though - linux's clone3() is
being emulated via its clone() sys call - I know nothing about
linux sys calls, but my impression of these two is that in
clone() the "stack" arg points at the logical stack start
(usually the highest addr in the stack segment - though there
are some systems with upward growing stacks) whereas for
clone3() it looks to me as if the stack arg is always intended
to be the lowest addr in the stack segment (with a new size
field added to compute the top).  Simply copying that arg to the
clone() arg of the same name might not work.  (I am surmising).
I'd expect the code to need to vary based upon in which direction
the architecture's stack grows.   Maybe.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/common/linux_sched.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_sched.c
diff -u src/sys/compat/linux/common/linux_sched.c:1.80 src/sys/compat/linux/common/linux_sched.c:1.81
--- src/sys/compat/linux/common/linux_sched.c:1.80	Sun Sep 29 00:09:52 2024
+++ src/sys/compat/linux/common/linux_sched.c	Mon Sep 30 01:26:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sched.c,v 1.80 2024/09/29 00:09:52 christos Exp $	*/
+/*	$NetBSD: linux_sched.c,v 1.81 2024/09/30 01:26:47 kre Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.80 2024/09/29 00:09:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.81 2024/09/30 01:26:47 kre Exp $");
 
 #include 
 #include 
@@ -230,7 +230,7 @@ linux_sys_clone3(struct lwp *l, const st
 	// XXX: clone3 has stacksize, instead implement clone as a clone3
 	// wrapper.
 	SCARG(&clone_args, flags) = flags;
-	SCARG(&clone_args, stack) = (void *)cl_args.stack;
+	SCARG(&clone_args, stack) = (void *)(uintptr_t)cl_args.stack;
 	SCARG(&clone_args, parent_tidptr) =
 	(void *)(intptr_t)cl_args.parent_tid;
 	SCARG(&clone_args, tls) =



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

2024-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 29 00:09:52 UTC 2024

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

Log Message:
move clone3 to linux_sched.c and make it compile (need to fix XXX comments)


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/common/linux_sched.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.265 src/sys/compat/linux/common/linux_misc.c:1.266
--- src/sys/compat/linux/common/linux_misc.c:1.265	Sat Sep 28 15:35:56 2024
+++ src/sys/compat/linux/common/linux_misc.c	Sat Sep 28 20:09:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.265 2024/09/28 19:35:56 christos Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.266 2024/09/29 00:09:52 christos 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.265 2024/09/28 19:35:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.266 2024/09/29 00:09:52 christos Exp $");
 
 #include 
 #include 
@@ -2171,63 +2171,3 @@ linux_sys_getcpu(lwp_t *l, const struct 
 
 	return 0;
 }
-
-int
-linux_sys_clone3(struct lwp *l, const struct linux_sys_clone3_args *uap, register_t *retval)
-{
-	struct linux_user_clone3_args cl_args;
-	struct linux_sys_clone_args clone_args;
-	int error;
-
-	if (SCARG(uap, size) != sizeof(cl_args)) {
-	DPRINTF("%s: Invalid size less or more\n", __func__);
-	return EINVAL;
-	}
-
-	error = copyin(SCARG(uap, cl_args), &cl_args, SCARG(uap, size));
-	if (error) {
-		DPRINTF("%s: Copyin failed: %d\n", __func__, error);
-		return error;
-	}
-
-	DPRINTF("%sFlags: %#lx\n", (unsigned long)cl_args.flags);
-
-	/* Define allowed flags */
-	if (cl_args.flags & LINUX_CLONE_UNIMPLEMENTED_FLAGS) {
-		DPRINTF("%s: Unsupported flags for clone3: %#x\n", __func__,
-		cl_args.flags & LINUX_CLONE_UNIMPLEMENTED_FLAGS);
-		return EOPNOTSUPP;
-	}
-	if (cl_args.flags & ~LINUX_CLONE_ALLOWED_FLAGS) {
-		DPRINTF("%s: Disallowed flags for clone3: %#x\n", __func__,
-		cl_args.flags & ~LINUX_CLONE_ALLOWED_FLAGS);
-		return EINVAL;
-	}
-
-	if ((cl_args.exit_signal & ~(uint64_t)LINUX_CLONE_CSIGNAL) != 0){
-		DPRINTF("%s: Disallowed flags for clone3: %#x\n", __func__,
-		cl_args.exit_signal & ~(uint64_t)LINUX_CLONE_CSIGNAL);
-		return EINVAL;
-	}
-	
-	if (cl_args.stack == 0 && cl_args.stack_size != 0) {
-		DPRINTF("%s: Stack is NULL but stack size is not 0\n",
-		__func__);
-		return EINVAL;
-	}
-	if (cl_args.stack != 0 && cl_args.stack_size == 0) {
-		DPRINTF("%s: Stack is not NULL but stack size is 0\n",
-		__func__);
-		return EINVAL;
-	}
-
-	int flags = cl_args.flags & LINUX_CLONE_ALLOWED_FLAGS;
-	int sig = cl_args.exit_signal & LINUX_CLONE_CSIGNAL;
-	SCARG(&clone_args, flags) = flags | sig;
-	SCARG(&clone_args, stack) = (void *)cl_args.stack;
-	SCARG(&clone_args, parent_tidptr) = (void *)cl_args.parent_tid;
-	SCARG(&clone_args, tls) = (void *)cl_args.tls;
-	SCARG(&clone_args, child_tidptr) = (void *)cl_args.child_tid;
-
-	return linux_sys_clone(l, &clone_args, retval);
-}

Index: src/sys/compat/linux/common/linux_sched.c
diff -u src/sys/compat/linux/common/linux_sched.c:1.79 src/sys/compat/linux/common/linux_sched.c:1.80
--- src/sys/compat/linux/common/linux_sched.c:1.79	Tue Sep  7 07:43:04 2021
+++ src/sys/compat/linux/common/linux_sched.c	Sat Sep 28 20:09:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sched.c,v 1.79 2021/09/07 11:43:04 riastradh Exp $	*/
+/*	$NetBSD: linux_sched.c,v 1.80 2024/09/29 00:09:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.79 2021/09/07 11:43:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.80 2024/09/29 00:09:52 christos Exp $");
 
 #include 
 #include 
@@ -69,9 +69,9 @@ static int linux_clone_nptl(struct lwp *
 #define	LINUX_CPU_MASK_SIZE (sizeof(long) * ((ncpu + LONG_BIT - 1) / LONG_BIT))
 
 #if DEBUG_LINUX
-#define DPRINTF(x) uprintf x
+#define DPRINTF(x, ...) uprintf(x, __VA_ARGS__)
 #else
-#define DPRINTF(x)
+#define DPRINTF(x, ...)
 #endif
 
 static void
@@ -159,13 +159,88 @@ linux_sys_clone(struct lwp *l, const str
 	 */
 	if ((error = fork1(l, flags, sig, SCARG(uap, stack), 0,
 	linux_child_return, NULL, retval)) != 0) {
-		DPRINTF(("%s: fork1: error %d\n", __func__, error));
+		DPRINTF("%s: fork1: error %d\n", __func__, error);
 		return error;
 	}
 
 	return 0;
 }
 
+
+int
+linux_sys_clone3(struct lwp *l, const struct linux_sys_clone3_args *uap, register_t *retval)
+{
+	struct linux_user_clone3_args cl_args;
+	struct linux_sys_clone_args clone_args;
+	int error;
+
+	if (SCARG(uap, size) != sizeof

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

2024-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 29 00:09:52 UTC 2024

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

Log Message:
move clone3 to linux_sched.c and make it compile (need to fix XXX comments)


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/common/linux_sched.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

2024-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 19:36:21 UTC 2024

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.12 -r1.13 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.121 -r1.122 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.120 -r1.121 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.83 -r1.84 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.27 -r1.28 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.94 -r1.95 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.27 -r1.28 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.128 -r1.129 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.129 -r1.130 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.119 -r1.120 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.118 -r1.119 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.92 -r1.93 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.91 -r1.92 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.98 -r1.99 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.97 -r1.98 \
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

2024-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 19:35:56 UTC 2024

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_fcntl.h linux_file.c linux_misc.c
linux_sched.h

Log Message:
Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.136 -r1.137 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/common/linux_fcntl.h
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.264 -r1.265 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux/common/linux_sched.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/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.13 src/sys/compat/linux/arch/aarch64/syscalls.master:1.14
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.13	Sun Jun 30 21:35:52 2024
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Sat Sep 28 15:35:55 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.13 2024/07/01 01:35:52 christos Exp $
+	$NetBSD: syscalls.master,v 1.14 2024/09/28 19:35:55 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -203,7 +203,8 @@
 81	NOARGS		{ int|sys||sync(void); }
 82	NOARGS		{ int|sys||fsync(int fd); }
 83	STD		{ int|linux_sys||fdatasync(int fd); }
-84	UNIMPL		sync_file_range
+84	STD		{ int|linux_sys||sync_file_range(int fd, \
+			off_t offset, off_t nbytes, unsigned int flags); }
 85	STD		{ int|linux_sys||timerfd_create(clockid_t clock_id, \
 			int flags); }
 86	STD		{ int|linux_sys||timerfd_settime(int fd, int flags, \
@@ -519,7 +520,7 @@
 264	UNIMPL		name_to_handle_at
 265	UNIMPL		open_by_handle_at
 266	UNIMPL		clock_adjtime
-267	UNIMPL		syncfs
+267	STD		{ int|linux_sys||syncfs(int fd); }
 268	UNIMPL		setns
 269	STD		{ int|linux_sys||sendmmsg(int s, \
 			struct linux_mmsghdr *msgvec, unsigned int vlen, \
@@ -530,7 +531,9 @@
 273	UNIMPL		finit_module
 274	UNIMPL		sched_setattr
 275	UNIMPL		sched_getattr
-276	UNIMPL		renameat2
+276	STD		{ int|linux_sys||renameat2(int fromfd, \
+			const char *from, int tofd, const char *to, \
+			unsigned int flags); }
 277	UNIMPL		seccomp
 278	NOARGS		{ ssize_t|sys||getrandom(void *buf, size_t buflen, \
 			unsigned int flags); }
@@ -541,7 +544,9 @@
 282	UNIMPL		userfaultfd
 283	UNIMPL		membarrier
 284	UNIMPL		mlock2
-285	UNIMPL		copy_file_range
+285	STD		{ ssize_t|linux_sys||copy_file_range(int fd_in, \
+			off_t * off_in, int fd_out, off_t * off_out, \
+			size_t len, unsigned int flags); }
 286	UNIMPL		preadv2
 287	UNIMPL		pwritev2
 288	UNIMPL		pkey_mprotect
@@ -693,7 +698,9 @@
 432	UNIMPL		fsmount
 433	UNIMPL		fspick
 434	UNIMPL		pidfd_open
-435	UNIMPL		clone3
+435	STD		{ int|linux_sys||clone3( \
+			struct linux_user_clone3_args *cl_args, \
+			size_t size); }
 436	STD		{ int|linux_sys||close_range(unsigned int first, \
 			unsigned int last, unsigned int flags); }
 437	UNIMPL		openat2

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.108 src/sys/compat/linux/arch/alpha/syscalls.master:1.109
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.108	Sun Jun 30 21:35:52 2024
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sat Sep 28 15:35:55 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.108 2024/07/01 01:35:52 christos Exp $
+	$NetBSD: syscalls.master,v 1.109 2024/09/28 19:35:55 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -774,7 +774,8 @@
 467	NOARGS		{ int|sys||__futex_get_robust_list(lwpid_t lwpid, \
 			void **headp, size_t *lenp); }
 468	UNIMPL		splice
-469	UNIMPL		sync_file_range
+469	STD		{ int|linux_sys||sync_file_range(int fd, \
+			off_t offset, off_t nbytes, unsigned int flags); }
 470	UNIMPL		tee
 471	UNIMPL		vmspl

CVS commit: src/sys/compat/linux

2024-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 19:35:56 UTC 2024

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_fcntl.h linux_file.c linux_misc.c
linux_sched.h

Log Message:
Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.136 -r1.137 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux/common/linux_fcntl.h
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.264 -r1.265 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux/common/linux_sched.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-08-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 18 18:42:57 UTC 2024

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

Log Message:
netbsd32_compat_16.c: Fix whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/compat/netbsd32/netbsd32_compat_16.c:1.6
--- src/sys/compat/netbsd32/netbsd32_compat_16.c:1.5	Wed May  1 11:32:29 2024
+++ src/sys/compat/netbsd32/netbsd32_compat_16.c	Sun Aug 18 18:42:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_compat_16.c,v 1.6 2024/08/18 18:42:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.6 2024/08/18 18:42:57 riastradh Exp $");
 
 #include 
 #include 
@@ -60,7 +60,8 @@ compat_netbsd32_16_init(void)
 {
 	int error;
 
-	error = syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls);
+	error = syscall_establish(&emul_netbsd32,
+	netbsd32_kern_sig_16_syscalls);
 	if (error)
 		return error;
 
@@ -87,32 +88,34 @@ compat_netbsd32_16_fini(void)
 	proc_t *p;
 	int error;
 
-	error = syscall_disestablish(&emul_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(&proc_lock);
-PROCLIST_FOREACH(p, &allproc) {
-if ((p->p_lflag & PL_SIGCOMPAT) != 0) {
-break;
-}
-}
-mutex_exit(&proc_lock);
-if (p != NULL) {
-syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls);
-return EBUSY;
-}
+	error = syscall_disestablish(&emul_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(&proc_lock);
+	PROCLIST_FOREACH(p, &allproc) {
+		if ((p->p_lflag & PL_SIGCOMPAT) != 0) {
+			break;
+		}
+	}
+	mutex_exit(&proc_lock);
+	if (p != NULL) {
+		syscall_establish(&emul_netbsd32,
+		netbsd32_kern_sig_16_syscalls);
+		return EBUSY;
+	}
 
 	rw_enter(&exec_lock, RW_WRITER);
 	exec_sigcode_free(&emul_netbsd);
 	emul_netbsd32.e_sigcode = NULL;
-   	emul_netbsd32.e_esigcode = NULL;
-   	emul_netbsd32.e_sigobject = NULL;
+	emul_netbsd32.e_esigcode = NULL;
+	emul_netbsd32.e_sigobject = NULL;
 	rw_exit(&exec_lock);
 	netbsd32_machdep_md_16_fini();
 	return 0;



CVS commit: src/sys/compat/netbsd32

2024-08-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 18 18:42:57 UTC 2024

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

Log Message:
netbsd32_compat_16.c: Fix whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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/linux

2024-07-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  3 07:31:26 UTC 2024

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

Log Message:
files.linux: Make compat_linux depended to mqueue

Thanks pgoyette@ for comments.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/compat/linux/files.linux:1.25
--- src/sys/compat/linux/files.linux:1.24	Wed Jul  3 06:43:29 2024
+++ src/sys/compat/linux/files.linux	Wed Jul  3 07:31:26 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.linux,v 1.24 2024/07/03 06:43:29 rin Exp $
+#	$NetBSD: files.linux,v 1.25 2024/07/03 07:31:26 rin Exp $
 #
 # Config file description for machine-independent Linux compat code.
 # Included by ports that need it.
@@ -6,7 +6,7 @@
 # ports should define any machine-specific files they need in their
 # own file lists.
 
-define	compat_linux		: compat, compat_ossaudio, sysv_ipc
+define	compat_linux		: compat, compat_ossaudio, mqueue, sysv_ipc
 file	compat/linux/common/linux_blkio.c	compat_linux
 file	compat/linux/common/linux_cdrom.c	compat_linux
 file	compat/linux/common/linux_errno.c	compat_linux



CVS commit: src/sys/compat/linux

2024-07-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  3 07:31:26 UTC 2024

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

Log Message:
files.linux: Make compat_linux depended to mqueue

Thanks pgoyette@ for comments.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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

2024-07-02 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  3 06:43:29 UTC 2024

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

Log Message:
files.linux: Hook linux_mqueue.c belatedly for COMPAT_LINUX


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/compat/linux/files.linux:1.24
--- src/sys/compat/linux/files.linux:1.23	Sun Aug 20 18:08:57 2023
+++ src/sys/compat/linux/files.linux	Wed Jul  3 06:43:29 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.linux,v 1.23 2023/08/20 18:08:57 christos Exp $
+#	$NetBSD: files.linux,v 1.24 2024/07/03 06:43:29 rin Exp $
 #
 # Config file description for machine-independent Linux compat code.
 # Included by ports that need it.
@@ -22,6 +22,7 @@ file	compat/linux/common/linux_ioctl.c	c
 file	compat/linux/common/linux_ipc.c		compat_linux
 file	compat/linux/common/linux_misc.c	compat_linux
 file	compat/linux/common/linux_mod.c		compat_linux
+file	compat/linux/common/linux_mqueue.c	compat_linux
 file	compat/linux/common/linux_mtio.c	compat_linux
 file	compat/linux/common/linux_sched.c	compat_linux
 file	compat/linux/common/linux_sg.c		compat_linux



CVS commit: src/sys/compat/linux

2024-07-02 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  3 06:43:29 UTC 2024

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

Log Message:
files.linux: Hook linux_mqueue.c belatedly for COMPAT_LINUX


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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/arch

2024-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul  1 01:36:19 UTC 2024

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.11 -r1.12 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.120 -r1.121 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.119 -r1.120 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.121 -r1.122 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.82 -r1.83 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.26 -r1.27 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.93 -r1.94 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.26 -r1.27 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.127 -r1.128 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.128 -r1.129 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.118 -r1.119 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.117 -r1.118 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.90 -r1.91 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.97 -r1.98 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.96 -r1.97 \
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.11 src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.12
--- src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.11	Sat Jun 29 09:46:31 2024
+++ src/sys/compat/linux/arch/aarch64/linux_syscall.h	Sun Jun 30 21:36:18 2024
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.11 2024/06/29 13:46:31 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.12 2024/07/01 01:36:18 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.12 2024/06/29 13:46:09 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.13 2024/07/01 01:35:52 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -456,6 +456,24 @@
 /* syscall: "sysinfo" ret: "int" args: "struct linux_sysinfo *" */
 #define	LINUX_SYS_sysinfo	179
 
+/* syscall: "mq_open" ret: "linux_mqd_t" args: "const char *" "int" "linux_umode_t" "struct linux_mq_attr *" */
+#define	LINUX_SYS_mq_open	180
+
+/* syscall: "mq_unlink" ret: "int" args: "const char *" */
+#define	LINUX_SYS_mq_unlink	181
+
+/* syscall: "mq_timedsend" ret: "int" args: "linux_mqd_t" "const char *" "size_t" "unsign

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

2024-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul  1 01:36:19 UTC 2024

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.11 -r1.12 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.120 -r1.121 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.119 -r1.120 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.121 -r1.122 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.82 -r1.83 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.26 -r1.27 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.93 -r1.94 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.26 -r1.27 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.127 -r1.128 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.128 -r1.129 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.118 -r1.119 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.117 -r1.118 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.90 -r1.91 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.97 -r1.98 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.96 -r1.97 \
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

2024-06-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 29 13:46:32 UTC 2024

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.10 -r1.11 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.119 -r1.120 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.118 -r1.119 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.81 -r1.82 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.25 -r1.26 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.92 -r1.93 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.25 -r1.26 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.126 -r1.127 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.127 -r1.128 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.117 -r1.118 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.116 -r1.117 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.89 -r1.90 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.96 -r1.97 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.95 -r1.96 \
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.10 src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.11
--- src/sys/compat/linux/arch/aarch64/linux_syscall.h:1.10	Sat Aug 19 13:50:24 2023
+++ src/sys/compat/linux/arch/aarch64/linux_syscall.h	Sat Jun 29 09:46:31 2024
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.10 2023/08/19 17:50:24 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.11 2024/06/29 13:46:31 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.11 2023/08/19 17:49:49 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.12 2024/06/29 13:46:09 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -423,6 +423,9 @@
 /* syscall: "umask" ret: "int" args: "int" */
 #define	LINUX_SYS_umask	166
 
+/* syscall: "getcpu" ret: "int" args: "unsigned int *" "unsigned int *" "struct linux_getcpu_cache *" */
+#define	LINUX_SYS_getcpu	168
+
 /* syscall: "gettimeofday" ret: "int" args: "struct timeval50 *" "struct timezone *" */
 #define	LINUX_SYS_gettimeofday	169
 
@@ -621,6 +624,9 @@
 /* syscall: "close_range" ret: "int" args: "unsigned int" "unsigned i

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

2024-06-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 29 13:46:32 UTC 2024

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.10 -r1.11 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.119 -r1.120 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.118 -r1.119 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.81 -r1.82 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.25 -r1.26 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.92 -r1.93 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.25 -r1.26 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.126 -r1.127 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.127 -r1.128 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.117 -r1.118 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.116 -r1.117 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.89 -r1.90 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.96 -r1.97 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.95 -r1.96 \
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

2024-06-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 29 13:46:10 UTC 2024

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_file.c linux_misc.c linux_misc.h

Log Message:
>From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.72 -r1.73 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.134 -r1.135 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.263 -r1.264 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.32 -r1.33 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

2024-06-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 29 13:46:10 UTC 2024

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_file.c linux_misc.c linux_misc.h

Log Message:
>From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.72 -r1.73 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.134 -r1.135 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.263 -r1.264 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.32 -r1.33 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/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.11 src/sys/compat/linux/arch/aarch64/syscalls.master:1.12
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.11	Sat Aug 19 13:49:49 2023
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Sat Jun 29 09:46:09 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.11 2023/08/19 17:49:49 christos Exp $
+	$NetBSD: syscalls.master,v 1.12 2024/06/29 13:46:09 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -345,7 +346,9 @@
 			struct rusage50 *rusage); }
 166	NOARGS		{ int|sys||umask(int newmask); }
 167	UNIMPL		prctl
-168	UNIMPL		getcpu
+168	STD		{ int|linux_sys||getcpu(unsigned int *cpu, \
+			unsigned int *node, \
+			struct linux_getcpu_cache *tcache); }
 169	STD		{ int|linux_sys||gettimeofday(struct timeval50 *tp, \
 			struct timezone *tzp); }
 170	STD		{ int|linux_sys||settimeofday(struct timeval50 *tp, \
@@ -683,7 +686,8 @@
 			unsigned int last, unsigned int flags); }
 437	UNIMPL		openat2
 438	UNIMPL		pidfd_getfd
-439	UNIMPL		faccessat2
+439	STD		{ int|linux_sys||faccessat2(int fd, const char *path, \
+			int amode, int flags); }
 
 ; we want a "nosys" syscall, we'll just add an extra entry for it.
 440	STD		{ int|linux_sys||nosys(void); }

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.106 src/sys/compat/linux/arch/alpha/syscalls.master:1.107
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.106	Sat Aug 19 13:49:49 2023
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sat Jun 29 09:46:09 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.106 2023/08/19 17:49:49 christos Exp $
+	$NetBSD: syscalls.master,v 1.107 2024/06/29 13:46:09 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -72,6 +72,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -765,7 +766,9 @@
 470	UNIMPL		tee
 471	UNIMPL		vmsplice
 472	UNIMPL		move_pages
-473	UNIMPL		getcpu
+473	STD		{ int|linux_sys||getcpu(unsigned int *cpu, \
+			unsigned int *node, \
+			struct linux_getcpu_cache *tcache); }
 474	STD		{ int|linux_sys||epoll_pwait(int epfd, \
 			struct linux_epoll_event *events, int maxevents, \
 			int timeout, const linux_sigset_t *sigmask); }
@@ -864,7 +867,8 @@
 			unsigned int last, unsigned int flags); }
 547	UNIMPL
 548	UNIMPL
-549	UNIMPL
+549	STD		{ int|linux_sys||faccessat2(int fd, const char *path, \
+			int amode, int flags); }
 550	UNIMPL
 551	STD		{ int|linux_sys||epoll_pwait2(int epfd, \
 			struct linux_epoll_event *events, int maxevents, \

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.72 src/sys/compat/linux/arch/amd64/syscalls.master:1.73
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.72	Sat Aug 19 13:49:49 2023
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Sat Jun 29 09:46:09 2024
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.72 2023/08/19 17:49:49 christos Exp $
+	$NetBSD: syscalls.master,v 1.73 2024/06/29 13:46:09 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/1

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 src/sys/

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(&s32p->ifdr_data.ifi_lastchange,
+		&p->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(&p->ifdr_data.ifi_lastchange,
+		&p32->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(&emul_netbsd32, netbsd32_kern_sig_16_syscalls);
+	if (error)
+		return error;
+
+	rw_enter(&exec_lock, RW_WRITER);
+	emul_netbsd32.e_sigcode = netbsd32_sigcode;
+	emul_netbsd32.e_esigcode = netbsd32_esigcode;
+	emul_netbsd32.e_sigobject = &emul_netbsd32_object;
+	error = exec_sigcode_alloc(&emul_netbsd);
+	if (error) {
+		emul_netbsd32.e_sigcode = NULL;
+		emul_netbsd32.e_esigcode = NULL;
+		emul_netbsd32.e_sigobject = NULL;
+	}
+	rw_exit(&exec_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(&emul_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(&proc_lock);
+PROCLIST_FOREACH(p, &allproc) {
+if ((p->p_lflag & PL_SIGCOMPAT) != 0) {
+break;
+}
+}
+mutex_exit(&proc_lock);
+if (p != NULL) {
+syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls);
+return EBUSY;
+}
+
+	rw_enter(&exec_lock, RW_WRITER);
+	exec_sigcode_free(&emul_netbsd);
+	emul_netbsd32.e_sigcode = NULL;
+   	emul_netbsd32.e_esigcode = NULL;
+   	emul_netbsd32.e_sigobject = NULL;
+	rw_exit(&exec_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(&exec_lock, RW_WRITER);
-		emul_netbsd32.e_sigcode = netbsd32_sigcode;
-	emul_netbsd32.e_esigcode = netbsd32_esigcode;
-	emul_netbsd32.e_sigobject = &emul_netbsd32_object;
-		error = exec_sigcode_alloc(&emul_netbsd);
-		if (error) {
-			emul_netbsd32.e_sigcode = NULL;
-			emul_netbsd32.e_esigcode = NULL;
-			emul_netbsd32.e_sigobject = NULL;
-		}
-		rw_exit(&exec_lock);
-		if (error)
-			return error;
-		netbsd32_machdep_md_16_init();
-		return 0;
+		return compat_netbsd32_16_init();
 
 	case MODULE_CMD_FINI:
-		rw_enter(&exec_lock, RW_WRITER);
-		exec_sigcode_free(&emul_netbsd);
-		emul_netbsd32.e_sigcode = NULL;
-	emul_netbsd32.e_esigcode = NULL;
-	emul_netbsd32.e_sigobject = NULL;
-		rw_exit(&exec_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(&proc_lock);
 			/*
 			 * Prevent unload of compat module while
@@ -207,6 +205,11 @@ netbsd32___sigaction_sigtramp(struct lwp
 			p->p_lflag |= PL_SIGCOMPAT;
 			mutex_exit(&proc_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(&ru50->ru_first, &ru->ru_first,
-	(char *)&ru50->ru_last - (char *)&ru50->ru_first +
-	sizeof(ru50->ru_last));
-	ru50->ru_maxrss = ru->ru_maxrss;
-	timeval_to_timeval50(&ru->ru_utime, &ru50->ru_utime);
-	timeval_to_timeval50(&ru->ru_stime, &ru50->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(&ru50->ru_first, &ru->ru_first,
+	(char *)&ru50->ru_last - (char *)&ru50->ru_first +
+	sizeof(ru50->ru_last));
+	ru50->ru_maxrss = ru->ru_maxrss;
+	timeval_to_timeval50(&ru->ru_utime, &ru50->ru_utime);
+	timeval_to_timeval50(&ru->ru_stime, &ru50->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(&events[i], &events32[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(&events[i], &events32[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(&fp->f_lock);
> uio.uio_offset = fp->f_offset;
> mutex_exit(&fp->f_lock);
> ...
> mutex_enter(&fp->f_lock);
> fp->f_offset = uio.uio_offset;
> mutex_exit(&fp->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, &uio, fp->f_cred, &eofflag, 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->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->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(&fp->f_lock);
uio.uio_offset = fp->f_offset;
mutex_exit(&fp->f_lock);
...
mutex_enter(&fp->f_lock);
fp->f_offset = uio.uio_offset;
mutex_exit(&fp->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, &uio, fp->f_cred, &eofflag, NULL, NULL);
 	if (needs_lock)
 		VOP_UNLOCK(vp);
+	else
+		mutex_enter(vp->v_interlock);
 
 	mutex_enter(&fp->f_lock);
 	fp->f_offset = uio.uio_offset;
@@ -1107,7 +1116,7 @@ inotify_filt_event(struct knote *kn, lon
 		cv_signal(&ifd->ifd_qcv);
 
 		mutex_enter(&ifd->ifd_lock);
-		selnotify(&ifd->ifd_sel, 0, 0);
+		selnotify(&ifd->ifd_sel, 0, NOTE_LOWAT);
 		mutex_exit(&ifd->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->ifd_qlock);
-	rv = (ifd->ifd_qcount > 0);
-	mutex_exit(&ifd->ifd_qlock);
+	if (hint != 0) {
+		KASSERT(mutex_owned(&ifd->ifd_lock));
+		KASSERT(mutex_owned(&ifd->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->ifd_lock);
 
-	/* open a new file descriptor for the watch descriptor */
-	SCARG(&oa, path) = SCARG(uap, pathname);
-	SCARG(&oa, mode) = 0;
-	SCARG(&oa, flags) = O_RDONLY;
 	if (mask & LINUX_IN_DONT_FOLLOW)
-		SCARG(&oa, flags) |= O_NOFOLLOW;
-	if (mask & LINUX_IN_ONLYDIR)
-		SCARG(&oa, flags) |= O_DIRECTORY;
-
-	error = sys_open(l, &oa, retval);
+		sflags = NSM_NOFOLLOW_TRYEMULROOT;
+	else
+		sflags = NSM_FOLLOW_TRYEMULROOT;
+	error = namei_simple_user(SCARG(uap, pathname), sflags, &wvp);
 	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, &wst);
-	fd_putfile(wd);
-	if (error != 0)
-		goto leave1;
-
-	/* translate the flags */
-	memset(&kev, 0, sizeof(kev));
-	EV_SET(&kev, 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, &cur_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(&oa, path) = SCARG(uap, pathname);
+		SCARG(&oa, mode) = 0;
+		SCARG(&oa, flags) = O_RDONLY;
+		if (mask & LINUX_IN_DONT_FOLLOW)
+			SCARG(&oa, flags) |= O_NOFOLLOW;
+		if (mask & LINUX_IN_ONLYDIR)
+			SCARG(&oa, flags) |= O_DIRECTORY;
+
+		error = sys_open(l, &oa, 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(&kev, 0, sizeof(kev));
+		EV_SET(&kev, wd, inotify_filtid, EV_ADD|EV_ENABLE,
+		NOTE_DELETE|NOTE_REVOKE, 0, ifd);
+		if (mask & LINUX_IN_ONESHOT)
+		

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(&bfl, &lfl); \
 	return do_fcntl_lock(fd, cmd == setlk ? F_SETLK : F_SETLKW, &bfl); \
 } 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 WARRAN

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: s

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.



  1   2   3   4   5   6   7   >