CVS commit: src

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 01:49:52 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: md.amd64 md.i386 mi
src/distrib/sets/lists/tests: md.amd64 md.i386 mi
src/tests/kernel: Makefile
Removed Files:
src/tests/kernel/arch: Makefile Makefile.inc
src/tests/kernel/arch/amd64: Makefile Makefile.inc t_ptrace_wait.c
t_ptrace_wait3.c t_ptrace_wait4.c t_ptrace_wait6.c
t_ptrace_waitid.c t_ptrace_waitpid.c
src/tests/kernel/arch/i386: Makefile Makefile.inc t_ptrace_wait.c
t_ptrace_wait3.c t_ptrace_wait4.c t_ptrace_wait6.c
t_ptrace_waitid.c t_ptrace_waitpid.c
src/tests/kernel/arch/x86: Makefile Makefile.inc t_ptrace_wait.c
t_ptrace_wait3.c t_ptrace_wait4.c t_ptrace_wait6.c
t_ptrace_waitid.c t_ptrace_waitpid.c

Log Message:
Remove kernel/arch/{amd64,i386,x86} tests

These files were merged with kernel/t_ptrace_wait*

This removes MD test files.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/lists/debug/md.i386
cvs rdiff -u -r1.201 -r1.202 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/tests/md.amd64
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/tests/md.i386
cvs rdiff -u -r1.730 -r1.731 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.44 -r1.45 src/tests/kernel/Makefile
cvs rdiff -u -r1.3 -r0 src/tests/kernel/arch/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/kernel/arch/Makefile.inc
cvs rdiff -u -r1.2 -r0 src/tests/kernel/arch/amd64/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/kernel/arch/amd64/Makefile.inc \
src/tests/kernel/arch/amd64/t_ptrace_wait3.c \
src/tests/kernel/arch/amd64/t_ptrace_wait4.c \
src/tests/kernel/arch/amd64/t_ptrace_wait6.c \
src/tests/kernel/arch/amd64/t_ptrace_waitid.c \
src/tests/kernel/arch/amd64/t_ptrace_waitpid.c
cvs rdiff -u -r1.25 -r0 src/tests/kernel/arch/amd64/t_ptrace_wait.c
cvs rdiff -u -r1.1 -r0 src/tests/kernel/arch/i386/Makefile \
src/tests/kernel/arch/i386/Makefile.inc \
src/tests/kernel/arch/i386/t_ptrace_wait3.c \
src/tests/kernel/arch/i386/t_ptrace_wait4.c \
src/tests/kernel/arch/i386/t_ptrace_wait6.c \
src/tests/kernel/arch/i386/t_ptrace_waitid.c \
src/tests/kernel/arch/i386/t_ptrace_waitpid.c
cvs rdiff -u -r1.2 -r0 src/tests/kernel/arch/i386/t_ptrace_wait.c
cvs rdiff -u -r1.1 -r0 src/tests/kernel/arch/x86/Makefile \
src/tests/kernel/arch/x86/Makefile.inc \
src/tests/kernel/arch/x86/t_ptrace_wait3.c \
src/tests/kernel/arch/x86/t_ptrace_wait4.c \
src/tests/kernel/arch/x86/t_ptrace_wait6.c \
src/tests/kernel/arch/x86/t_ptrace_waitid.c \
src/tests/kernel/arch/x86/t_ptrace_waitpid.c
cvs rdiff -u -r1.8 -r0 src/tests/kernel/arch/x86/t_ptrace_wait.c

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

Modified files:

Index: src/distrib/sets/lists/debug/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.93 src/distrib/sets/lists/debug/md.amd64:1.94
--- src/distrib/sets/lists/debug/md.amd64:1.93	Wed Feb 22 01:07:13 2017
+++ src/distrib/sets/lists/debug/md.amd64	Sun Apr  2 01:49:51 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.93 2017/02/22 01:07:13 kamil Exp $
+# $NetBSD: md.amd64,v 1.94 2017/04/02 01:49:51 kamil Exp $
 ./usr/lib/i386/12.202++_g.a			comp-c-debuglib		debuglib,compat,12.202xx
 ./usr/lib/i386/libi386_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/i386/libiberty_g.a			comp-obsolete		obsolete
@@ -14,9 +14,9 @@
 ./usr/libdata/debug/usr/libexec/ld.elf_so-i386.debug	comp-sys-debug		debug,compat
 ./usr/libdata/debug/usr/sbin/acpidump.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/usr/sbin/amldb.debug	comp-sysutil-debug	debug
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait.debug	tests-kernel-tests	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait3.debug	tests-kernel-tests	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait4.debug	tests-kernel-tests	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait6.debug	tests-kernel-tests	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_waitid.debug	tests-kernel-tests	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_waitpid.debug	tests-kernel-tests	debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait.debug	tests-obsolete	obsolete
+./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait3.debug	tests-obsolete	obsolete
+./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait4.debug	tests-obsolete	obsolete
+./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait6.debug	tests-obsolete	obsolete
+./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_waitid.debug	

CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 01:14:35 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace_i386_wait.h t_ptrace_wait.c
Added Files:
src/tests/kernel: t_ptrace_amd64_wait.h

Log Message:
Merge kernel/t_ptrace_wait with kernel/arch/amd64/t_ptrace_wait

This aims to remove MD-specific tests files for ptrace(2).

Prefix i386 and amd64 tests with unique strings "i386_" and "x86_64_".
This removes conflicts with generic tests.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_ptrace_amd64_wait.h
cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_ptrace_i386_wait.h
cvs rdiff -u -r1.87 -r1.88 src/tests/kernel/t_ptrace_wait.c

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

Modified files:

Index: src/tests/kernel/t_ptrace_i386_wait.h
diff -u src/tests/kernel/t_ptrace_i386_wait.h:1.1 src/tests/kernel/t_ptrace_i386_wait.h:1.2
--- src/tests/kernel/t_ptrace_i386_wait.h:1.1	Sun Apr  2 00:40:12 2017
+++ src/tests/kernel/t_ptrace_i386_wait.h	Sun Apr  2 01:14:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_i386_wait.h,v 1.1 2017/04/02 00:40:12 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_i386_wait.h,v 1.2 2017/04/02 01:14:35 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,14 +27,14 @@
  */
 
 #if defined(__i386__)
-ATF_TC(regs1);
-ATF_TC_HEAD(regs1, tc)
+ATF_TC(i386_regs1);
+ATF_TC_HEAD(i386_regs1, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
 	"Call PT_GETREGS and iterate over General Purpose registers");
 }
 
-ATF_TC_BODY(regs1, tc)
+ATF_TC_BODY(i386_regs1, tc)
 {
 	const int exitval = 5;
 	const int sigval = SIGSTOP;
@@ -101,7 +101,7 @@ ATF_TC_BODY(regs1, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 #define ATF_TP_ADD_TCS_PTRACE_WAIT_I386() \
-	ATF_TP_ADD_TC_HAVE_GPREGS(tp, regs1);
+	ATF_TP_ADD_TC_HAVE_GPREGS(tp, i386_regs1);
 #else
 #define ATF_TP_ADD_TCS_PTRACE_WAIT_I386()
 #endif

Index: src/tests/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.87 src/tests/kernel/t_ptrace_wait.c:1.88
--- src/tests/kernel/t_ptrace_wait.c:1.87	Sun Apr  2 00:40:12 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sun Apr  2 01:14:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.87 2017/04/02 00:40:12 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.88 2017/04/02 01:14:35 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.87 2017/04/02 00:40:12 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.88 2017/04/02 01:14:35 kamil Exp $");
 
 #include 
 #include 
@@ -7446,6 +7446,7 @@ ATF_TC_BODY(syscallemu1, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+#include "t_ptrace_amd64_wait.h"
 #include "t_ptrace_i386_wait.h"
 #include "t_ptrace_x86_wait.h"
 
@@ -7581,6 +7582,7 @@ ATF_TP_ADD_TCS(tp)
 
 	ATF_TP_ADD_TC(tp, syscallemu1);
 
+	ATF_TP_ADD_TCS_PTRACE_WAIT_AMD64();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_I386();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_X86();
 

Added files:

Index: src/tests/kernel/t_ptrace_amd64_wait.h
diff -u /dev/null src/tests/kernel/t_ptrace_amd64_wait.h:1.1
--- /dev/null	Sun Apr  2 01:14:35 2017
+++ src/tests/kernel/t_ptrace_amd64_wait.h	Sun Apr  2 01:14:35 2017
@@ -0,0 +1,114 @@
+/*	$NetBSD: t_ptrace_amd64_wait.h,v 1.1 2017/04/02 01:14:35 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(__x86_64__)
+ATF_TC(x86_64_regs1);
+ATF_TC_HEAD(x86_64_regs1, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Call PT_GETREGS and 

CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 00:40:12 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace_wait.c
Added Files:
src/tests/kernel: t_ptrace_i386_wait.h

Log Message:
Merge kernel/t_ptrace_wait with kernel/arch/i386/t_ptrace_wait

This aims to remove MD-specific tests files for ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_ptrace_i386_wait.h
cvs rdiff -u -r1.86 -r1.87 src/tests/kernel/t_ptrace_wait.c

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

Modified files:

Index: src/tests/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.86 src/tests/kernel/t_ptrace_wait.c:1.87
--- src/tests/kernel/t_ptrace_wait.c:1.86	Sun Apr  2 00:29:07 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sun Apr  2 00:40:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.86 2017/04/02 00:29:07 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.87 2017/04/02 00:40:12 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.86 2017/04/02 00:29:07 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.87 2017/04/02 00:40:12 kamil Exp $");
 
 #include 
 #include 
@@ -7446,6 +7446,7 @@ ATF_TC_BODY(syscallemu1, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+#include "t_ptrace_i386_wait.h"
 #include "t_ptrace_x86_wait.h"
 
 ATF_TP_ADD_TCS(tp)
@@ -7580,6 +7581,7 @@ ATF_TP_ADD_TCS(tp)
 
 	ATF_TP_ADD_TC(tp, syscallemu1);
 
+	ATF_TP_ADD_TCS_PTRACE_WAIT_I386();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_X86();
 
 	return atf_no_error();

Added files:

Index: src/tests/kernel/t_ptrace_i386_wait.h
diff -u /dev/null src/tests/kernel/t_ptrace_i386_wait.h:1.1
--- /dev/null	Sun Apr  2 00:40:12 2017
+++ src/tests/kernel/t_ptrace_i386_wait.h	Sun Apr  2 00:40:12 2017
@@ -0,0 +1,107 @@
+/*	$NetBSD: t_ptrace_i386_wait.h,v 1.1 2017/04/02 00:40:12 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(__i386__)
+ATF_TC(regs1);
+ATF_TC_HEAD(regs1, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Call PT_GETREGS and iterate over General Purpose registers");
+}
+
+ATF_TC_BODY(regs1, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	struct reg r;
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	printf("Call GETREGS for the child process\n");
+	ATF_REQUIRE(ptrace(PT_GETREGS, child, , 0) != -1);
+
+	printf("EAX=%#" PRIxREGISTER "\n", r.r_eax);
+	printf("EBX=%#" PRIxREGISTER "\n", r.r_ebx);
+	printf("ECX=%#" PRIxREGISTER "\n", r.r_ecx);
+	printf("EDX=%#" PRIxREGISTER "\n", r.r_edx);
+
+	printf("ESP=%#" PRIxREGISTER "\n", r.r_esp);
+	printf("EBP=%#" PRIxREGISTER "\n", r.r_ebp);
+
+	printf("ESI=%#" PRIxREGISTER "\n", r.r_esi);
+	printf("EDI=%#" PRIxREGISTER "\n", r.r_edi);
+
+	printf("EIP=%#" PRIxREGISTER "\n", 

CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 00:29:08 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace_wait.c
Added Files:
src/tests/kernel: t_ptrace_x86_wait.h

Log Message:
Merge kernel/t_ptrace_wait with kernel/arch/x86/t_ptrace_wait

This aims to remove MD-specific tests files for ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/tests/kernel/t_ptrace_wait.c
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_ptrace_x86_wait.h

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

Modified files:

Index: src/tests/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.85 src/tests/kernel/t_ptrace_wait.c:1.86
--- src/tests/kernel/t_ptrace_wait.c:1.85	Sun Apr  2 00:03:40 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sun Apr  2 00:29:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.85 2017/04/02 00:03:40 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.86 2017/04/02 00:29:07 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.85 2017/04/02 00:03:40 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.86 2017/04/02 00:29:07 kamil Exp $");
 
 #include 
 #include 
@@ -42,6 +42,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.85
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -7445,6 +7446,8 @@ ATF_TC_BODY(syscallemu1, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+#include "t_ptrace_x86_wait.h"
+
 ATF_TP_ADD_TCS(tp)
 {
 	setvbuf(stdout, NULL, _IONBF, 0);
@@ -7577,5 +7580,7 @@ ATF_TP_ADD_TCS(tp)
 
 	ATF_TP_ADD_TC(tp, syscallemu1);
 
+	ATF_TP_ADD_TCS_PTRACE_WAIT_X86();
+
 	return atf_no_error();
 }

Added files:

Index: src/tests/kernel/t_ptrace_x86_wait.h
diff -u /dev/null src/tests/kernel/t_ptrace_x86_wait.h:1.1
--- /dev/null	Sun Apr  2 00:29:08 2017
+++ src/tests/kernel/t_ptrace_x86_wait.h	Sun Apr  2 00:29:07 2017
@@ -0,0 +1,1983 @@
+/*	$NetBSD: t_ptrace_x86_wait.h,v 1.1 2017/04/02 00:29:07 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(__i386__) || defined(__x86_64__)
+union u {
+	unsigned long raw;
+	struct {
+		unsigned long local_dr0_breakpoint : 1;		/* 0 */
+		unsigned long global_dr0_breakpoint : 1;	/* 1 */
+		unsigned long local_dr1_breakpoint : 1;		/* 2 */
+		unsigned long global_dr1_breakpoint : 1;	/* 3 */
+		unsigned long local_dr2_breakpoint : 1;		/* 4 */
+		unsigned long global_dr2_breakpoint : 1;	/* 5 */
+		unsigned long local_dr3_breakpoint : 1;		/* 6 */
+		unsigned long global_dr3_breakpoint : 1;	/* 7 */
+		unsigned long local_exact_breakpt : 1;		/* 8 */
+		unsigned long global_exact_breakpt : 1;		/* 9 */
+		unsigned long reserved_10 : 1;			/* 10 */
+		unsigned long rest_trans_memory : 1;		/* 11 */
+		unsigned long reserved_12 : 1;			/* 12 */
+		unsigned long general_detect_enable : 1;	/* 13 */
+		unsigned long reserved_14 : 1;			/* 14 */
+		unsigned long reserved_15 : 1;			/* 15 */
+		unsigned long condition_dr0 : 2;		/* 16-17 */
+		unsigned long len_dr0 : 2;			/* 18-19 */
+		unsigned long condition_dr1 : 2;		/* 20-21 */
+		unsigned long len_dr1 : 2;			/* 22-23 */
+		unsigned long condition_dr2 : 2;		/* 24-25 */
+		unsigned long len_dr2 : 2;			/* 26-27 */
+		unsigned long condition_dr3 : 2;		/* 28-29 */
+		unsigned long len_dr3 : 2;			/* 30-31 */
+	} bits;
+};
+
+ATF_TC(dbregs_print);
+ATF_TC_HEAD(dbregs_print, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify plain PT_GETDBREGS with printing Debug Registers");
+}
+

CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 00:06:09 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace.c

Log Message:
Correct another string about securelevel in t_ptrace

Change:
Test must be run with securelevel >= 1

To:
Test must be run with securelevel >= 0

In attach_pid1_securelevel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/tests/kernel/t_ptrace.c

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

Modified files:

Index: src/tests/kernel/t_ptrace.c
diff -u src/tests/kernel/t_ptrace.c:1.19 src/tests/kernel/t_ptrace.c:1.20
--- src/tests/kernel/t_ptrace.c:1.19	Sat Apr  1 23:51:27 2017
+++ src/tests/kernel/t_ptrace.c	Sun Apr  2 00:06:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace.c,v 1.19 2017/04/01 23:51:27 kamil Exp $	*/
+/*	$NetBSD: t_ptrace.c,v 1.20 2017/04/02 00:06:09 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace.c,v 1.19 2017/04/01 23:51:27 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace.c,v 1.20 2017/04/02 00:06:09 kamil Exp $");
 
 #include 
 #include 
@@ -112,7 +112,7 @@ ATF_TC_BODY(attach_pid1_securelevel, tc)
 	!= -1);
 
 	if (level < 0) {
-		atf_tc_skip("Test must be run with securelevel >= 1");
+		atf_tc_skip("Test must be run with securelevel >= 0");
 	}
 
 	ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 1, NULL, 0) == -1);



CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr  2 00:03:40 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace_wait.c

Log Message:
Deduplicate code in step* tests in t_ptrace_wait*

No functional change.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/tests/kernel/t_ptrace_wait.c

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

Modified files:

Index: src/tests/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.84 src/tests/kernel/t_ptrace_wait.c:1.85
--- src/tests/kernel/t_ptrace_wait.c:1.84	Tue Mar 28 13:16:30 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sun Apr  2 00:03:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.84 2017/03/28 13:16:30 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.85 2017/04/02 00:03:40 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.84 2017/03/28 13:16:30 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.85 2017/04/02 00:03:40 kamil Exp $");
 
 #include 
 #include 
@@ -4394,14 +4394,8 @@ ATF_TC_BODY(fpregs2, tc)
 #endif
 
 #if defined(PT_STEP)
-ATF_TC(step1);
-ATF_TC_HEAD(step1, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify single PT_STEP call");
-}
-
-ATF_TC_BODY(step1, tc)
+static void
+ptrace_step(int N)
 {
 	const int exitval = 5;
 	const int sigval = SIGSTOP;
@@ -4422,12 +4416,12 @@ ATF_TC_BODY(step1, tc)
 		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
 		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
-		happy = check_happy(100);
+		happy = check_happy(999);
 
 		printf("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
-		FORKEE_ASSERT_EQ(happy, check_happy(100));
+		FORKEE_ASSERT_EQ(happy, check_happy(999));
 
 		printf("Before exiting of the child process\n");
 		_exit(exitval);
@@ -4439,14 +4433,17 @@ ATF_TC_BODY(step1, tc)
 
 	validate_status_stopped(status, sigval);
 
-	printf("Before resuming the child process where it left off and "
-	"without signal to be sent (use PT_STEP)\n");
-	ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
+	while (N --> 0) {
+		printf("Before resuming the child process where it left off "
+		"and without signal to be sent (use PT_STEP)\n");
+		ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
 
-	printf("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+		printf("Before calling %s() for the child\n", TWAIT_FNAME);
+		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0),
+		child);
 
-	validate_status_stopped(status, SIGTRAP);
+		validate_status_stopped(status, SIGTRAP);
+	}
 
 	printf("Before resuming the child process where it left off and "
 	"without signal to be sent\n");
@@ -4463,6 +4460,20 @@ ATF_TC_BODY(step1, tc)
 #endif
 
 #if defined(PT_STEP)
+ATF_TC(step1);
+ATF_TC_HEAD(step1, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify single PT_STEP call");
+}
+
+ATF_TC_BODY(step1, tc)
+{
+	ptrace_step(1);
+}
+#endif
+
+#if defined(PT_STEP)
 ATF_TC(step2);
 ATF_TC_HEAD(step2, tc)
 {
@@ -4472,66 +4483,7 @@ ATF_TC_HEAD(step2, tc)
 
 ATF_TC_BODY(step2, tc)
 {
-	const int exitval = 5;
-	const int sigval = SIGSTOP;
-	pid_t child, wpid;
-#if defined(TWAIT_HAVE_STATUS)
-	int status;
-#endif
-	int happy;
-	int N = 2;
-
-#if defined(__arm__)
-	/* PT_STEP not supported on arm 32-bit */
-	atf_tc_expect_fail("PR kern/52119");
-#endif
-
-	printf("Before forking process PID=%d\n", getpid());
-	ATF_REQUIRE((child = fork()) != -1);
-	if (child == 0) {
-		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
-		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
-
-		happy = check_happy(999);
-
-		printf("Before raising %s from child\n", strsignal(sigval));
-		FORKEE_ASSERT(raise(sigval) == 0);
-
-		FORKEE_ASSERT_EQ(happy, check_happy(999));
-
-		printf("Before exiting of the child process\n");
-		_exit(exitval);
-	}
-	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
-
-	printf("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, sigval);
-
-	while (N --> 0) {
-		printf("Before resuming the child process where it left off "
-		"and without signal to be sent (use PT_STEP)\n");
-		ATF_REQUIRE(ptrace(PT_STEP, child, (void *)1, 0) != -1);
-
-		printf("Before calling %s() for the child\n", TWAIT_FNAME);
-		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0),
-		child);
-
-		validate_status_stopped(status, SIGTRAP);
-	}
-
-	printf("Before resuming the child process where it left off and "
-	"without signal to be sent\n");
-	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
-	printf("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = 

CVS commit: src/tests/kernel

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  1 23:51:27 UTC 2017

Modified Files:
src/tests/kernel: t_ptrace.c

Log Message:
Correct securelevel in attach_pid1_securelevel

Assert that a debugger cannot attach to PID 1 with securelevel >= 0
(as root) instead of >= 1.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/kernel/t_ptrace.c

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

Modified files:

Index: src/tests/kernel/t_ptrace.c
diff -u src/tests/kernel/t_ptrace.c:1.18 src/tests/kernel/t_ptrace.c:1.19
--- src/tests/kernel/t_ptrace.c:1.18	Fri Jan 13 21:30:41 2017
+++ src/tests/kernel/t_ptrace.c	Sat Apr  1 23:51:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace.c,v 1.18 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_ptrace.c,v 1.19 2017/04/01 23:51:27 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace.c,v 1.18 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_ptrace.c,v 1.19 2017/04/01 23:51:27 kamil Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ ATF_TC_HEAD(attach_pid1_securelevel, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
 	"Assert that a debugger cannot attach to PID 1 with "
-	"securelevel >= 1 (as root)");
+	"securelevel >= 0 (as root)");
 
 	atf_tc_set_md_var(tc, "require.user", "root");
 }
@@ -111,7 +111,7 @@ ATF_TC_BODY(attach_pid1_securelevel, tc)
 	ATF_REQUIRE(sysctlbyname("kern.securelevel", , , NULL, 0)
 	!= -1);
 
-	if (level < 1) {
+	if (level < 0) {
 		atf_tc_skip("Test must be run with securelevel >= 1");
 	}
 



CVS commit: src/sys/miscfs/genfs

2017-04-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Apr  1 23:34:17 UTC 2017

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Clarify meaning of "glocked" argument of genfs_putpages_read.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.67 src/sys/miscfs/genfs/genfs_io.c:1.68
--- src/sys/miscfs/genfs/genfs_io.c:1.67	Sat Apr  1 19:57:54 2017
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr  1 23:34:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.67 2017/04/01 19:57:54 riastradh Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.68 2017/04/01 23:34:17 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.67 2017/04/01 19:57:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.68 2017/04/01 23:34:17 dholland Exp $");
 
 #include 
 #include 
@@ -508,6 +508,10 @@ out_err:
 
 /*
  * genfs_getpages_read: Read the pages in with VOP_BMAP/VOP_STRATEGY.
+ *
+ * "glocked" (which is currently not actually used) tells us not whether
+ * the genfs_node is locked on entry (it always is) but whether it was
+ * locked on entry to genfs_getpages.
  */
 static int
 genfs_getpages_read(struct vnode *vp, struct vm_page **pgs, int npages,



CVS commit: src/tests/kernel/arch/x86

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  1 23:28:02 UTC 2017

Modified Files:
src/tests/kernel/arch/x86: t_ptrace_wait.c

Log Message:
Try to fix Clang/LLVM build

Initialize a local variable.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/kernel/arch/x86/t_ptrace_wait.c

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

Modified files:

Index: src/tests/kernel/arch/x86/t_ptrace_wait.c
diff -u src/tests/kernel/arch/x86/t_ptrace_wait.c:1.7 src/tests/kernel/arch/x86/t_ptrace_wait.c:1.8
--- src/tests/kernel/arch/x86/t_ptrace_wait.c:1.7	Sat Apr  1 23:25:08 2017
+++ src/tests/kernel/arch/x86/t_ptrace_wait.c	Sat Apr  1 23:28:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/01 23:25:08 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.8 2017/04/01 23:28:02 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/01 23:25:08 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.8 2017/04/01 23:28:02 kamil Exp $");
 
 #include 
 #include 
@@ -412,7 +412,7 @@ dbregs_trap_variable(int reg, int cond, 
 #endif
 	struct dbreg r1;
 	size_t i;
-	volatile int watchme;
+	volatile int watchme = 0;
 	union u dr7;
 
 	struct ptrace_siginfo info;



CVS commit: src/tests/kernel/arch/x86

2017-04-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  1 23:25:08 UTC 2017

Modified Files:
src/tests/kernel/arch/x86: t_ptrace_wait.c

Log Message:
Refactor dbregs_dr*_dont_inherit_execve ATF tests for x86/

Eliminate duplicated code.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/kernel/arch/x86/t_ptrace_wait.c

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

Modified files:

Index: src/tests/kernel/arch/x86/t_ptrace_wait.c
diff -u src/tests/kernel/arch/x86/t_ptrace_wait.c:1.6 src/tests/kernel/arch/x86/t_ptrace_wait.c:1.7
--- src/tests/kernel/arch/x86/t_ptrace_wait.c:1.6	Thu Mar 30 20:24:35 2017
+++ src/tests/kernel/arch/x86/t_ptrace_wait.c	Sat Apr  1 23:25:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.6 2017/03/30 20:24:35 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/01 23:25:08 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.6 2017/03/30 20:24:35 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/01 23:25:08 kamil Exp $");
 
 #include 
 #include 
@@ -1798,16 +1798,8 @@ ATF_TC_BODY(dbregs_dr3_dont_inherit_lwp,
 	dbregs_dont_inherit_lwp(3);
 }
 
-#if defined(HAVE_DBREGS)
-ATF_TC(dbregs_dr0_dont_inherit_execve);
-ATF_TC_HEAD(dbregs_dr0_dont_inherit_execve, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify that execve(2) is intercepted by tracer and Debug "
-	"Register 0 is reset");
-}
-
-ATF_TC_BODY(dbregs_dr0_dont_inherit_execve, tc)
+static void
+dbregs_dont_inherit_execve(int reg)
 {
 	const int sigval = SIGTRAP;
 	pid_t child, wpid;
@@ -1849,9 +1841,9 @@ ATF_TC_BODY(dbregs_dr0_dont_inherit_exec
 	for (i = 0; i < __arraycount(r1.dr); i++)
 		printf("r1[%zu]=%" PRIxREGISTER "\n", i, r1.dr[i]);
 
-	r1.dr[0] = (long)(intptr_t)check_happy;
-	printf("Set DR0 (r1.dr[0]) to new value %" PRIxREGISTER "\n",
-	r1.dr[0]);
+	r1.dr[reg] = (long)(intptr_t)check_happy;
+	printf("Set DR%d (r1.dr[%d]) to new value %" PRIxREGISTER "\n",
+	reg, reg, r1.dr[reg]);
 
 	printf("New state of the debug registers (r1):\n");
 	for (i = 0; i < __arraycount(r1.dr); i++)
@@ -1900,9 +1892,20 @@ ATF_TC_BODY(dbregs_dr0_dont_inherit_exec
 	printf("Before calling %s() for the child\n", TWAIT_FNAME);
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
-#endif
 
-#if defined(HAVE_DBREGS)
+ATF_TC(dbregs_dr0_dont_inherit_execve);
+ATF_TC_HEAD(dbregs_dr0_dont_inherit_execve, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that execve(2) is intercepted by tracer and Debug "
+	"Register 0 is reset");
+}
+
+ATF_TC_BODY(dbregs_dr0_dont_inherit_execve, tc)
+{
+	dbregs_dont_inherit_execve(0);
+}
+
 ATF_TC(dbregs_dr1_dont_inherit_execve);
 ATF_TC_HEAD(dbregs_dr1_dont_inherit_execve, tc)
 {
@@ -1913,100 +1916,9 @@ ATF_TC_HEAD(dbregs_dr1_dont_inherit_exec
 
 ATF_TC_BODY(dbregs_dr1_dont_inherit_execve, tc)
 {
-	const int sigval = SIGTRAP;
-	pid_t child, wpid;
-#if defined(TWAIT_HAVE_STATUS)
-	int status;
-#endif
-	size_t i;
-	struct dbreg r1;
-	struct dbreg r2;
-
-	struct ptrace_siginfo info;
-	memset(, 0, sizeof(info));
-
-	printf("Before forking process PID=%d\n", getpid());
-	ATF_REQUIRE((child = fork()) != -1);
-	if (child == 0) {
-		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
-		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
-
-		printf("Before raising %s from child\n", strsignal(sigval));
-		FORKEE_ASSERT(raise(sigval) == 0);
-
-		printf("Before calling execve(2) from child\n");
-		execlp("/bin/echo", "/bin/echo", NULL);
-
-		FORKEE_ASSERT(0 && "Not reached");
-	}
-	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
-
-	printf("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, sigval);
-
-	printf("Call GETDBREGS for the child process (r1)\n");
-	ATF_REQUIRE(ptrace(PT_GETDBREGS, child, , 0) != -1);
-
-	printf("State of the debug registers (r1):\n");
-	for (i = 0; i < __arraycount(r1.dr); i++)
-		printf("r1[%zu]=%" PRIxREGISTER "\n", i, r1.dr[i]);
-
-	r1.dr[1] = (long)(intptr_t)check_happy;
-	printf("Set DR1 (r1.dr[1]) to new value %" PRIxREGISTER "\n",
-	r1.dr[1]);
-
-	printf("New state of the debug registers (r1):\n");
-	for (i = 0; i < __arraycount(r1.dr); i++)
-		printf("r1[%zu]=%" PRIxREGISTER "\n", i, r1.dr[i]);
-
-	printf("Call SETDBREGS for the child process (r1)\n");
-	ATF_REQUIRE(ptrace(PT_SETDBREGS, child, , 0) != -1);
-
-	printf("Before resuming the child process where it left off and "
-	"without signal to be sent\n");
-	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
-	printf("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, sigval);
-
-	printf("Before calling 

CVS commit: src/usr.sbin/postinstall

2017-04-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr  1 20:14:53 UTC 2017

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Move dhcpcd lease files to new location.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.212 src/usr.sbin/postinstall/postinstall:1.213
--- src/usr.sbin/postinstall/postinstall:1.212	Sat Apr  1 20:03:31 2017
+++ src/usr.sbin/postinstall/postinstall	Sat Apr  1 20:14:53 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.212 2017/04/01 20:03:31 roy Exp $
+# $NetBSD: postinstall,v 1.213 2017/04/01 20:14:53 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -909,6 +909,14 @@ do_dhcpcd()
 		"${DEST_DIR}/var/db/dhcpcd/rdm_monotonic"
 	failed=$(( ${failed} + $? ))
 
+	for lease in "${DEST_DIR}/var/db/dhcpcd-"*.lease*; do
+		[ -f "${lease}" ] || continue
+		new_lease=$(basename "${lease}" | ${SED} -e 's/dhcpcd-//')
+		new_lease="${DEST_DIR}/var/db/dhcpcd/${new_lease}"
+		move_file "${op}" "${lease}" "${new_lease}"
+		failed=$(( ${failed} + $? ))
+	done
+
 	return ${failed}
 }
 



CVS commit: src/usr.sbin/postinstall

2017-04-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr  1 20:03:31 UTC 2017

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Move dhcpcd's rdm monotonic file if it exists.


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.212 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.211 src/usr.sbin/postinstall/postinstall:1.212
--- src/usr.sbin/postinstall/postinstall:1.211	Sat Apr  1 19:14:10 2017
+++ src/usr.sbin/postinstall/postinstall	Sat Apr  1 20:03:31 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.211 2017/04/01 19:14:10 roy Exp $
+# $NetBSD: postinstall,v 1.212 2017/04/01 20:03:31 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -904,6 +904,11 @@ do_dhcpcd()
 		"${DEST_DIR}/var/db/dhcpcd/secret"
 	failed=$(( ${failed} + $? ))
 
+	move_file "${op}" \
+		"${DEST_DIR}/var/db/dhcpcd-rdm.monotonic" \
+		"${DEST_DIR}/var/db/dhcpcd/rdm_monotonic"
+	failed=$(( ${failed} + $? ))
+
 	return ${failed}
 }
 



CVS commit: src/sys/miscfs/genfs

2017-04-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  1 19:57:54 UTC 2017

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Simplify genfs_getpages_read async/unlock protocol.

Previously the caller unlocked for error or sync I/O, whereas
genfs_getpages_read unlocked on successful async.

Now caller unlocks in every case, and genfs_getpages_read doesn't
touch the lock.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.66 src/sys/miscfs/genfs/genfs_io.c:1.67
--- src/sys/miscfs/genfs/genfs_io.c:1.66	Thu Mar 30 09:12:21 2017
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr  1 19:57:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.66 2017/03/30 09:12:21 hannken Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.67 2017/04/01 19:57:54 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.66 2017/03/30 09:12:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.67 2017/04/01 19:57:54 riastradh Exp $");
 
 #include 
 #include 
@@ -428,11 +428,11 @@ startover:
 	mutex_exit(uobj->vmobjlock);
 	error = genfs_getpages_read(vp, pgs, npages, startoffset, diskeof,
 	async, memwrite, blockalloc, glocked);
-	if (error == 0 && async)
-		goto out_err_free;
 	if (!glocked) {
 		genfs_node_unlock(vp);
 	}
+	if (error == 0 && async)
+		goto out_err_free;
 	mutex_enter(uobj->vmobjlock);
 
 	/*
@@ -714,9 +714,6 @@ loopdone:
 	nestiobuf_done(mbp, skipbytes, error);
 	if (async) {
 		UVMHIST_LOG(ubchist, "returning 0 (async)",0,0,0,0);
-		if (!glocked) {
-			genfs_node_unlock(vp);
-		}
 		return 0;
 	}
 	if (bp != NULL) {



CVS commit: src/sys

2017-04-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  1 19:35:57 UTC 2017

Modified Files:
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/puffs: puffs_vfsops.c
src/sys/fs/smbfs: smbfs_vfsops.c
src/sys/fs/udf: udf_subr.c udf_vfsops.c
src/sys/fs/union: union_vfsops.c
src/sys/fs/v7fs: v7fs_vfsops.c
src/sys/miscfs/procfs: procfs_subr.c
src/sys/nfs: nfs_subs.c nfs_vfsops.c
src/sys/rump/librump/rumpvfs: rump_vfs.c
src/sys/ufs/chfs: chfs_vnode.c
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_snapshot.c ffs_vfsops.c
src/sys/ufs/lfs: lfs_segment.c

Log Message:
KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.119 -r1.120 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.105 -r1.106 src/sys/fs/smbfs/smbfs_vfsops.c
cvs rdiff -u -r1.138 -r1.139 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.12 -r1.13 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.107 -r1.108 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.228 -r1.229 src/sys/nfs/nfs_subs.c
cvs rdiff -u -r1.232 -r1.233 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.86 -r1.87 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/chfs/chfs_vnode.c
cvs rdiff -u -r1.205 -r1.206 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.147 -r1.148 src/sys/ufs/ffs/ffs_snapshot.c
cvs rdiff -u -r1.350 -r1.351 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.264 -r1.265 src/sys/ufs/lfs/lfs_segment.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/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.124 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.125
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.124	Wed Mar  1 10:41:28 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 hannken Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -971,6 +971,8 @@ msdosfs_sync_selector(void *cl, struct v
 	struct msdosfs_sync_ctx *c = cl;
 	struct denode *dep;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	dep = VTODE(vp);
 	if (c->waitfor == MNT_LAZY || vp->v_type == VNON ||
 	dep == NULL || (((dep->de_flag &

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.119 src/sys/fs/puffs/puffs_vfsops.c:1.120
--- src/sys/fs/puffs/puffs_vfsops.c:1.119	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/puffs/puffs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.119 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.120 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.119 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.120 2017/04/01 19:35:56 riastradh Exp $");
 
 #include 
 #include 
@@ -511,6 +511,9 @@ puffs_vfsop_statvfs(struct mount *mp, st
 static bool
 pageflush_selector(void *cl, struct vnode *vp)
 {
+
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	return vp->v_type == VREG &&
 	!(LIST_EMPTY(>v_dirtyblkhd) && UVM_OBJ_IS_CLEAN(>v_uobj));
 }

Index: src/sys/fs/smbfs/smbfs_vfsops.c
diff -u src/sys/fs/smbfs/smbfs_vfsops.c:1.105 src/sys/fs/smbfs/smbfs_vfsops.c:1.106
--- src/sys/fs/smbfs/smbfs_vfsops.c:1.105	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/smbfs/smbfs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: smbfs_vfsops.c,v 1.106 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.106 2017/04/01 19:35:56 riastradh Exp $");
 
 #include 
 #include 
@@ -398,6 +398,8 @@ smbfs_sync_selector(void *cl, struct vno
 {
 	struct smbnode *np;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	np = VTOSMB(vp);
 	if (np == NULL)
 		return false;

Index: src/sys/fs/udf/udf_subr.c
diff -u src/sys/fs/udf/udf_subr.c:1.138 src/sys/fs/udf/udf_subr.c:1.139
--- src/sys/fs/udf/udf_subr.c:1.138	Tue May 24 09:55:57 2016
+++ 

CVS commit: src/usr.sbin/postinstall

2017-04-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr  1 19:14:10 UTC 2017

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Pluck dhcpcd.conf from dist/src
Move dhcpcd.duid and dhcpcd.secret from /etc to /var/db/dhcpcd/{duid,secret}


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.210 src/usr.sbin/postinstall/postinstall:1.211
--- src/usr.sbin/postinstall/postinstall:1.210	Sat Feb 11 19:35:45 2017
+++ src/usr.sbin/postinstall/postinstall	Sat Apr  1 19:14:10 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.210 2017/02/11 19:35:45 uwe Exp $
+# $NetBSD: postinstall,v 1.211 2017/04/01 19:14:10 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -885,11 +885,25 @@ do_dhcpcd()
 	failed=0
 
 	find_file_in_dirlist dhcpcd.conf "dhcpcd.conf" \
-	"${SRC_DIR}/external/bsd/dhcpcd/dist" "${SRC_DIR}/etc" || return 1
+	"${SRC_DIR}/external/bsd/dhcpcd/dist/src" \
+	"${SRC_DIR}/etc" || return 1
 			# ${dir} is set by find_file_in_dirlist()
 	populate_dir "$op" true "${dir}" "${DEST_DIR}/etc" 644 dhcpcd.conf
 	failed=$(( ${failed} + $? ))
 
+	check_dir "${op}" "${DEST_DIR}/var/db/dhcpcd" 755
+	failed=$(( ${failed} + $? ))
+
+	move_file "${op}" \
+		"${DEST_DIR}/etc/dhcpcd.duid" \
+		"${DEST_DIR}/var/db/dhcpcd/duid"
+	failed=$(( ${failed} + $? ))
+
+	move_file "${op}" \
+		"${DEST_DIR}/etc/dhcpcd.secret" \
+		"${DEST_DIR}/var/db/dhcpcd/secret"
+	failed=$(( ${failed} + $? ))
+
 	return ${failed}
 }
 



CVS commit: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks

2017-04-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr  1 19:02:58 UTC 2017

Modified Files:
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks: Makefile

Log Message:
Fix building 50-ypbind


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile

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

Modified files:

Index: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile
diff -u src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.1 src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.2
--- src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.1	Fri Mar 31 21:02:09 2017
+++ src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile	Sat Apr  1 19:02:58 2017
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.1 2017/03/31 21:02:09 roy Exp $
+# $NetBSD: Makefile,v 1.2 2017/04/01 19:02:58 roy Exp $
 #
 
 .include 
 
 .include "../../Makefile.inc"
 HOOKSRC=		${DIST}/hooks
-.PATH:			${HOOKSRC}
+.PATH:			${HOOKSRC} ${OBJDIR}
 
 HOOKS=			01-test 02-dump 20-resolv.conf 30-hostname
 HOOKS+=			50-ntp.conf
@@ -14,14 +14,23 @@ FILES=			${HOOKS:C,^,${HOOKSRC}/,}
 FILESDIR=		/libexec/dhcpcd-hooks
 
 EGHOOKS=		10-wpa_supplicant 15-timezone 29-lookup-hostname
-EGHOOKS+=		50-ypbind
+MKEGHOOKS=		50-ypbind
+CLEANFILES+=		50-ypbind
 
 .if ${MKSHARE} != "no"
 EGFILES=		${EGHOOKS:C,^,${HOOKSRC}/,}
+EGFILES+=		${MKEGHOOKS:C,^,${.OBJDIR}/,}
 FILES+=			${EGFILES}
 .for f in ${EGFILES}
 FILESDIR_${f}=		/usr/share/examples/dhcpcd/hooks
 .endfor
 .endif
 
+.SUFFIXES:		.in
+
+all:	${HOOKS} ${EGHOOKS} ${MKEGHOOKS}
+
+.in:	../../Makefile.inc
+	${TOOL_SED} ${SED_SYS} $< > $@
+
 .include 



CVS commit: src/sys/ufs/lfs

2017-04-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr  1 17:34:21 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_bio.c lfs_pages.c lfs_vfsops.c lfs_vnops.c

Log Message:
Switch lfs_writer_daemon to use condvar instead of mtsleep.
track thread existence with struct lwp instead of pid + lid,
it's more useful from ddb.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -u -r1.10 -r1.11 src/sys/ufs/lfs/lfs_pages.c
cvs rdiff -u -r1.355 -r1.356 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.309 -r1.310 src/sys/ufs/lfs/lfs_vnops.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/ufs/lfs/lfs_bio.c
diff -u src/sys/ufs/lfs/lfs_bio.c:1.136 src/sys/ufs/lfs/lfs_bio.c:1.137
--- src/sys/ufs/lfs/lfs_bio.c:1.136	Mon Mar 13 14:24:20 2017
+++ src/sys/ufs/lfs/lfs_bio.c	Sat Apr  1 17:34:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_bio.c,v 1.136 2017/03/13 14:24:20 riastradh Exp $	*/
+/*	$NetBSD: lfs_bio.c,v 1.137 2017/04/01 17:34:21 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.136 2017/03/13 14:24:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.137 2017/04/01 17:34:21 maya Exp $");
 
 #include 
 #include 
@@ -583,7 +583,7 @@ lfs_check(struct vnode *vp, daddr_t blkn
 	int error;
 	struct lfs *fs;
 	struct inode *ip;
-	extern pid_t lfs_writer_daemon;
+	extern kcondvar_t lfs_writerd_cv;
 
 	error = 0;
 	ip = VTOI(vp);
@@ -660,7 +660,7 @@ lfs_check(struct vnode *vp, daddr_t blkn
 		 * still might want to be flushed.
 		 */
 		++fs->lfs_pdflush;
-		wakeup(_writer_daemon);
+		cv_broadcast(_writerd_cv);
 	}
 
 	while (locked_queue_count + INOCOUNT(fs) >= LFS_WAIT_BUFS ||

Index: src/sys/ufs/lfs/lfs_pages.c
diff -u src/sys/ufs/lfs/lfs_pages.c:1.10 src/sys/ufs/lfs/lfs_pages.c:1.11
--- src/sys/ufs/lfs/lfs_pages.c:1.10	Thu Mar 30 09:10:08 2017
+++ src/sys/ufs/lfs/lfs_pages.c	Sat Apr  1 17:34:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_pages.c,v 1.10 2017/03/30 09:10:08 hannken Exp $	*/
+/*	$NetBSD: lfs_pages.c,v 1.11 2017/04/01 17:34:21 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.10 2017/03/30 09:10:08 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.11 2017/04/01 17:34:21 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -103,7 +103,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,
 #include 
 #include 
 
-extern pid_t lfs_writer_daemon;
+extern kcondvar_t lfs_writerd_cv;
 
 static int check_dirty(struct lfs *, struct vnode *, off_t, off_t, off_t, int, int, struct vm_page **);
 
@@ -691,8 +691,8 @@ retry:
 		if (!(ip->i_flags & IN_PAGING)) {
 			ip->i_flags |= IN_PAGING;
 			TAILQ_INSERT_TAIL(>lfs_pchainhd, ip, i_lfs_pchain);
-		} 
-		wakeup(_writer_daemon);
+		}
+		cv_broadcast(_writerd_cv);
 		mutex_exit(_lock);
 		preempt();
 		KASSERT(!mutex_owned(vp->v_interlock));

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.355 src/sys/ufs/lfs/lfs_vfsops.c:1.356
--- src/sys/ufs/lfs/lfs_vfsops.c:1.355	Sat Apr  1 14:43:00 2017
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sat Apr  1 17:34:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.356 2017/04/01 17:34:21 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.356 2017/04/01 17:34:21 maya Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -128,8 +128,9 @@ extern const struct vnodeopv_desc lfs_vn
 extern const struct vnodeopv_desc lfs_specop_opv_desc;
 extern const struct vnodeopv_desc lfs_fifoop_opv_desc;
 
-pid_t lfs_writer_daemon = 0;
-lwpid_t lfs_writer_lid = 0;
+struct lwp * lfs_writer_daemon = NULL;
+kcondvar_t lfs_writerd_cv;
+
 int lfs_do_flush = 0;
 #ifdef LFS_KERNEL_RFW
 int lfs_do_rfw = 0;
@@ -395,8 +396,8 @@ lfs_writerd(void *arg)
 	int wrote_something = 0;
  
 	mutex_enter(_lock);
- 	lfs_writer_daemon = curproc->p_pid;
-	lfs_writer_lid = curlwp->l_lid;
+	KASSERTMSG(lfs_writer_daemon == NULL, "more than one LFS writer daemon");
+	lfs_writer_daemon = curlwp;
 	mutex_exit(_lock);
 
 	/* Take an extra reference to the LFS vfsops. */
@@ -406,9 +407,7 @@ lfs_writerd(void *arg)
  	for (;;) {
 		KASSERT(mutex_owned(_lock));
 		if (wrote_something == 0)
-			mtsleep(_writer_daemon, PVM, "lfswriter", hz/10 + 1,
-_lock);
-
+			cv_timedwait(_writerd_cv, _lock, hz/10 + 1);
 		KASSERT(mutex_owned(_lock));
 		wrote_something = 0;
 
@@ -508,8 +507,7 @@ lfs_writerd(void *arg)
  		}
 		if (lfsc + skipc == 0) {
 			mutex_enter(_lock);
-			

CVS commit: src/tests/lib/libpthread

2017-04-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr  1 17:19:40 UTC 2017

Modified Files:
src/tests/lib/libpthread: t_mutex.c

Log Message:
Make the mutex6 test (which fails every know and then, but too rarely
to actually debug it) print some debug info when failing.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libpthread/t_mutex.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.17 src/tests/lib/libpthread/t_mutex.c:1.18
--- src/tests/lib/libpthread/t_mutex.c:1.17	Thu Mar 23 08:31:00 2017
+++ src/tests/lib/libpthread/t_mutex.c	Sat Apr  1 17:19:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.17 2017/03/23 08:31:00 martin Exp $ */
+/* $NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.17 2017/03/23 08:31:00 martin Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $");
 
 #include  /* For timespecadd */
 #include  /* For UINT16_MAX */
@@ -492,7 +492,8 @@ ATF_TC_BODY(mutex6, tc)
 	PTHREAD_REQUIRE(pthread_join(low, NULL));
 	PTHREAD_REQUIRE(pthread_join(high, NULL));
 	
-	ATF_REQUIRE_EQ(start, 1);
+	ATF_REQUIRE_EQ_MSG(start, 1, "start = %d, low_cnt =%ju, "
+	"high_cnt = %ju\n", start, high_cnt, low_cnt);
 }
 
 ATF_TC(mutexattr1);



CVS commit: src/sys/ufs/lfs

2017-04-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr  1 14:53:48 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_subr.c

Log Message:
Keep on holding lfs_lock when calling cv_broadcast

pointed out by skrll, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/ufs/lfs/lfs_subr.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/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.87 src/sys/ufs/lfs/lfs_subr.c:1.88
--- src/sys/ufs/lfs/lfs_subr.c:1.87	Sat Apr  1 14:43:00 2017
+++ src/sys/ufs/lfs/lfs_subr.c	Sat Apr  1 14:53:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.88 2017/04/01 14:53:48 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.88 2017/04/01 14:53:48 maya Exp $");
 
 #include 
 #include 
@@ -595,9 +595,9 @@ lfs_writer_leave(struct lfs *fs)
 	ASSERT_MAYBE_SEGLOCK(fs);
 	mutex_enter(_lock);
 	dowakeup = !(--fs->lfs_writer);
-	mutex_exit(_lock);
 	if (dowakeup)
 		cv_broadcast(>lfs_diropscv);
+	mutex_exit(_lock);
 }
 
 /*



CVS commit: src/sys/ufs/lfs

2017-04-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr  1 14:43:00 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs.h lfs_subr.c lfs_vfsops.c lfs_vnops.c

Log Message:
switch lfs_dirops to condvar (from mtsleep)


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/ufs/lfs/lfs.h
cvs rdiff -u -r1.86 -r1.87 src/sys/ufs/lfs/lfs_subr.c
cvs rdiff -u -r1.354 -r1.355 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.308 -r1.309 src/sys/ufs/lfs/lfs_vnops.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/ufs/lfs/lfs.h
diff -u src/sys/ufs/lfs/lfs.h:1.200 src/sys/ufs/lfs/lfs.h:1.201
--- src/sys/ufs/lfs/lfs.h:1.200	Sat Apr  1 01:50:02 2017
+++ src/sys/ufs/lfs/lfs.h	Sat Apr  1 14:43:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs.h,v 1.200 2017/04/01 01:50:02 maya Exp $	*/
+/*	$NetBSD: lfs.h,v 1.201 2017/04/01 14:43:00 maya Exp $	*/
 
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp  */
@@ -976,6 +976,7 @@ struct lfs {
 	uint32_t lfs_iocount;		/* number of ios pending */
 	uint32_t lfs_writer;		/* don't allow any dirops to start */
 	uint32_t lfs_dirops;		/* count of active directory ops */
+	kcondvar_t lfs_diropscv;	/* condvar of active directory ops */
 	uint32_t lfs_dirvcount;		/* count of VDIROP nodes in this fs */
 	uint32_t lfs_doifile;		/* Write ifile blocks on next write */
 	uint32_t lfs_nactive;		/* Number of segments since last ckp */

Index: src/sys/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.86 src/sys/ufs/lfs/lfs_subr.c:1.87
--- src/sys/ufs/lfs/lfs_subr.c:1.86	Sat Oct  3 08:28:16 2015
+++ src/sys/ufs/lfs/lfs_subr.c	Sat Apr  1 14:43:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.86 2015/10/03 08:28:16 dholland Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.86 2015/10/03 08:28:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $");
 
 #include 
 #include 
@@ -597,7 +597,7 @@ lfs_writer_leave(struct lfs *fs)
 	dowakeup = !(--fs->lfs_writer);
 	mutex_exit(_lock);
 	if (dowakeup)
-		wakeup(>lfs_dirops);
+		cv_broadcast(>lfs_diropscv);
 }
 
 /*

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.354 src/sys/ufs/lfs/lfs_vfsops.c:1.355
--- src/sys/ufs/lfs/lfs_vfsops.c:1.354	Sat Apr  1 01:50:02 2017
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sat Apr  1 14:43:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.354 2017/04/01 01:50:02 maya Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.354 2017/04/01 01:50:02 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -1098,6 +1098,7 @@ lfs_mountfs(struct vnode *devvp, struct 
 	rw_init(>lfs_fraglock);
 	rw_init(>lfs_iflock);
 	cv_init(>lfs_sleeperscv, "lfs_slp");
+	cv_init(>lfs_diropscv, "lfs_dirop");
 	cv_init(>lfs_stopcv, "lfsstop");
 
 	/* Set the file system readonly/modify bits. */
@@ -1415,6 +1416,7 @@ lfs_unmount(struct mount *mp, int mntfla
 	free(fs->lfs_suflags, M_SEGMENT);
 	lfs_free_resblks(fs);
 	cv_destroy(>lfs_sleeperscv);
+	cv_destroy(>lfs_diropscv);
 	cv_destroy(>lfs_stopcv);
 	rw_destroy(>lfs_fraglock);
 	rw_destroy(>lfs_iflock);

Index: src/sys/ufs/lfs/lfs_vnops.c
diff -u src/sys/ufs/lfs/lfs_vnops.c:1.308 src/sys/ufs/lfs/lfs_vnops.c:1.309
--- src/sys/ufs/lfs/lfs_vnops.c:1.308	Sat Apr  1 01:50:02 2017
+++ src/sys/ufs/lfs/lfs_vnops.c	Sat Apr  1 14:43:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vnops.c,v 1.308 2017/04/01 01:50:02 maya Exp $	*/
+/*	$NetBSD: lfs_vnops.c,v 1.309 2017/04/01 14:43:00 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.308 2017/04/01 01:50:02 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.309 2017/04/01 14:43:00 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -573,8 +573,7 @@ lfs_set_dirop(struct vnode *dvp, struct 
 		mutex_enter(_lock);
 	}
 	while (fs->lfs_writer) {
-		error = mtsleep(>lfs_dirops, (PRIBIO + 1) | PCATCH,
-		"lfs_sdirop", 0, _lock);
+		error = cv_wait_sig(>lfs_diropscv, _lock);
 		if (error == EINTR) {
 			mutex_exit(_lock);
 			goto unreserve;



CVS commit: src

2017-04-01 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sat Apr  1 14:31:06 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libc/sys: Makefile.inc
src/lib/libutil: Makefile

Log Message:
Add man page links for:
   EV_SET to kqueue(2)
   getmntoptstr, getmntoptnum, freemntopts to getmntopts(3)

Reviewed by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.2114 -r1.2115 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.235 -r1.236 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r1.80 -r1.81 src/lib/libutil/Makefile

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2114 src/distrib/sets/lists/comp/mi:1.2115
--- src/distrib/sets/lists/comp/mi:1.2114	Sat Mar 11 16:34:34 2017
+++ src/distrib/sets/lists/comp/mi	Sat Apr  1 14:31:05 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2114 2017/03/11 16:34:34 christos Exp $
+#	$NetBSD: mi,v 1.2115 2017/04/01 14:31:05 abhinav Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -4075,6 +4075,7 @@
 ./usr/share/man/cat2/dup2.0			comp-c-catman		.cat
 ./usr/share/man/cat2/dup3.0			comp-c-catman		.cat
 ./usr/share/man/cat2/errno.0			comp-c-catman		.cat
+./usr/share/man/cat2/EV_SET.0			comp-c-catman		.cat
 ./usr/share/man/cat2/execve.0			comp-c-catman		.cat
 ./usr/share/man/cat2/extattr_delete_fd.0	comp-c-catman		.cat
 ./usr/share/man/cat2/extattr_delete_file.0	comp-c-catman		.cat
@@ -4161,6 +4162,7 @@
 ./usr/share/man/cat2/kevent.0			comp-c-catman		.cat
 ./usr/share/man/cat2/kill.0			comp-c-catman		.cat
 ./usr/share/man/cat2/kqueue.0			comp-c-catman		.cat
+./usr/share/man/cat2/kqueue1.0			comp-c-catman		.cat
 ./usr/share/man/cat2/ktrace.0			comp-c-catman		.cat
 ./usr/share/man/cat2/lchflags.0			comp-c-catman		.cat
 ./usr/share/man/cat2/lchmod.0			comp-c-catman		.cat
@@ -6486,6 +6488,7 @@
 ./usr/share/man/cat3/free_menu.0		comp-c-catman		.cat
 ./usr/share/man/cat3/freeaddrinfo.0		comp-c-catman		.cat
 ./usr/share/man/cat3/freeifaddrs.0		comp-c-catman		.cat
+./usr/share/man/cat3/freemntopts.0		comp-c-catman		.cat
 ./usr/share/man/cat3/freopen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/frexp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fropen.0			comp-c-catman		.cat
@@ -6636,7 +6639,9 @@
 ./usr/share/man/cat3/getmaxy.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getmaxyx.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getmntinfo.0		comp-c-catman		.cat
+./usr/share/man/cat3/getmntoptnum.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getmntopts.0		comp-c-catman		.cat
+./usr/share/man/cat3/getmntoptstr.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getmode.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getnameinfo.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getnetbyaddr.0		comp-c-catman		.cat
@@ -11575,6 +11580,7 @@
 ./usr/share/man/html2/dup2.html			comp-c-htmlman		html
 ./usr/share/man/html2/dup3.html			comp-c-htmlman		html
 ./usr/share/man/html2/errno.html		comp-c-htmlman		html
+./usr/share/man/html2/EV_SET.html		comp-c-htmlman		html
 ./usr/share/man/html2/execve.html		comp-c-htmlman		html
 ./usr/share/man/html2/extattr_delete_fd.html	comp-c-htmlman		html
 ./usr/share/man/html2/extattr_delete_file.html	comp-c-htmlman		html
@@ -11655,6 +11661,7 @@
 ./usr/share/man/html2/kevent.html		comp-c-htmlman		html
 ./usr/share/man/html2/kill.html			comp-c-htmlman		html
 ./usr/share/man/html2/kqueue.html		comp-c-htmlman		html
+./usr/share/man/html2/kqueue1.html		comp-c-htmlman		html
 ./usr/share/man/html2/ktrace.html		comp-c-htmlman		html
 ./usr/share/man/html2/lchflags.html		comp-c-htmlman		html
 ./usr/share/man/html2/lchmod.html		comp-c-htmlman		html
@@ -13913,6 +13920,7 @@
 ./usr/share/man/html3/free_menu.html		comp-c-htmlman		html
 ./usr/share/man/html3/freeaddrinfo.html		comp-c-htmlman		html
 ./usr/share/man/html3/freeifaddrs.html		comp-c-htmlman		html
+./usr/share/man/html3/freemntopts.html		comp-c-htmlman		html
 ./usr/share/man/html3/freopen.html		comp-c-htmlman		html
 ./usr/share/man/html3/frexp.html		comp-c-htmlman		html
 ./usr/share/man/html3/fropen.html		comp-c-htmlman		html
@@ -14062,7 +14070,9 @@
 ./usr/share/man/html3/getmaxy.html		comp-c-htmlman		html
 ./usr/share/man/html3/getmaxyx.html		comp-c-htmlman		html
 ./usr/share/man/html3/getmntinfo.html		comp-c-htmlman		html
+./usr/share/man/html3/getmntoptnum.html		comp-c-htmlman		html
 ./usr/share/man/html3/getmntopts.html		comp-c-htmlman		html
+./usr/share/man/html3/getmntoptstr.html		comp-c-htmlman		html
 ./usr/share/man/html3/getmode.html		comp-c-htmlman		html
 ./usr/share/man/html3/getnameinfo.html		comp-c-htmlman		html
 ./usr/share/man/html3/getnetbyaddr.html		comp-c-htmlman		html
@@ -18844,6 +18854,7 @@
 ./usr/share/man/man2/dup2.2			comp-c-man		.man
 ./usr/share/man/man2/dup3.2			comp-c-man		.man
 ./usr/share/man/man2/errno.2			comp-c-man		.man

CVS commit: src/lib/libc/sys

2017-04-01 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sat Apr  1 14:20:45 UTC 2017

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Add EV_SET() to the NAME section
Use Xr instead of Fn to refer other man pages
Add some more entries to SEE ALSO

Reviewed by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.36 src/lib/libc/sys/kqueue.2:1.37
--- src/lib/libc/sys/kqueue.2:1.36	Mon Dec 19 07:48:35 2016
+++ src/lib/libc/sys/kqueue.2	Sat Apr  1 14:20:45 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.36 2016/12/19 07:48:35 abhinav Exp $
+.\"	$NetBSD: kqueue.2,v 1.37 2017/04/01 14:20:45 abhinav Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -38,7 +38,8 @@
 .Sh NAME
 .Nm kqueue ,
 .Nm kqueue1 ,
-.Nm kevent
+.Nm kevent ,
+.Nm EV_SET
 .Nd kernel event notification mechanism
 .Sh LIBRARY
 .Lb libc
@@ -76,7 +77,7 @@ Multiple events which trigger the filter
 kevents being placed on the kqueue; instead, the filter will aggregate
 the events into a single struct kevent.
 Calling
-.Fn close
+.Xr close 2
 on a file descriptor will remove any kevents that reference the descriptor.
 .Pp
 .Fn kqueue
@@ -302,7 +303,7 @@ on the descriptor type.
 .Bl -tag -width 2n
 .It Sockets
 Sockets which have previously been passed to
-.Fn listen
+.Xr listen 2
 return when there is an incoming connection pending.
 .Va data
 contains the size of the listen backlog (i.e., the number of
@@ -395,7 +396,7 @@ and returns when one or more of the requ
 The events to monitor are:
 .Bl -tag -width XXNOTE_RENAME
 .It NOTE_DELETE
-.Fn unlink
+.Xr unlink 2
 was called on the file referenced by the descriptor.
 .It NOTE_WRITE
 A write occurred on the file referenced by the descriptor.
@@ -430,14 +431,14 @@ The exit code of the process is stored i
 .Va data .
 .It NOTE_FORK
 The process has called
-.Fn fork .
+.Xr fork 2 .
 .It NOTE_EXEC
 The process has executed a new process via
 .Xr execve 2
 or similar call.
 .It NOTE_TRACK
 Follow a process across
-.Fn fork
+.Xr fork 2
 calls.
 The parent process will return with NOTE_TRACK set in the
 .Va fflags
@@ -457,9 +458,9 @@ contains the events which triggered the 
 Takes the signal number to monitor as the identifier and returns
 when the given signal is delivered to the current process.
 This coexists with the
-.Fn signal
+.Xr signal 3
 and
-.Fn sigaction
+.Xr sigaction 2
 facilities, and has a lower precedence.
 The filter will record
 all attempts to deliver a signal to a process, even if the signal has
@@ -632,11 +633,14 @@ The specified process to attach to does 
 .\" .Xr aio_error 2 ,
 .\" .Xr aio_read 2 ,
 .\" .Xr aio_return 2 ,
+.Xr fork 2 ,
 .Xr ioctl 2 ,
+.Xr listen 2 ,
 .Xr poll 2 ,
 .Xr read 2 ,
 .Xr select 2 ,
 .Xr sigaction 2 ,
+.Xr unlink 2 ,
 .Xr write 2 ,
 .Xr signal 3 ,
 .Xr kfilter_register 9 ,



CVS commit: src/external/bsd/dhcpcd/libexec

2017-04-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr  1 10:51:41 UTC 2017

Modified Files:
src/external/bsd/dhcpcd/libexec: Makefile

Log Message:
We should build the hooks as well really.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/dhcpcd/libexec/Makefile

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

Modified files:

Index: src/external/bsd/dhcpcd/libexec/Makefile
diff -u src/external/bsd/dhcpcd/libexec/Makefile:1.1 src/external/bsd/dhcpcd/libexec/Makefile:1.2
--- src/external/bsd/dhcpcd/libexec/Makefile:1.1	Fri Mar 31 21:02:09 2017
+++ src/external/bsd/dhcpcd/libexec/Makefile	Sat Apr  1 10:51:41 2017
@@ -1,6 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2017/03/31 21:02:09 roy Exp $
+#	$NetBSD: Makefile,v 1.2 2017/04/01 10:51:41 roy Exp $
 
-SUBDIR=		dhcpcd-hooks
-SUBDIR=		dhcpcd-run-hooks
+SUBDIR=		dhcpcd-run-hooks dhcpcd-hooks
 
 .include