CVS commit: src/lib/libc/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 07:17:38 UTC 2017

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

Log Message:
Document PTRACE_LWP_CREATE and PTRACE_LWP_EXIT in ptrace(2)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/sys/ptrace.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/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.53 src/lib/libc/sys/ptrace.2:1.54
--- src/lib/libc/sys/ptrace.2:1.53	Sat Jan 14 00:02:40 2017
+++ src/lib/libc/sys/ptrace.2	Sat Jan 14 07:17:38 2017
@@ -1,7 +1,7 @@
-.\"	$NetBSD: ptrace.2,v 1.53 2017/01/14 00:02:40 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.54 2017/01/14 07:17:38 kamil Exp $
 .\"
 .\" This file is in the public domain.
-.Dd January 13, 2016
+.Dd January 14, 2016
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -385,6 +385,10 @@ Report
 .It PTRACE_VFORK_DONE
 Report parent resumed after
 .Xr vfork 2 .
+.It PTRACE_LWP_CREATE
+Report thread birth.
+.It PTRACE_LWP_EXIT
+Report thread termination.
 .El
 .Pp
 The



CVS commit: src/lib/libc/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 07:17:38 UTC 2017

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

Log Message:
Document PTRACE_LWP_CREATE and PTRACE_LWP_EXIT in ptrace(2)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/sys/ptrace.2

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



CVS commit: src/share/man/man2

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 06:55:40 UTC 2017

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document TRAP_LWP in siginfo(2)

TRAP_LWP - process lwp (thread) traps

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man2/siginfo.2

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

Modified files:

Index: src/share/man/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.20 src/share/man/man2/siginfo.2:1.21
--- src/share/man/man2/siginfo.2:1.20	Tue Jan 10 00:51:56 2017
+++ src/share/man/man2/siginfo.2	Sat Jan 14 06:55:40 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.20 2017/01/10 00:51:56 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.21 2017/01/14 06:55:40 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 10, 2017
+.Dd January 14, 2017
 .Dt SIGINFO 2
 .Os
 .Sh NAME
@@ -233,6 +233,8 @@ Process breakpoint
 Process child trap
 .It TRAP_EXEC
 Process exec trap
+.It TRAP_LWP
+Process LWP trap
 .It TRAP_TRACE
 Process trace trap
 .El



CVS commit: src/share/man/man2

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 06:55:40 UTC 2017

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document TRAP_LWP in siginfo(2)

TRAP_LWP - process lwp (thread) traps

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man2/siginfo.2

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



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 06:51:02 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
Document the latest ptrace(2) and siginfo(2) additions:

Added new entries:
ptrace(2): Add new options in EVENT_MASK: PTRACE_LWP_CREATE and
PTRACE_LWP_EXIT
siginfo(2): Add new si_code for SIGTRAP: TRAP_LWP

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.2236 -r1.2237 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2236 src/doc/CHANGES:1.2237
--- src/doc/CHANGES:1.2236	Fri Jan 13 23:29:10 2017
+++ src/doc/CHANGES	Sat Jan 14 06:51:02 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2236 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2237 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -449,3 +449,6 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	ptrace(2): Add new si_code value of SIGTRAP: TRAP_CHLD [kamil 20170110]
 	ptrace(2): Add new options in EVENT_MASK: PTRACE_VFORK and
 		PTRACE_VFORK_DONE [kamil 20170113]
+	ptrace(2): Add new options in EVENT_MASK: PTRACE_LWP_CREATE and
+		PTRACE_LWP_EXIT [kamil 20170114]
+	siginfo(2): Add new si_code for SIGTRAP: TRAP_LWP [kamil 20170114]



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 06:51:02 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
Document the latest ptrace(2) and siginfo(2) additions:

Added new entries:
ptrace(2): Add new options in EVENT_MASK: PTRACE_LWP_CREATE and
PTRACE_LWP_EXIT
siginfo(2): Add new si_code for SIGTRAP: TRAP_LWP

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.2236 -r1.2237 src/doc/CHANGES

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



CVS commit: src

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 06:36:52 UTC 2017

Modified Files:
src/sys/kern: kern_lwp.c sys_ptrace_common.c
src/sys/sys: proc.h ptrace.h siginfo.h
src/tests/kernel: t_ptrace_wait.c

Log Message:
Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5)

Add interface in ptrace(2) to track thread (LWP) events:
 - birth,
 - termination.

The purpose of this thread is to keep track of the current thread state in
a tracee and apply e.g. per-thread designed hardware assisted watchpoints.

This interface reuses the EVENT_MASK and PROCESS_STATE interface, and
shares it with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE.

Change the following structure:

typedef struct ptrace_state {
int pe_report_event;
pid_t   pe_other_pid;
} ptrace_state_t;

to

typedef struct ptrace_state {
int pe_report_event;
union {
pid_t   _pe_other_pid;
lwpid_t _pe_lwp;
} _option;
} ptrace_state_t;

#define pe_other_pid_option._pe_other_pid
#define pe_lwp  _option._pe_lwp

This keeps size of ptrace_state_t unchanged as both pid_t and lwpid_t are
defined as int32_t-like integer. This change does not break existing
prebuilt software and has minimal effect on necessity for source-code
changes. In summary, this change should be binary compatible and shouldn't
break build of existing software.

Introduce new siginfo(5) type for LWP events under the SIGTRAP signal:
TRAP_LWP. This change will help debuggers to distinguish exact source of
SIGTRAP.

Add two basic t_ptrace_wait* tests:
lwp_create1:
Verify that 1 LWP creation is intercepted by ptrace(2) with
EVENT_MASK set to PTRACE_LWP_CREATE

lwp_exit1:
Verify that 1 LWP creation is intercepted by ptrace(2) with
EVENT_MASK set to PTRACE_LWP_EXIT

All tests are passing.

Surfing the previous kernel ABI bump to 7.99.59 for PTRACE_VFORK{,_DONE}.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.336 -r1.337 src/sys/sys/proc.h
cvs rdiff -u -r1.53 -r1.54 src/sys/sys/ptrace.h
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/siginfo.h
cvs rdiff -u -r1.58 -r1.59 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.



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 04:54:42 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_naive.S

Log Message:
fix standalone


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/arm/string/strcpy_naive.S

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



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 04:54:42 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_naive.S

Log Message:
fix standalone


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/arm/string/strcpy_naive.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy_naive.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.7 src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.8
--- src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.7	Fri Jan 13 23:53:25 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_naive.S	Fri Jan 13 23:54:42 2017
@@ -28,7 +28,7 @@
  */
 #include 
 
-RCSID("$NetBSD: strcpy_naive.S,v 1.7 2017/01/14 04:53:25 christos Exp $")
+RCSID("$NetBSD: strcpy_naive.S,v 1.8 2017/01/14 04:54:42 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
@@ -82,12 +82,12 @@ ENTRY(strncpy)
 END(strncpy)
 #else
 /* LINTSTUB: char * strcpy(char *, const char *) */
-ENTRY(_strcpy)
+ENTRY(strcpy)
 	mov	ip, r0			/* we want to preserve r0 */
 1:	ldrb	r3, [r1], #1		/* read a byte */
 	strb	r3, [ip], #1		/* write a byte */
 	teq	r3, #0			/* was it a NUL? */
 	bne	1b			/*   no, try next byte */
 	RET/* return dst pointer */
-END(_strcpy)
+END(strcpy)
 #endif



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 04:53:25 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_naive.S

Log Message:
fix standalone


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/strcpy_naive.S

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



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 04:53:25 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_naive.S

Log Message:
fix standalone


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/strcpy_naive.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy_naive.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.6 src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.7
--- src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.6	Fri Jan 13 22:35:21 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_naive.S	Fri Jan 13 23:53:25 2017
@@ -28,7 +28,7 @@
  */
 #include 
 
-RCSID("$NetBSD: strcpy_naive.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
+RCSID("$NetBSD: strcpy_naive.S,v 1.7 2017/01/14 04:53:25 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
@@ -66,7 +66,7 @@ ENTRY(strlcpy)
 END(strlcpy)
 #elif defined(STRNCPY)
 /* LINTSTUB: char * strncpy(char *, const char *, size_t) */
-ENTRY(_strncpy)
+ENTRY(strncpy)
 	mov	ip, r0			/* we want to preserve r0 */
 	add	r2, r2, r0		/* get end of dst buffer */
 1:	cmp	ip, r2			/* are at the end of dst already? */
@@ -79,7 +79,7 @@ ENTRY(_strncpy)
 	strblt	r3, [ip], #1		/*   no, write a NUL */
 	blt	2b			/*   until dst is filled */
 3:	RET/* return dst pointer */
-END(_strncpy)
+END(strncpy)
 #else
 /* LINTSTUB: char * strcpy(char *, const char *) */
 ENTRY(_strcpy)



CVS commit: src/tests/kernel

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 04:37:55 UTC 2017

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

Log Message:
Add new tests eventmask[34] in t_ptrace_wait{,3,4,6,id,pid}

eventmask3:
Verify that PTRACE_VFORK in EVENT_MASK is preserved

eventmask4:
Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved

Currently eventmask3 is failing and marked with PR kern/51630

Sponsored by 


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



CVS commit: src/tests/kernel

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 04:37:55 UTC 2017

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

Log Message:
Add new tests eventmask[34] in t_ptrace_wait{,3,4,6,id,pid}

eventmask3:
Verify that PTRACE_VFORK in EVENT_MASK is preserved

eventmask4:
Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved

Currently eventmask3 is failing and marked with PR kern/51630

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 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.57 src/tests/kernel/t_ptrace_wait.c:1.58
--- src/tests/kernel/t_ptrace_wait.c:1.57	Fri Jan 13 23:22:12 2017
+++ src/tests/kernel/t_ptrace_wait.c	Sat Jan 14 04:37:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.57 2017/01/13 23:22:12 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.57 2017/01/13 23:22:12 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $");
 
 #include 
 #include 
@@ -1072,6 +1072,118 @@ ATF_TC_BODY(eventmask2, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+ATF_TC(eventmask3);
+ATF_TC_HEAD(eventmask3, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that PTRACE_VFORK in EVENT_MASK is preserved");
+}
+
+ATF_TC_BODY(eventmask3, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_event_t set_event, get_event;
+	const int len = sizeof(ptrace_event_t);
+
+	atf_tc_expect_fail("PR kern/51630");
+
+	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);
+
+	set_event.pe_set_event = PTRACE_VFORK;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, _event, len) != -1);
+	ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, _event, len) != -1);
+	ATF_REQUIRE(memcmp(_event, _event, len) == 0);
+
+	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_exited(status, exitval);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
+}
+
+ATF_TC(eventmask4);
+ATF_TC_HEAD(eventmask4, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved");
+}
+
+ATF_TC_BODY(eventmask4, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_event_t set_event, get_event;
+	const int len = sizeof(ptrace_event_t);
+
+	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);
+
+	set_event.pe_set_event = PTRACE_VFORK_DONE;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, _event, len) != -1);
+	ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, _event, len) != -1);
+	ATF_REQUIRE(memcmp(_event, _event, len) == 0);
+
+	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_exited(status, exitval);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);

Re: CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Paul Goyette

Should address PR bin/51869

On Sat, 14 Jan 2017, Paul Goyette wrote:


Module Name:src
Committed By:   pgoyette
Date:   Sat Jan 14 03:59:58 UTC 2017

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
Set FILESBUILD=yes to actually run the creation script for the file.

Should fix the build by creating a file which install can then find.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/sys/Makefile

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


!DSPAM:5879a267143851834045299!




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+--+--++


CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan 14 03:59:58 UTC 2017

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
Set FILESBUILD=yes to actually run the creation script for the file.

Should fix the build by creating a file which install can then find.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/sys/Makefile

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/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.46 src/tests/lib/libc/sys/Makefile:1.47
--- src/tests/lib/libc/sys/Makefile:1.46	Fri Jan 13 20:03:51 2017
+++ src/tests/lib/libc/sys/Makefile	Sat Jan 14 03:59:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2017/01/13 20:03:51 christos Exp $
+# $NetBSD: Makefile,v 1.47 2017/01/14 03:59:58 pgoyette Exp $
 
 MKMAN=	no
 
@@ -85,6 +85,7 @@ LDADD.t_posix_fadvise+= -lrumpvfs -lrump
 CPPFLAGS.t_lwp_create.c += -D_KERNTYPES
 
 FILES=		truncate_test.root_owned
+FILESBUILD=	yes
 FILESDIR=	${TESTSDIR}
 FILESMODE=	0600
 FILESOWNER=	root



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan 14 03:59:58 UTC 2017

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
Set FILESBUILD=yes to actually run the creation script for the file.

Should fix the build by creating a file which install can then find.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/sys/Makefile

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



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 03:35:21 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S strcpy_naive.S

Log Message:
fix rump


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/arm/string/strcpy_arm.S \
src/common/lib/libc/arch/arm/string/strcpy_naive.S

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



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 03:35:21 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S strcpy_naive.S

Log Message:
fix rump


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/arm/string/strcpy_arm.S \
src/common/lib/libc/arch/arm/string/strcpy_naive.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy_arm.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.5 src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.6
--- src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.5	Fri Jan 13 22:00:13 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_arm.S	Fri Jan 13 22:35:21 2017
@@ -29,19 +29,29 @@
 
 #include 
 
-RCSID("$NetBSD: strcpy_arm.S,v 1.5 2017/01/14 03:00:13 christos Exp $")
+RCSID("$NetBSD: strcpy_arm.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
 
 #ifdef STRLCPY
 #ifdef _LIBC
 WEAK_ALIAS(strlcpy, _strlcpy)
-#endif
-#define	FUNCNAME	_strlcpy
+#  define	FUNCNAME	_strlcpy
+# else
+#  define	FUNCNAME	strlcpy
+# endif
 #elif defined(STRNCPY)
+# ifdef _LIBC
 WEAK_ALIAS(strncpy, _strncpy)
-#define	FUNCNAME	_strncpy
+#  define	FUNCNAME	_strncpy
+# else
+#  define	FUNCNAME	strncpy
+# endif
 #else
+# ifdef _LIBC
 WEAK_ALIAS(strcpy, _strcpy)
-#define	FUNCNAME	_strcpy
+#  define	FUNCNAME	_strcpy
+# else
+#  define	FUNCNAME	strcpy
+# endif
 #endif
 
 #ifdef __ARMEL__
Index: src/common/lib/libc/arch/arm/string/strcpy_naive.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.5 src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.6
--- src/common/lib/libc/arch/arm/string/strcpy_naive.S:1.5	Fri Jan 13 08:14:54 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_naive.S	Fri Jan 13 22:35:21 2017
@@ -28,11 +28,12 @@
  */
 #include 
 
-RCSID("$NetBSD: strcpy_naive.S,v 1.5 2017/01/13 13:14:54 christos Exp $")
+RCSID("$NetBSD: strcpy_naive.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
 WEAK_ALIAS(strlcpy, _strlcpy)   
+#define strlcpy _strlcpy
 #endif
 #endif
 
@@ -43,7 +44,7 @@ WEAK_ALIAS(strlcpy, _strlcpy)   
 
 #if defined(STRLCPY)
 /* LINTSTUB: size_t strlcpy(char *, const char *, size_t) */
-ENTRY(_strlcpy)
+ENTRY(strlcpy)
 	add	ip, r1, #1		/* save src pointer (+ NUL) */
 	subs	r2, r2, #1		/* make sure there's room for a NUL */
 	blt	3f			/*   no room, do the strlen */
@@ -62,7 +63,7 @@ ENTRY(_strlcpy)
 	bne	3b			/*   no, get next byte */
 4:	sub	r0, r1, ip 		/* return length of src string */
 	RET
-END(_strlcpy)
+END(strlcpy)
 #elif defined(STRNCPY)
 /* LINTSTUB: char * strncpy(char *, const char *, size_t) */
 ENTRY(_strncpy)



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 03:00:13 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S strcpy_thumb.S
strlcat.S

Log Message:
fix weak symbols. More work needs to be done for memcpy/strlen etc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/string/strcpy_arm.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/strcpy_thumb.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/string/strlcat.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy_arm.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.4 src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.5
--- src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.4	Fri Jan 13 08:14:54 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_arm.S	Fri Jan 13 22:00:13 2017
@@ -29,7 +29,7 @@
 
 #include 
 
-RCSID("$NetBSD: strcpy_arm.S,v 1.4 2017/01/13 13:14:54 christos Exp $")
+RCSID("$NetBSD: strcpy_arm.S,v 1.5 2017/01/14 03:00:13 christos Exp $")
 
 #ifdef STRLCPY
 #ifdef _LIBC
@@ -37,8 +37,10 @@ WEAK_ALIAS(strlcpy, _strlcpy)
 #endif
 #define	FUNCNAME	_strlcpy
 #elif defined(STRNCPY)
+WEAK_ALIAS(strncpy, _strncpy)
 #define	FUNCNAME	_strncpy
 #else
+WEAK_ALIAS(strcpy, _strcpy)
 #define	FUNCNAME	_strcpy
 #endif
 

Index: src/common/lib/libc/arch/arm/string/strcpy_thumb.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_thumb.S:1.2 src/common/lib/libc/arch/arm/string/strcpy_thumb.S:1.3
--- src/common/lib/libc/arch/arm/string/strcpy_thumb.S:1.2	Fri Jan 13 08:14:54 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_thumb.S	Fri Jan 13 22:00:13 2017
@@ -28,11 +28,20 @@
  */
 #include 
 
-RCSID("$NetBSD: strcpy_thumb.S,v 1.2 2017/01/13 13:14:54 christos Exp $")
+RCSID("$NetBSD: strcpy_thumb.S,v 1.3 2017/01/14 03:00:13 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
-WEAK_ALIAS(strlcpy, _strlcpy)   
+WEAK_ALIAS(strlcpy, _strlcpy)
+#define strlcpy _strlcpy
+#endif
+#ifdef STRNCPY
+WEAK_ALIAS(strncpy, _strncpy)
+#define strncpy _strncpy
+#endif
+#ifdef STRCPY
+WEAK_ALIAS(strcpy, _strcpy)
+#define strcpy _strcpy
 #endif
 #endif
 
@@ -43,7 +52,7 @@ WEAK_ALIAS(strlcpy, _strlcpy)   
 
 #if defined(STRLCPY)
 /* LINTSTUB: size_t strlcpy(char *, const char *, size_t) */
-ENTRY(_strlcpy)
+ENTRY(strlcpy)
 	adds	r3, r1, #1		/* save src pointer (+ NUL) */
 	subs	r2, r2, #1		/* make sure there's room for a NUL */
 	blt	3f			/*   no room, do the strlen */
@@ -65,10 +74,10 @@ ENTRY(_strlcpy)
 	bne	3b			/*   no, get next byte */
 4:	subs	r0, r1, r3 		/* return length of src string */
 	RET
-END(_strlcpy)
+END(strlcpy)
 #elif defined(STRNCPY)
 /* LINTSTUB: char * strncpy(char *, const char *, size_t) */
-ENTRY(_strncpy)
+ENTRY(strncpy)
 	mov	ip, r0			/* we want to preserve r0 */
 	adds	r2, r2, r0		/* get end of dst buffer */
 	subs	r1, r1, r0		/* allows to only increment once */
@@ -86,10 +95,10 @@ ENTRY(_strncpy)
 	b	2b			/* until dst is filled */
 3:	mov	r0, ip			/* return dst pointer */
 	RET
-END(_strncpy)
+END(strncpy)
 #else
 /* LINTSTUB: char * strcpy(char *, const char *) */
-ENTRY(_strcpy)
+ENTRY(strcpy)
 	subs	r2, r0, r1		/* we want to preserve r0 */
 1:	ldrb	r3, [r1]		/* read a byte */
 	strb	r3, [r2, r1]		/* write a byte */
@@ -97,5 +106,5 @@ ENTRY(_strcpy)
 	cmp	r3, #0			/* was it a NUL? */
 	bne	1b			/*   no, try next byte */
 	RET/* return dst pointer */
-END(_strcpy)
+END(strcpy)
 #endif

Index: src/common/lib/libc/arch/arm/string/strlcat.S
diff -u src/common/lib/libc/arch/arm/string/strlcat.S:1.3 src/common/lib/libc/arch/arm/string/strlcat.S:1.4
--- src/common/lib/libc/arch/arm/string/strlcat.S:1.3	Fri Jan 13 08:14:54 2017
+++ src/common/lib/libc/arch/arm/string/strlcat.S	Fri Jan 13 22:00:13 2017
@@ -1,9 +1,10 @@
-/* $NetBSD: strlcat.S,v 1.3 2017/01/13 13:14:54 christos Exp $ */
+/* $NetBSD: strlcat.S,v 1.4 2017/01/14 03:00:13 christos Exp $ */
 
 #include 
 
 #ifdef _LIBC
 WEAK_ALIAS(strlcat, _strlcat)
+#define strlcat _strlcat
 #endif
 
 #if defined(_STANDALONE) && 0	/* arm version is always smaller */



CVS commit: src/common/lib/libc/arch/arm/string

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 03:00:13 UTC 2017

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S strcpy_thumb.S
strlcat.S

Log Message:
fix weak symbols. More work needs to be done for memcpy/strlen etc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/string/strcpy_arm.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/strcpy_thumb.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/string/strlcat.S

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



CVS commit: src/distrib/sets/lists/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:44:13 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add new test file


To generate a diff of this commit:
cvs rdiff -u -r1.713 -r1.714 src/distrib/sets/lists/tests/mi

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.713 src/distrib/sets/lists/tests/mi:1.714
--- src/distrib/sets/lists/tests/mi:1.713	Thu Jan  5 08:45:51 2017
+++ src/distrib/sets/lists/tests/mi	Fri Jan 13 20:44:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.713 2017/01/05 13:45:51 wiz Exp $
+# $NetBSD: mi,v 1.714 2017/01/14 01:44:13 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2778,6 +2778,7 @@
 ./usr/tests/lib/libc/sys/t_wait_noproc		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_wait_noproc_wnohang	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_write		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/sys/truncate_test.root_owned	tests-lib-tests	compattestfile,atf
 ./usr/tests/lib/libc/t_atexit			tests-obsolete		obsolete
 ./usr/tests/lib/libc/t_cdb			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/t_cerror			tests-obsolete		obsolete



CVS commit: src/distrib/sets/lists/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:44:13 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add new test file


To generate a diff of this commit:
cvs rdiff -u -r1.713 -r1.714 src/distrib/sets/lists/tests/mi

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



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 01:36:28 UTC 2017

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update TODO.ptrace

Removed:
  - evaluate equivalent for PTRACE_O_TRACECLONE from Linux

clone(2)-like calls are traced with PTRACE_FORK, PTRACE_VFORK and
PTRACE_VFORK_DONE. VFORK ones block parent till termination or execve(2) of
its child.

Added:
  - add proper implementation of PTRACE_VFORK for vfork(2)-like events

Currently PTRACE_VFORK is a stub.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/doc/TODO.ptrace

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



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 01:36:28 UTC 2017

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update TODO.ptrace

Removed:
  - evaluate equivalent for PTRACE_O_TRACECLONE from Linux

clone(2)-like calls are traced with PTRACE_FORK, PTRACE_VFORK and
PTRACE_VFORK_DONE. VFORK ones block parent till termination or execve(2) of
its child.

Added:
  - add proper implementation of PTRACE_VFORK for vfork(2)-like events

Currently PTRACE_VFORK is a stub.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/doc/TODO.ptrace

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

Modified files:

Index: src/doc/TODO.ptrace
diff -u src/doc/TODO.ptrace:1.10 src/doc/TODO.ptrace:1.11
--- src/doc/TODO.ptrace:1.10	Sun Jan  8 04:27:36 2017
+++ src/doc/TODO.ptrace	Sat Jan 14 01:36:28 2017
@@ -1,4 +1,4 @@
-$NetBSD: TODO.ptrace,v 1.10 2017/01/08 04:27:36 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.11 2017/01/14 01:36:28 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
@@ -16,7 +16,7 @@ Items we (currently) plan to finish in t
in all ports
  - integrate all ptrace(2) features in gdb
  - add ptrace(2) NetBSD support in LLDB
- - evaluate equivalent for PTRACE_O_TRACECLONE from Linux
+ - add proper implementation of PTRACE_VFORK for vfork(2)-like events
  - remove exect(3) - there is no usecase for it
  - refactor pthread_dbg(3) to only query private pthread_t data, otherwise it
duplicates ptrace(2) interface and cannot cover all types of threads



CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:33:32 UTC 2017

Modified Files:
src/tests: Makefile.inc

Log Message:
better name


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/Makefile.inc

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

Modified files:

Index: src/tests/Makefile.inc
diff -u src/tests/Makefile.inc:1.4 src/tests/Makefile.inc:1.5
--- src/tests/Makefile.inc:1.4	Fri Jan 13 19:33:19 2017
+++ src/tests/Makefile.inc	Fri Jan 13 20:33:32 2017
@@ -1,5 +1,5 @@
-# $NetBSD: Makefile.inc,v 1.4 2017/01/14 00:33:19 christos Exp $
+# $NetBSD: Makefile.inc,v 1.5 2017/01/14 01:33:32 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
-TOPSRCDIR:= ${.PARSEDIR}
-CPPFLAGS+= -I${TOPSRCDIR}
+TOOLSSRCDIR:= ${.PARSEDIR}
+CPPFLAGS+= -I${TOOLSSRCDIR}



CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:33:32 UTC 2017

Modified Files:
src/tests: Makefile.inc

Log Message:
better name


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/Makefile.inc

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



CVS commit: src/sys/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:02:08 UTC 2017

Modified Files:
src/sys/sys: types.h

Log Message:
expose more for _KMEMUSER


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/sys/types.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/sys/types.h
diff -u src/sys/sys/types.h:1.97 src/sys/sys/types.h:1.98
--- src/sys/sys/types.h:1.97	Sat Apr  2 22:08:42 2016
+++ src/sys/sys/types.h	Fri Jan 13 20:02:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.97 2016/04/03 02:08:42 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.98 2017/01/14 01:02:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993, 1994
@@ -217,7 +217,7 @@ typedef int	boolean_t;
 
 #endif /* _KERNEL || _STANDALONE */
 
-#if defined(_KERNEL) || defined(_LIBC)
+#if defined(_KERNEL) || defined(_LIBC) || defined(_KMEMUSER)
 /*
  * semctl(2)'s argument structure.  This is here for the benefit of
  * .  It is not in the user's namespace in SUSv2.
@@ -229,7 +229,7 @@ union __semun {
 	unsigned short	*array;		/* array for GETALL & SETALL */
 };
 #include 
-#endif /* _KERNEL || _LIBC */
+#endif /* _KERNEL || _LIBC || _KMEMUSER */
 
 /*
  * These belong in unistd.h, but are placed here too to ensure that



CVS commit: src/sys/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:02:08 UTC 2017

Modified Files:
src/sys/sys: types.h

Log Message:
expose more for _KMEMUSER


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/sys/types.h

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



CVS commit: src/usr.bin/sockstat

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:01:48 UTC 2017

Modified Files:
src/usr.bin/sockstat: sockstat.c

Log Message:
don't do _KERNEL; hides bswap stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/sockstat/sockstat.c

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

Modified files:

Index: src/usr.bin/sockstat/sockstat.c
diff -u src/usr.bin/sockstat/sockstat.c:1.18 src/usr.bin/sockstat/sockstat.c:1.19
--- src/usr.bin/sockstat/sockstat.c:1.18	Thu Jan 12 13:52:15 2017
+++ src/usr.bin/sockstat/sockstat.c	Fri Jan 13 20:01:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockstat.c,v 1.18 2017/01/12 18:52:15 christos Exp $ */
+/*	$NetBSD: sockstat.c,v 1.19 2017/01/14 01:01:48 christos Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,12 +31,12 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: sockstat.c,v 1.18 2017/01/12 18:52:15 christos Exp $");
+__RCSID("$NetBSD: sockstat.c,v 1.19 2017/01/14 01:01:48 christos Exp $");
 #endif
 
-#define _KERNEL
+#define _KMEMUSER
 #include 
-#undef _KERNEL
+#undef _KMEMUSER
 #include 
 #include 
 #include 



CVS commit: src/usr.bin/sockstat

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 01:01:48 UTC 2017

Modified Files:
src/usr.bin/sockstat: sockstat.c

Log Message:
don't do _KERNEL; hides bswap stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/sockstat/sockstat.c

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



CVS commit: src/tests/lib/libc/regex

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:50:56 UTC 2017

Modified Files:
src/tests/lib/libc/regex: debug.c t_exhaust.c t_regex_att.c

Log Message:
PR/51832: Ngie Cooper:
- limit memory to 64M
- error msg fixes
- includes fixes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/regex/debug.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/regex/t_exhaust.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/regex/t_regex_att.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/libc/regex/debug.c
diff -u src/tests/lib/libc/regex/debug.c:1.2 src/tests/lib/libc/regex/debug.c:1.3
--- src/tests/lib/libc/regex/debug.c:1.2	Mon Oct 10 00:32:41 2011
+++ src/tests/lib/libc/regex/debug.c	Fri Jan 13 19:50:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.2 2011/10/10 04:32:41 christos Exp $	*/
+/*	$NetBSD: debug.c,v 1.3 2017/01/14 00:50:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -26,14 +26,15 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-
-#include 
+#include 
+#include 
 
 /* Don't sort these! */
 #include "utils.h"

Index: src/tests/lib/libc/regex/t_exhaust.c
diff -u src/tests/lib/libc/regex/t_exhaust.c:1.7 src/tests/lib/libc/regex/t_exhaust.c:1.8
--- src/tests/lib/libc/regex/t_exhaust.c:1.7	Wed Nov 16 13:37:31 2011
+++ src/tests/lib/libc/regex/t_exhaust.c	Fri Jan 13 19:50:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $	*/
+/*	$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,14 +37,15 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $");
+__RCSID("$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $");
 
-#include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include 
+#include 
 
 #ifndef REGEX_MAXSIZE
 #define REGEX_MAXSIZE	
@@ -176,14 +177,17 @@ ATF_TC_HEAD(regcomp_too_big, tc)
 	" crash, but return a proper error code");
 	// libtre needs it.
 	atf_tc_set_md_var(tc, "timeout", "600");
-	atf_tc_set_md_var(tc, "require.memory", "120M");
+	atf_tc_set_md_var(tc, "require.memory", "64M");
 }
 
 ATF_TC_BODY(regcomp_too_big, tc)
 {
 	regex_t re;
+	struct rlimit limit;
 	int e;
 
+	limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024;
+	ATF_REQUIRE(setrlimit(RLIMIT_VMEM, ) != -1);
 	for (size_t i = 0; i < __arraycount(tests); i++) {
 		char *d = (*tests[i].pattern)(REGEX_MAXSIZE);
 		e = regcomp(, d, tests[i].type);

Index: src/tests/lib/libc/regex/t_regex_att.c
diff -u src/tests/lib/libc/regex/t_regex_att.c:1.1 src/tests/lib/libc/regex/t_regex_att.c:1.2
--- src/tests/lib/libc/regex/t_regex_att.c:1.1	Fri Aug 24 16:24:40 2012
+++ src/tests/lib/libc/regex/t_regex_att.c	Fri Jan 13 19:50:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $	*/
+/*	$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $");
+__RCSID("$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $");
 
 #include 
 
@@ -374,7 +374,7 @@ checkmatches(const char *matches, size_t
 		" cur=%d, max=%zu", res, l, len - off);
 		off += l;
 	}
-	ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno);
+	ATF_CHECK_STREQ_MSG(res, matches, " at line %zu", lineno);
 	free(res);
 }
 



CVS commit: src/tests/lib/libc/regex

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:50:56 UTC 2017

Modified Files:
src/tests/lib/libc/regex: debug.c t_exhaust.c t_regex_att.c

Log Message:
PR/51832: Ngie Cooper:
- limit memory to 64M
- error msg fixes
- includes fixes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/regex/debug.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/regex/t_exhaust.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/regex/t_regex_att.c

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



CVS commit: src/sys/arch/alpha/include

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:35:37 UTC 2017

Modified Files:
src/sys/arch/alpha/include: intr.h

Log Message:
fix types.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/alpha/include/intr.h

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



CVS commit: src/sys/arch/alpha/include

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:35:37 UTC 2017

Modified Files:
src/sys/arch/alpha/include: intr.h

Log Message:
fix types.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/alpha/include/intr.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/arch/alpha/include/intr.h
diff -u src/sys/arch/alpha/include/intr.h:1.71 src/sys/arch/alpha/include/intr.h:1.72
--- src/sys/arch/alpha/include/intr.h:1.71	Mon May 19 18:47:53 2014
+++ src/sys/arch/alpha/include/intr.h	Fri Jan 13 19:35:37 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.71 2014/05/19 22:47:53 rmind Exp $ */
+/* $NetBSD: intr.h,v 1.72 2017/01/14 00:35:37 christos Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -147,7 +147,7 @@ static __inline int
 _splraise(int s)
 {
 	int cur = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK;
-	return (s > cur ? alpha_pal_swpipl(s) : cur);
+	return (s > cur ? (int)alpha_pal_swpipl(s) : cur);
 }
 
 #define	splraiseipl(icookie)	_splraise((icookie)._psl)



CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:33:19 UTC 2017

Modified Files:
src/tests: Makefile.inc

Log Message:
Do things in a less intrusive way.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/Makefile.inc

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

Modified files:

Index: src/tests/Makefile.inc
diff -u src/tests/Makefile.inc:1.3 src/tests/Makefile.inc:1.4
--- src/tests/Makefile.inc:1.3	Fri Jan 13 16:30:39 2017
+++ src/tests/Makefile.inc	Fri Jan 13 19:33:19 2017
@@ -1,4 +1,5 @@
-# $NetBSD: Makefile.inc,v 1.3 2017/01/13 21:30:39 christos Exp $
+# $NetBSD: Makefile.inc,v 1.4 2017/01/14 00:33:19 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
-CPPFLAGS:= ${CPPFLAGS} -I${.PARSEDIR}
+TOPSRCDIR:= ${.PARSEDIR}
+CPPFLAGS+= -I${TOPSRCDIR}



CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 00:33:19 UTC 2017

Modified Files:
src/tests: Makefile.inc

Log Message:
Do things in a less intrusive way.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/Makefile.inc

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Sat Jan 14 00:20:16 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
handle 8bit pixmaps in CG14PrepareCopy(), now the glyph cache works properly


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Sat Jan 14 00:20:16 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
handle 8bit pixmaps in CG14PrepareCopy(), now the glyph cache works properly


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.10 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.11
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.10	Fri Jan 13 20:58:40 2017
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Sat Jan 14 00:20:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.10 2017/01/13 20:58:40 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.11 2017/01/14 00:20:16 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -63,6 +63,9 @@ int src_formats[] = {PICT_a8r8g8b8, PICT
 		 PICT_a8b8g8r8, PICT_x8b8g8r8, PICT_a8};
 int tex_formats[] = {PICT_a8r8g8b8, PICT_a8b8g8r8, PICT_a8};
 
+static void CG14Copy32(PixmapPtr, int, int, int, int, int, int);
+static void CG14Copy8(PixmapPtr, int, int, int, int, int, int);
+
 static inline void
 CG14Wait(Cg14Ptr p)
 {
@@ -101,6 +104,17 @@ CG14PrepareCopy(PixmapPtr pSrcPixmap, Pi
 		write_sx_reg(p, SX_ROP_CONTROL, alu);
 		p->last_rop = alu;
 	}
+	switch (pSrcPixmap->drawable.bitsPerPixel)  {
+		case 8:
+			p->pExa->Copy = CG14Copy8;
+			break;
+		case 32:
+			p->pExa->Copy = CG14Copy32;
+			break;
+		default:
+			xf86Msg(X_ERROR, "%s depth %d\n", __func__,
+			pSrcPixmap->drawable.bitsPerPixel);
+	}
 	p->srcpitch = exaGetPixmapPitch(pSrcPixmap);
 	p->srcoff = exaGetPixmapOffset(pSrcPixmap);
 	p->xdir = xdir;
@@ -109,7 +123,7 @@ CG14PrepareCopy(PixmapPtr pSrcPixmap, Pi
 }
 
 static void
-CG14Copy(PixmapPtr pDstPixmap,
+CG14Copy32(PixmapPtr pDstPixmap,
  int srcX, int srcY, int dstX, int dstY, int w, int h)
 {
 	ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
@@ -284,6 +298,181 @@ CG14Copy(PixmapPtr pDstPixmap,
 }
 
 static void
+CG14Copy8(PixmapPtr pDstPixmap,
+ int srcX, int srcY, int dstX, int dstY, int w, int h)
+{
+	ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+	Cg14Ptr p = GET_CG14_FROM_SCRN(pScrn);
+	int dstpitch, dstoff, srcpitch, srcoff;
+	int srcstart, dststart, xinc, srcinc, dstinc;
+	int line, count, s, d, num;
+
+	ENTER;
+	dstpitch = exaGetPixmapPitch(pDstPixmap);
+	dstoff = exaGetPixmapOffset(pDstPixmap);
+	srcpitch = p->srcpitch;
+	srcoff = p->srcoff;
+	/*
+	 * should clear the WO bit in SX_CONTROL_STATUS, then check if SX
+	 * actually wrote anything and only sync if it did
+	 */
+	srcstart = srcX + (srcpitch * srcY) + srcoff;
+	dststart = dstX + (dstpitch * dstY) + dstoff;
+
+	/*
+	 * we always copy up to 32 pixels at a time so direction doesn't
+	 * matter if w<=32
+	 */
+	if (w > 32) {
+		if (p->xdir < 0) {
+			srcstart += (w - 32);
+			dststart += (w - 32);
+			xinc = -32;
+		} else
+			xinc = 32;
+	} else
+		xinc = 32;
+	if (p->ydir < 0) {
+		srcstart += (h - 1) * srcpitch;
+		dststart += (h - 1) * dstpitch;
+		srcinc = -srcpitch;
+		dstinc = -dstpitch;
+	} else {
+		srcinc = srcpitch;
+		dstinc = dstpitch;
+	}
+	if (p->last_rop == 0xcc) {
+		/* plain old copy */
+		if ( xinc > 0) {
+			/* going left to right */
+			for (line = 0; line < h; line++) {
+count = 0;
+s = srcstart;
+d = dststart;
+while ( count < w) {
+	num = min(32, w - count);
+	write_sx_io(p, s,
+	SX_LDB(10, num - 1, s & 7));
+	write_sx_io(p, d,
+	SX_STBM(10, num - 1, d & 7));
+	s += xinc;
+	d += xinc;
+	count += 32;
+}
+srcstart += srcinc;
+dststart += dstinc;
+			}
+		} else {
+			/* going right to left */
+			int i, chunks = (w >> 5);
+			for (line = 0; line < h; line++) {
+s = srcstart;
+d = dststart;
+count = w;
+for (i = 0; i < chunks; i++) {
+	write_sx_io(p, s,
+	SX_LDB(10, 31, s & 7));
+	write_sx_io(p, d,
+	SX_STBM(10, 31, d & 7));
+	s -= 32;
+	d -= 32;
+	count -= 32;
+}
+/* leftovers, if any */
+if (count > 0) {
+	s += (32 - count);
+	d += (32 - count);
+	write_sx_io(p, s,
+	SX_LDB(10, count - 1, s & 7));
+	write_sx_io(p, d,
+	SX_STBM(10, count - 1, d & 7));
+}
+srcstart += srcinc;
+dststart += dstinc;
+			}
+		}
+	} else {
+		/* ROPs needed */
+		if ( xinc > 0) {
+			/* going left to right */
+			for (line = 0; line < h; line++) {
+count = 0;
+s = srcstart;
+d = dststart;
+while ( count < w) {
+	num = min(32, w - count);
+	write_sx_io(p, s,
+	SX_LDB(10, num - 1, s & 7));
+	write_sx_io(p, d,
+	   

CVS commit: src/lib/libc/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 00:02:40 UTC 2017

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

Log Message:
Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)

PTRACE_VFORK - report vfork(2)-like operations and trace child
PTRACE_VFORK_DONE - report unblocking the parent after vfork(2)-like call

Note that PTRACE_VFORK is currently unimplemented and returns ENOTSUP.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/sys/ptrace.2

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



CVS commit: src/lib/libc/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 14 00:02:40 UTC 2017

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

Log Message:
Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)

PTRACE_VFORK - report vfork(2)-like operations and trace child
PTRACE_VFORK_DONE - report unblocking the parent after vfork(2)-like call

Note that PTRACE_VFORK is currently unimplemented and returns ENOTSUP.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/sys/ptrace.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/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.52 src/lib/libc/sys/ptrace.2:1.53
--- src/lib/libc/sys/ptrace.2:1.52	Wed Jan 11 07:32:36 2017
+++ src/lib/libc/sys/ptrace.2	Sat Jan 14 00:02:40 2017
@@ -1,7 +1,7 @@
-.\"	$NetBSD: ptrace.2,v 1.52 2017/01/11 07:32:36 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.53 2017/01/14 00:02:40 kamil Exp $
 .\"
 .\" This file is in the public domain.
-.Dd January 11, 2016
+.Dd January 13, 2016
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -379,11 +379,19 @@ This set is formed by OR'ing together th
 .It PTRACE_FORK
 Report
 .Xr fork 2 .
+.It PTRACE_VFORK
+Report
+.Xr vfork 2 .
+.It PTRACE_VFORK_DONE
+Report parent resumed after
+.Xr vfork 2 .
 .El
 .Pp
 The
 .Xr fork 2
-event can occur with similar operations,
+and
+.Xr vfork 2
+events can occur with similar operations,
 like
 .Xr clone 2
 or
@@ -391,12 +399,22 @@ or
 The
 .Dv PTRACE_FORK
 value means that process gives birth to its child
-without pending on its termination.
+without pending on its termination or
+.Xr execve 2
+operation.
 If enabled,
 the child is also traced by the debugger and
 .Dv SIGRAP
 is generated twice,
 first for the parent and second for the child.
+The
+.Dv PTRACE_VFORK
+is the same like
+.Dv PTRACE_FORK ,
+but the parent blocks after giving birth to the child.
+The
+.Dv PTRACE_VFORK_DONE
+event can be used to report unblocking of the parent.
 .Pp
 A pointer to this structure is passed in
 .Fa addr .
@@ -698,3 +716,7 @@ to
 .Fn ptrace
 .Ec ,
 should be able to sidestep this.
+.Pp
+.Dv PTRACE_VFORK
+is currently unimplemented and it will return
+.Dv ENOTSUP .



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:29:10 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
Add new entry for ptrace(2)

Added:
  ptrace(2): Add new options in EVENT_MASK: PTRACE_VFORK and
PTRACE_VFORK_DONE


To generate a diff of this commit:
cvs rdiff -u -r1.2235 -r1.2236 src/doc/CHANGES

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



CVS commit: src/doc

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:29:10 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
Add new entry for ptrace(2)

Added:
  ptrace(2): Add new options in EVENT_MASK: PTRACE_VFORK and
PTRACE_VFORK_DONE


To generate a diff of this commit:
cvs rdiff -u -r1.2235 -r1.2236 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2235 src/doc/CHANGES:1.2236
--- src/doc/CHANGES:1.2235	Tue Jan 10 01:53:25 2017
+++ src/doc/CHANGES	Fri Jan 13 23:29:10 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2235 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2236 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -447,3 +447,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	nsd(8): Add the NSD Authoritative DNS server [christos 20170107]
 	zlib(3): Import 1.2.10 [christos 20170109]
 	ptrace(2): Add new si_code value of SIGTRAP: TRAP_CHLD [kamil 20170110]
+	ptrace(2): Add new options in EVENT_MASK: PTRACE_VFORK and
+		PTRACE_VFORK_DONE [kamil 20170113]



CVS commit: src/tests/kernel

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:22:12 UTC 2017

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

Log Message:
Update t_ptrace_wait* tests for added support for PTRACE_VFORK{,_DONE}

PTRACE_VFORK and PTRACE_VFORK_DONE are now parts of .

PTRACE_VFORK tests are still failing as the support for it is currently
a stub.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 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.56 src/tests/kernel/t_ptrace_wait.c:1.57
--- src/tests/kernel/t_ptrace_wait.c:1.56	Fri Jan 13 21:30:41 2017
+++ src/tests/kernel/t_ptrace_wait.c	Fri Jan 13 23:22:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.56 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.57 2017/01/13 23:22:12 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.56 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.57 2017/01/13 23:22:12 kamil Exp $");
 
 #include 
 #include 
@@ -65,18 +65,6 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.56
 #define PARENT_FROM_CHILD(info, fds, msg) \
 ATF_REQUIRE(msg_read_child(info " from parent " # fds, , , sizeof(msg)) == 0)
 
-/*
- * ptrace(2) command PT_SET_EVENT_MASK: option PTRACE_VFORK unsupported
- */
-#ifndef PTRACE_VFORK
-#define PTRACE_VFORK 0
-#endif
-/*
- * ptrace(2) command PT_SET_EVENT_MASK: option PTRACE_VFORK_DONE unsupported
- */
-#ifndef PTRACE_VFORK_DONE
-#define PTRACE_VFORK_DONE 0
-#endif
 
 ATF_TC(traceme1);
 ATF_TC_HEAD(traceme1, tc)



CVS commit: src/tests/kernel

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:22:12 UTC 2017

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

Log Message:
Update t_ptrace_wait* tests for added support for PTRACE_VFORK{,_DONE}

PTRACE_VFORK and PTRACE_VFORK_DONE are now parts of .

PTRACE_VFORK tests are still failing as the support for it is currently
a stub.

Sponsored by 


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



CVS commit: src/sys/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:05:24 UTC 2017

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to NetBSD 7.99.59 - PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.525 -r1.526 src/sys/sys/param.h

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



CVS commit: src/sys/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:05:24 UTC 2017

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to NetBSD 7.99.59 - PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.525 -r1.526 src/sys/sys/param.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/sys/param.h
diff -u src/sys/sys/param.h:1.525 src/sys/sys/param.h:1.526
--- src/sys/sys/param.h:1.525	Wed Jan 11 09:09:42 2017
+++ src/sys/sys/param.h	Fri Jan 13 23:05:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.525 2017/01/11 09:09:42 hannken Exp $	*/
+/*	$NetBSD: param.h,v 1.526 2017/01/13 23:05:24 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799005800	/* NetBSD 7.99.58 */
+#define	__NetBSD_Version__	799005900	/* NetBSD 7.99.59 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:00:35 UTC 2017

Modified Files:
src/sys/kern: kern_fork.c sys_ptrace_common.c
src/sys/sys: proc.h ptrace.h

Log Message:
Add support for PTRACE_VFORK_DONE and stub for PTRACE_VFORK in ptrace(2)

PTRACE_VFORK is supposed to be used to track vfork(2)-like events, when
parent gives birth to new process child and stops till it exits or calls
exec().
Currently PTRACE_VFORK is a stub.

PTRACE_VFORK_DONE is notification to notify a debugger that a parent has
resumed after vfork(2)-like action.
PTRACE_VFORK_DONE throws SIGTRAP with TRAP_CHLD.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.335 -r1.336 src/sys/sys/proc.h
cvs rdiff -u -r1.52 -r1.53 src/sys/sys/ptrace.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/kern/kern_fork.c
diff -u src/sys/kern/kern_fork.c:1.198 src/sys/kern/kern_fork.c:1.199
--- src/sys/kern/kern_fork.c:1.198	Tue Jan 10 00:48:37 2017
+++ src/sys/kern/kern_fork.c	Fri Jan 13 23:00:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_fork.c,v 1.198 2017/01/10 00:48:37 kamil Exp $	*/
+/*	$NetBSD: kern_fork.c,v 1.199 2017/01/13 23:00:35 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.198 2017/01/10 00:48:37 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.199 2017/01/13 23:00:35 kamil Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -219,7 +219,7 @@ fork1(struct lwp *l1, int flags, int exi
 	int		count;
 	vaddr_t		uaddr;
 	int		tnprocs;
-	int		tracefork;
+	int		tracefork, tracevforkdone;
 	int		error = 0;
 
 	p1 = l1->l_proc;
@@ -471,11 +471,12 @@ fork1(struct lwp *l1, int flags, int exi
 	p2->p_exitsig = exitsig;		/* signal for parent on exit */
 
 	/*
-	 * We don't want to tracefork vfork()ed processes because they
-	 * will not receive the SIGTRAP until it is too late.
+	 * Trace fork(2) and vfork(2)-like events on demand in a debugger.
 	 */
 	tracefork = (p1->p_slflag & (PSL_TRACEFORK|PSL_TRACED)) ==
 	(PSL_TRACEFORK|PSL_TRACED) && (flags && FORK_PPWAIT) == 0;
+	tracevforkdone = (p1->p_slflag & (PSL_TRACEVFORK_DONE|PSL_TRACED)) ==
+	(PSL_TRACEVFORK_DONE|PSL_TRACED) && (flags && FORK_PPWAIT);
 	if (tracefork) {
 		proc_changeparent(p2, p1->p_pptr);
 		/*
@@ -484,6 +485,12 @@ fork1(struct lwp *l1, int flags, int exi
 		p1->p_fpid = p2->p_pid;
 		p2->p_fpid = p1->p_pid;
 	}
+	if (tracevforkdone) {
+		/*
+		 * Set ptrace status.
+		 */
+		p1->p_vfpid_done = p2->p_pid;
+	}
 
 	LIST_INSERT_AFTER(p1, p2, p_pglist);
 	LIST_INSERT_HEAD(, p2, p_list);
@@ -576,7 +583,7 @@ fork1(struct lwp *l1, int flags, int exi
 	/*
 	 * Let the parent know that we are tracing its child.
 	 */
-	if (tracefork) {
+	if (tracefork || tracevforkdone) {
 		ksiginfo_t ksi;
 
 		KSI_INIT_EMPTY();

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.8 src/sys/kern/sys_ptrace_common.c:1.9
--- src/sys/kern/sys_ptrace_common.c:1.8	Fri Jan  6 22:53:17 2017
+++ src/sys/kern/sys_ptrace_common.c	Fri Jan 13 23:00:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.8 2017/01/06 22:53:17 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.9 2017/01/13 23:00:35 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.8 2017/01/06 22:53:17 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.9 2017/01/13 23:00:35 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -790,6 +790,8 @@ do_ptrace(struct ptrace_methods *ptm, st
 		}
 	sendsig:
 		t->p_fpid = 0;
+		t->p_vfpid = 0;
+		t->p_vfpid_done = 0;
 		/* Finally, deliver the requested signal (or none). */
 		if (t->p_stat == SSTOP) {
 			/*
@@ -855,6 +857,10 @@ do_ptrace(struct ptrace_methods *ptm, st
 		memset(, 0, sizeof(pe));
 		pe.pe_set_event = ISSET(t->p_slflag, PSL_TRACEFORK) ?
 		PTRACE_FORK : 0;
+		pe.pe_set_event |= ISSET(t->p_slflag, PSL_TRACEVFORK) ?
+		PTRACE_VFORK : 0;
+		pe.pe_set_event |= ISSET(t->p_slflag, PSL_TRACEVFORK_DONE) ?
+		PTRACE_VFORK_DONE : 0;
 		error = copyout(, addr, sizeof(pe));
 		break;
 
@@ -871,6 +877,21 @@ do_ptrace(struct ptrace_methods *ptm, st
 			SET(t->p_slflag, PSL_TRACEFORK);
 		else
 			CLR(t->p_slflag, PSL_TRACEFORK);
+#if notyet
+		if (pe.pe_set_event & PTRACE_VFORK)
+			SET(t->p_slflag, PSL_TRACEVFORK);
+		else
+			CLR(t->p_slflag, PSL_TRACEVFORK);
+#else
+		if (pe.pe_set_event & PTRACE_VFORK) {
+			error = ENOTSUP;
+			break;
+		}
+#endif
+		if (pe.pe_set_event & PTRACE_VFORK_DONE)
+			SET(t->p_slflag, PSL_TRACEVFORK_DONE);
+		else
+			CLR(t->p_slflag, PSL_TRACEVFORK_DONE);
 		

CVS commit: src/sys

2017-01-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan 13 23:00:35 UTC 2017

Modified Files:
src/sys/kern: kern_fork.c sys_ptrace_common.c
src/sys/sys: proc.h ptrace.h

Log Message:
Add support for PTRACE_VFORK_DONE and stub for PTRACE_VFORK in ptrace(2)

PTRACE_VFORK is supposed to be used to track vfork(2)-like events, when
parent gives birth to new process child and stops till it exits or calls
exec().
Currently PTRACE_VFORK is a stub.

PTRACE_VFORK_DONE is notification to notify a debugger that a parent has
resumed after vfork(2)-like action.
PTRACE_VFORK_DONE throws SIGTRAP with TRAP_CHLD.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.335 -r1.336 src/sys/sys/proc.h
cvs rdiff -u -r1.52 -r1.53 src/sys/sys/ptrace.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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:46:44 UTC 2017

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

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/linux/common/linux_file64.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_file64.c
diff -u src/sys/compat/linux/common/linux_file64.c:1.56 src/sys/compat/linux/common/linux_file64.c:1.57
--- src/sys/compat/linux/common/linux_file64.c:1.56	Fri Jan 13 16:02:05 2017
+++ src/sys/compat/linux/common/linux_file64.c	Fri Jan 13 17:46:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file64.c,v 1.56 2017/01/13 21:02:05 christos Exp $	*/
+/*	$NetBSD: linux_file64.c,v 1.57 2017/01/13 22:46:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.56 2017/01/13 21:02:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.57 2017/01/13 22:46:43 christos Exp $");
 
 #include 
 #include 
@@ -355,7 +355,7 @@ again:
 		idb.d_off = off;
 		idb.d_reclen = (u_short)linux_reclen;
 		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		   bdp.d_namlen);
+		   bdp->d_namlen));
 		if ((error = copyout((void *), outp, linux_reclen)))
 			goto out;
 		/* advance past this real entry */



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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:46:44 UTC 2017

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

Log Message:
fix typo


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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:45:15 UTC 2017

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

Log Message:
no namlen on linux


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

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



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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:45:15 UTC 2017

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

Log Message:
no namlen on linux


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

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

Modified files:

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.235 src/sys/compat/linux/common/linux_misc.c:1.236
--- src/sys/compat/linux/common/linux_misc.c:1.235	Fri Jan 13 15:24:37 2017
+++ src/sys/compat/linux/common/linux_misc.c	Fri Jan 13 17:45:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.235 2017/01/13 20:24:37 christos Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.236 2017/01/13 22:45:15 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.235 2017/01/13 20:24:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.236 2017/01/13 22:45:15 christos Exp $");
 
 #include 
 #include 
@@ -788,7 +788,7 @@ again:
 			*((char *) + idb.d_reclen - 1) = bdp->d_type;
 		}
 		memcpy(idb.d_name, bdp->d_name,
-		MIN(sizeof(idb.d_name), idb.d_namlen));
+		MIN(sizeof(idb.d_name), bdp->d_namlen));
 		if ((error = copyout((void *), outp, linux_reclen)))
 			goto out;
 		/* advance past this real entry */



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:29:59 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_12.c

Log Message:
use bdp, to avoid compiler warning.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/common/vfs_syscalls_12.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/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.32 src/sys/compat/common/vfs_syscalls_12.c:1.33
--- src/sys/compat/common/vfs_syscalls_12.c:1.32	Fri Jan 13 15:58:59 2017
+++ src/sys/compat/common/vfs_syscalls_12.c	Fri Jan 13 17:29:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.32 2017/01/13 20:58:59 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.33 2017/01/13 22:29:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.32 2017/01/13 20:58:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.33 2017/01/13 22:29:59 christos Exp $");
 
 #include 
 #include 
@@ -197,7 +197,7 @@ again:
 		idb.d_type = (uint8_t)bdp->d_type;
 		idb.d_namlen = (uint8_t)bdp->d_namlen;
 		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		idb.d_namlen));
+		bdp->d_namlen));
 		if ((error = copyout(, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 22:29:59 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_12.c

Log Message:
use bdp, to avoid compiler warning.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/common/vfs_syscalls_12.c

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



CVS commit: src/sys/arch/sparc/dev

2017-01-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jan 13 21:49:46 UTC 2017

Modified Files:
src/sys/arch/sparc/dev: sxreg.h

Log Message:
add SX_STBM ( STore Byte Masked ) instruction


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/dev/sxreg.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/arch/sparc/dev/sxreg.h
diff -u src/sys/arch/sparc/dev/sxreg.h:1.12 src/sys/arch/sparc/dev/sxreg.h:1.13
--- src/sys/arch/sparc/dev/sxreg.h:1.12	Sat Apr 30 05:22:19 2016
+++ src/sys/arch/sparc/dev/sxreg.h	Fri Jan 13 21:49:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sxreg.h,v 1.12 2016/04/30 05:22:19 macallan Exp $	*/
+/*	$NetBSD: sxreg.h,v 1.13 2017/01/13 21:49:46 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -164,6 +164,8 @@
 SX_LONG | (sreg << 7) | (o))
 #define SX_STB(sreg, cnt, o) (0x8000 | ((cnt) << 23) | SX_STORE | \
 SX_UBYTE_0 | (sreg << 7) | (o))
+#define SX_STBM(sreg, cnt, o) (0x8000 | ((cnt) << 23) | SX_STORE_MASK | \
+SX_UBYTE_0 | (sreg << 7) | (o))
 #define SX_STBC(sreg, cnt, o) (0x8000 | ((cnt) << 23) | SX_STORE_CLAMP | \
 SX_UBYTE_0 | (sreg << 7) | (o))
 #define SX_STP(sreg, cnt, o) (0x8000 | ((cnt) << 23) | SX_STORE | \



CVS commit: src/sys/arch/sparc/dev

2017-01-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jan 13 21:49:46 UTC 2017

Modified Files:
src/sys/arch/sparc/dev: sxreg.h

Log Message:
add SX_STBM ( STore Byte Masked ) instruction


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/dev/sxreg.h

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



CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:30:43 UTC 2017

Modified Files:
src/tests: Makefile.inc
src/tests/dev/cgd: t_cgd_3des.c t_cgd_aes.c t_cgd_blowfish.c
src/tests/dev/clock_subr: t_clock_subr.c
src/tests/dev/scsipi: t_cd.c
src/tests/dev/sysmon: t_swwdog.c
src/tests/fs/common: h_fsmacros.h
src/tests/fs/ffs: h_quota2_tests.c t_fifos.c t_mount.c t_quota2_1.c
t_quota2_remount.c t_snapshot.c t_snapshot_log.c t_snapshot_v2.c
src/tests/fs/hfs: t_pathconvert.c
src/tests/fs/kernfs: t_basic.c
src/tests/fs/lfs: t_pr.c
src/tests/fs/msdosfs: t_snapshot.c
src/tests/fs/nfs: t_mountd.c
src/tests/fs/nullfs: t_basic.c
src/tests/fs/ptyfs: t_nullpts.c t_ptyfs.c
src/tests/fs/puffs: t_basic.c t_fuzz.c t_io.c
src/tests/fs/tmpfs: t_renamerace.c
src/tests/fs/umapfs: t_basic.c
src/tests/fs/union: t_pr.c
src/tests/fs/vfs: t_full.c t_io.c t_renamerace.c t_ro.c t_union.c
t_unpriv.c t_vfsops.c t_vnops.c
src/tests/include/sys: t_socket.c
src/tests/kernel: t_extent.c t_filedesc.c t_lock.c t_ptrace.c
t_ptrace_wait.c t_pty.c t_rnd.c
src/tests/kernel/arch/amd64: t_ptrace_wait.c
src/tests/kernel/arch/i386: t_ptrace_wait.c
src/tests/kernel/kqueue: t_ioctl.c t_proc1.c t_proc2.c t_proc3.c
t_sig.c
src/tests/kernel/kqueue/read: t_fifo.c t_file.c t_file2.c t_pipe.c
t_ttypty.c
src/tests/kernel/kqueue/write: t_fifo.c t_pipe.c t_ttypty.c
src/tests/lib/libc/gen: t_glob.c
src/tests/lib/libc/sys: t_clock_gettime.c t_pipe.c t_posix_fadvise.c
t_sigaction.c
src/tests/lib/libposix: t_rename.c
src/tests/lib/librefuse: t_refuse_opt.c
src/tests/lib/librumpclient: t_fd.c
src/tests/lib/semaphore: sem.c
src/tests/libexec/ld.elf_so: t_dlerror-cleared.c t_dlerror-false.c
t_dlinfo.c t_ifunc.c
src/tests/modules: t_builtin.c
src/tests/net/bpf: t_bpf.c t_mbuf.c
src/tests/net/bpfilter: t_bpfilter.c
src/tests/net/bpfjit: t_bpfjit.c t_cop.c t_extmem.c t_mbuf.c
src/tests/net/carp: t_basic.c
src/tests/net/config: netconfig.c
src/tests/net/icmp: t_forward.c t_ping.c
src/tests/net/if_loop: t_pr.c
src/tests/net/net: t_raw.c
src/tests/rump/modautoload: t_modautoload.c
src/tests/rump/rumpkern: t_kern.c t_lwproc.c t_modcmd.c t_modlinkset.c
t_signals.c t_threads.c t_tsleep.c t_vm.c
src/tests/rump/rumpvfs: t_basic.c t_etfs.c t_p2kifs.c
Added Files:
src/tests/dev: Makefile.inc

Log Message:
Don't play with "../.." in includes for h_macros.h; deal with it centrally.
Minor fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/Makefile.inc
cvs rdiff -u -r0 -r1.4 src/tests/dev/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/cgd/t_cgd_3des.c \
src/tests/dev/cgd/t_cgd_blowfish.c
cvs rdiff -u -r1.5 -r1.6 src/tests/dev/cgd/t_cgd_aes.c
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/clock_subr/t_clock_subr.c
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/scsipi/t_cd.c
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/sysmon/t_swwdog.c
cvs rdiff -u -r1.40 -r1.41 src/tests/fs/common/h_fsmacros.h
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/ffs/h_quota2_tests.c \
src/tests/fs/ffs/t_quota2_1.c src/tests/fs/ffs/t_quota2_remount.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/ffs/t_fifos.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/ffs/t_mount.c
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/ffs/t_snapshot.c
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/t_snapshot_log.c \
src/tests/fs/ffs/t_snapshot_v2.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/hfs/t_pathconvert.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/kernfs/t_basic.c
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/lfs/t_pr.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/msdosfs/t_snapshot.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/nfs/t_mountd.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/nullfs/t_basic.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/ptyfs/t_nullpts.c
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/ptyfs/t_ptyfs.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/puffs/t_basic.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/puffs/t_fuzz.c
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/puffs/t_io.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/tmpfs/t_renamerace.c
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/umapfs/t_basic.c
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/union/t_pr.c
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/vfs/t_full.c src/tests/fs/vfs/t_union.c
cvs rdiff -u -r1.16 -r1.17 src/tests/fs/vfs/t_io.c
cvs rdiff -u -r1.33 -r1.34 src/tests/fs/vfs/t_renamerace.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/vfs/t_ro.c
cvs rdiff -u -r1.12 -r1.13 src/tests/fs/vfs/t_unpriv.c
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/vfs/t_vfsops.c
cvs rdiff -u -r1.58 -r1.59 src/tests/fs/vfs/t_vnops.c
cvs rdiff -u -r1.4 -r1.5 src/tests/include/sys/t_socket.c
cvs rdiff -u 

CVS commit: src/tests

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:30:43 UTC 2017

Modified Files:
src/tests: Makefile.inc
src/tests/dev/cgd: t_cgd_3des.c t_cgd_aes.c t_cgd_blowfish.c
src/tests/dev/clock_subr: t_clock_subr.c
src/tests/dev/scsipi: t_cd.c
src/tests/dev/sysmon: t_swwdog.c
src/tests/fs/common: h_fsmacros.h
src/tests/fs/ffs: h_quota2_tests.c t_fifos.c t_mount.c t_quota2_1.c
t_quota2_remount.c t_snapshot.c t_snapshot_log.c t_snapshot_v2.c
src/tests/fs/hfs: t_pathconvert.c
src/tests/fs/kernfs: t_basic.c
src/tests/fs/lfs: t_pr.c
src/tests/fs/msdosfs: t_snapshot.c
src/tests/fs/nfs: t_mountd.c
src/tests/fs/nullfs: t_basic.c
src/tests/fs/ptyfs: t_nullpts.c t_ptyfs.c
src/tests/fs/puffs: t_basic.c t_fuzz.c t_io.c
src/tests/fs/tmpfs: t_renamerace.c
src/tests/fs/umapfs: t_basic.c
src/tests/fs/union: t_pr.c
src/tests/fs/vfs: t_full.c t_io.c t_renamerace.c t_ro.c t_union.c
t_unpriv.c t_vfsops.c t_vnops.c
src/tests/include/sys: t_socket.c
src/tests/kernel: t_extent.c t_filedesc.c t_lock.c t_ptrace.c
t_ptrace_wait.c t_pty.c t_rnd.c
src/tests/kernel/arch/amd64: t_ptrace_wait.c
src/tests/kernel/arch/i386: t_ptrace_wait.c
src/tests/kernel/kqueue: t_ioctl.c t_proc1.c t_proc2.c t_proc3.c
t_sig.c
src/tests/kernel/kqueue/read: t_fifo.c t_file.c t_file2.c t_pipe.c
t_ttypty.c
src/tests/kernel/kqueue/write: t_fifo.c t_pipe.c t_ttypty.c
src/tests/lib/libc/gen: t_glob.c
src/tests/lib/libc/sys: t_clock_gettime.c t_pipe.c t_posix_fadvise.c
t_sigaction.c
src/tests/lib/libposix: t_rename.c
src/tests/lib/librefuse: t_refuse_opt.c
src/tests/lib/librumpclient: t_fd.c
src/tests/lib/semaphore: sem.c
src/tests/libexec/ld.elf_so: t_dlerror-cleared.c t_dlerror-false.c
t_dlinfo.c t_ifunc.c
src/tests/modules: t_builtin.c
src/tests/net/bpf: t_bpf.c t_mbuf.c
src/tests/net/bpfilter: t_bpfilter.c
src/tests/net/bpfjit: t_bpfjit.c t_cop.c t_extmem.c t_mbuf.c
src/tests/net/carp: t_basic.c
src/tests/net/config: netconfig.c
src/tests/net/icmp: t_forward.c t_ping.c
src/tests/net/if_loop: t_pr.c
src/tests/net/net: t_raw.c
src/tests/rump/modautoload: t_modautoload.c
src/tests/rump/rumpkern: t_kern.c t_lwproc.c t_modcmd.c t_modlinkset.c
t_signals.c t_threads.c t_tsleep.c t_vm.c
src/tests/rump/rumpvfs: t_basic.c t_etfs.c t_p2kifs.c
Added Files:
src/tests/dev: Makefile.inc

Log Message:
Don't play with "../.." in includes for h_macros.h; deal with it centrally.
Minor fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/Makefile.inc
cvs rdiff -u -r0 -r1.4 src/tests/dev/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/cgd/t_cgd_3des.c \
src/tests/dev/cgd/t_cgd_blowfish.c
cvs rdiff -u -r1.5 -r1.6 src/tests/dev/cgd/t_cgd_aes.c
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/clock_subr/t_clock_subr.c
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/scsipi/t_cd.c
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/sysmon/t_swwdog.c
cvs rdiff -u -r1.40 -r1.41 src/tests/fs/common/h_fsmacros.h
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/ffs/h_quota2_tests.c \
src/tests/fs/ffs/t_quota2_1.c src/tests/fs/ffs/t_quota2_remount.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/ffs/t_fifos.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/ffs/t_mount.c
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/ffs/t_snapshot.c
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/t_snapshot_log.c \
src/tests/fs/ffs/t_snapshot_v2.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/hfs/t_pathconvert.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/kernfs/t_basic.c
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/lfs/t_pr.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/msdosfs/t_snapshot.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/nfs/t_mountd.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/nullfs/t_basic.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/ptyfs/t_nullpts.c
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/ptyfs/t_ptyfs.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/puffs/t_basic.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/puffs/t_fuzz.c
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/puffs/t_io.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/tmpfs/t_renamerace.c
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/umapfs/t_basic.c
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/union/t_pr.c
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/vfs/t_full.c src/tests/fs/vfs/t_union.c
cvs rdiff -u -r1.16 -r1.17 src/tests/fs/vfs/t_io.c
cvs rdiff -u -r1.33 -r1.34 src/tests/fs/vfs/t_renamerace.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/vfs/t_ro.c
cvs rdiff -u -r1.12 -r1.13 src/tests/fs/vfs/t_unpriv.c
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/vfs/t_vfsops.c
cvs rdiff -u -r1.58 -r1.59 src/tests/fs/vfs/t_vnops.c
cvs rdiff -u -r1.4 -r1.5 src/tests/include/sys/t_socket.c
cvs rdiff -u 

CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:19:45 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
PR/51859: Ngie Cooper: use closefrom/restore RLIMIT_NOFILE when done


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_pipe2.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/libc/sys/t_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.8 src/tests/lib/libc/sys/t_pipe2.c:1.9
--- src/tests/lib/libc/sys/t_pipe2.c:1.8	Wed May 16 09:54:28 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Fri Jan 13 16:19:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.9 2017/01/13 21:19:45 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $");
+__RCSID("$NetBSD: t_pipe2.c,v 1.9 2017/01/13 21:19:45 christos Exp $");
 
 #include 
 #include 
@@ -53,7 +53,8 @@ run(int flags)
 	while ((i = open("/", O_RDONLY)) < 3)
 		ATF_REQUIRE(i != -1);
 
-	ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
+	ATF_REQUIRE_MSG(closefrom(3) != -1, "closefrom failed: %s",
+	strerror(errno));
 
 	ATF_REQUIRE(pipe2(fd, flags) == 0);
 
@@ -110,9 +111,10 @@ ATF_TC_BODY(pipe2_consume, tc)
 {
 	struct rlimit rl;
 	int err, filedes[2];
+	int old;
 
-	err = fcntl(4, F_CLOSEM);
-	ATF_REQUIRE(err == 0);
+	ATF_REQUIRE_MSG(closefrom(4) != -1, "closefrom failed: %s",
+	strerror(errno));
 
 	err = getrlimit(RLIMIT_NOFILE, );
 	ATF_REQUIRE(err == 0);
@@ -121,12 +123,15 @@ ATF_TC_BODY(pipe2_consume, tc)
 	 * file descriptor limit in the middle of a pipe2() call - i.e.
 	 * before the call only a single descriptor may be openend.
 	 */
+	old = rl.rlim_cur;
 	rl.rlim_cur = 4;
 	err = setrlimit(RLIMIT_NOFILE, );
 	ATF_REQUIRE(err == 0);
 
 	err = pipe2(filedes, O_CLOEXEC);
 	ATF_REQUIRE(err == -1);
+	rl.rlim_cur = old;
+	err = setrlimit(RLIMIT_NOFILE, );
 }
 
 ATF_TC(pipe2_nonblock);



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:19:45 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
PR/51859: Ngie Cooper: use closefrom/restore RLIMIT_NOFILE when done


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_pipe2.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:18:33 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_select.c

Log Message:
PR/51861: Ngie Cooper: Sprinkle __unused, mark __dead, _exit().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_select.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:18:33 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_select.c

Log Message:
PR/51861: Ngie Cooper: Sprinkle __unused, mark __dead, _exit().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_select.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/libc/sys/t_select.c
diff -u src/tests/lib/libc/sys/t_select.c:1.3 src/tests/lib/libc/sys/t_select.c:1.4
--- src/tests/lib/libc/sys/t_select.c:1.3	Sun Mar 18 03:00:52 2012
+++ src/tests/lib/libc/sys/t_select.c	Fri Jan 13 16:18:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_select.c,v 1.3 2012/03/18 07:00:52 jruoho Exp $ */
+/*	$NetBSD: t_select.c,v 1.4 2017/01/13 21:18:33 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -47,13 +47,13 @@
 static sig_atomic_t keep_going = 1;
 
 static void
-sig_handler(int signum)
+sig_handler(int signum __unused)
 {
 	keep_going = 0;
 }
 
 static void
-sigchld(int signum)
+sigchld(int signum __unused)
 {
 }
 
@@ -82,7 +82,7 @@ prmask(const sigset_t *m, char *buf, siz
 	return buf;
 }
 
-static void
+static __dead void
 child(const struct timespec *ts)
 {
 	struct sigaction sa;
@@ -127,6 +127,7 @@ child(const struct timespec *ts)
 		"after timeout %s != %s",
 		prmask(, nbuf, sizeof(nbuf)),
 		prmask(, obuf, sizeof(obuf)));
+	_exit(0);
 }
 
 ATF_TC(pselect_sigmask);
@@ -146,6 +147,7 @@ ATF_TC_BODY(pselect_sigmask, tc)
 	switch (pid = fork()) {
 	case 0:
 		child(NULL);
+		/*NOTREACHED*/
 	case -1:
 		err(1, "fork");
 	default:



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:16:38 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_setrlimit.c

Log Message:
PR/51862: Ngie Cooper: don't leak buf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_setrlimit.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:16:38 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_setrlimit.c

Log Message:
PR/51862: Ngie Cooper: don't leak buf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_setrlimit.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/libc/sys/t_setrlimit.c
diff -u src/tests/lib/libc/sys/t_setrlimit.c:1.5 src/tests/lib/libc/sys/t_setrlimit.c:1.6
--- src/tests/lib/libc/sys/t_setrlimit.c:1.5	Wed Jul 13 05:53:16 2016
+++ src/tests/lib/libc/sys/t_setrlimit.c	Fri Jan 13 16:16:38 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_setrlimit.c,v 1.5 2016/07/13 09:53:16 njoly Exp $ */
+/* $NetBSD: t_setrlimit.c,v 1.6 2017/01/13 21:16:38 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_setrlimit.c,v 1.5 2016/07/13 09:53:16 njoly Exp $");
+__RCSID("$NetBSD: t_setrlimit.c,v 1.6 2017/01/13 21:16:38 christos Exp $");
 
 #include 
 #include 
@@ -122,6 +122,7 @@ out:
 
 	if (lim != 0)
 		atf_tc_fail("failed to set limit (%d)", lim);
+	free(buf);
 }
 
 ATF_TC(setrlimit_current);



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:15:57 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_revoke.c

Log Message:
PR/51860: Ngie Cooper: don't leak fd


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_revoke.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/libc/sys/t_revoke.c
diff -u src/tests/lib/libc/sys/t_revoke.c:1.1 src/tests/lib/libc/sys/t_revoke.c:1.2
--- src/tests/lib/libc/sys/t_revoke.c:1.1	Thu Jul  7 02:57:54 2011
+++ src/tests/lib/libc/sys/t_revoke.c	Fri Jan 13 16:15:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+/* $NetBSD: t_revoke.c,v 1.2 2017/01/13 21:15:57 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+__RCSID("$NetBSD: t_revoke.c,v 1.2 2017/01/13 21:15:57 christos Exp $");
 
 #include 
 #include 
@@ -167,6 +167,7 @@ ATF_TC_BODY(revoke_perm, tc)
 	if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
 		atf_tc_fail("revoke(2) did not obey permissions");
 
+	(void)close(fd);
 	ATF_REQUIRE(unlink(path) == 0);
 }
 



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:15:57 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_revoke.c

Log Message:
PR/51860: Ngie Cooper: don't leak fd


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_revoke.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:15:14 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_nanosleep.c

Log Message:
PR/51857: Ngie Cooper: mark signo __unused for -Wunused


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_nanosleep.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/libc/sys/t_nanosleep.c
diff -u src/tests/lib/libc/sys/t_nanosleep.c:1.3 src/tests/lib/libc/sys/t_nanosleep.c:1.4
--- src/tests/lib/libc/sys/t_nanosleep.c:1.3	Sun Mar 31 12:47:16 2013
+++ src/tests/lib/libc/sys/t_nanosleep.c	Fri Jan 13 16:15:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $ */
+/* $NetBSD: t_nanosleep.c,v 1.4 2017/01/13 21:15:14 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $");
+__RCSID("$NetBSD: t_nanosleep.c,v 1.4 2017/01/13 21:15:14 christos Exp $");
 
 #include 
 #include 
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_nanosleep.c,v 1.3 20
 #include 
 
 static void
-handler(int signo)
+handler(int signo __unused)
 {
 	/* Nothing. */
 }



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:15:14 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_nanosleep.c

Log Message:
PR/51857: Ngie Cooper: mark signo __unused for -Wunused


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_nanosleep.c

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



CVS commit: src/tests/lib/libm

2017-01-13 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Jan 13 21:09:12 UTC 2017

Modified Files:
src/tests/lib/libm: t_scalbn.c

Log Message:
also terminate 2 other statements properly


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libm/t_scalbn.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/libm/t_scalbn.c
diff -u src/tests/lib/libm/t_scalbn.c:1.13 src/tests/lib/libm/t_scalbn.c:1.14
--- src/tests/lib/libm/t_scalbn.c:1.13	Fri Jan 13 21:00:59 2017
+++ src/tests/lib/libm/t_scalbn.c	Fri Jan 13 21:09:12 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_scalbn.c,v 1.13 2017/01/13 21:00:59 agc Exp $ */
+/* $NetBSD: t_scalbn.c,v 1.14 2017/01/13 21:09:12 agc Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_scalbn.c,v 1.13 2017/01/13 21:00:59 agc Exp $");
+__RCSID("$NetBSD: t_scalbn.c,v 1.14 2017/01/13 21:09:12 agc Exp $");
 
 #include 
 #include 
@@ -81,7 +81,7 @@ ATF_TC_BODY(scalbn_val, tc)
 	double rv;
 
 	for (i = 0; i < tcnt; i++) {
-		errno = 0
+		errno = 0;
 		rv = scalbn(tests[i].inval, tests[i].exp);
 		ATF_CHECK_EQ_MSG(errno, tests[i].error,
 		"test %zu: errno %d instead of %d", i, errno,
@@ -368,7 +368,7 @@ ATF_TC_BODY(scalbnl_val, tc)
 	long double rv;
 
 	for (i = 0; i < tcnt; i++) {
-		errno = 0
+		errno = 0;
 		rv = scalbnl(tests[i].inval, tests[i].exp);
 		ATF_CHECK_EQ_MSG(errno, tests[i].error,
 		"test %zu: errno %d instead of %d", i, errno,



CVS commit: src/tests/lib/libm

2017-01-13 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Jan 13 21:09:12 UTC 2017

Modified Files:
src/tests/lib/libm: t_scalbn.c

Log Message:
also terminate 2 other statements properly


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libm/t_scalbn.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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:02:05 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_file64.c
src/sys/compat/linux32/common: linux32_dirent.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_dirent.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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 21:02:05 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_file64.c
src/sys/compat/linux32/common: linux32_dirent.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_dirent.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_file64.c
diff -u src/sys/compat/linux/common/linux_file64.c:1.55 src/sys/compat/linux/common/linux_file64.c:1.56
--- src/sys/compat/linux/common/linux_file64.c:1.55	Fri Dec 27 09:17:11 2013
+++ src/sys/compat/linux/common/linux_file64.c	Fri Jan 13 16:02:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $	*/
+/*	$NetBSD: linux_file64.c,v 1.56 2017/01/13 21:02:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.56 2017/01/13 21:02:05 christos Exp $");
 
 #include 
 #include 
@@ -354,7 +354,8 @@ again:
 		idb.d_type = bdp->d_type;
 		idb.d_off = off;
 		idb.d_reclen = (u_short)linux_reclen;
-		strcpy(idb.d_name, bdp->d_name);
+		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
+		   bdp.d_namlen);
 		if ((error = copyout((void *), outp, linux_reclen)))
 			goto out;
 		/* advance past this real entry */

Index: src/sys/compat/linux32/common/linux32_dirent.c
diff -u src/sys/compat/linux32/common/linux32_dirent.c:1.13 src/sys/compat/linux32/common/linux32_dirent.c:1.14
--- src/sys/compat/linux32/common/linux32_dirent.c:1.13	Fri Oct 14 05:23:29 2011
+++ src/sys/compat/linux32/common/linux32_dirent.c	Fri Jan 13 16:02:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_dirent.c,v 1.13 2011/10/14 09:23:29 hannken Exp $ */
+/*	$NetBSD: linux32_dirent.c,v 1.14 2017/01/13 21:02:05 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.13 2011/10/14 09:23:29 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.14 2017/01/13 21:02:05 christos Exp $");
 
 #include 
 #include 
@@ -215,7 +215,8 @@ again:
 			idb.d_off = (linux32_off_t)off;
 			idb.d_reclen = (u_short)linux32_reclen;
 		}
-		strcpy(idb.d_name, bdp->d_name);
+		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name), 
+		bdp->d_namlen));
 		idb.d_name[strlen(idb.d_name) + 1] = bdp->d_type;
 		if ((error = copyout((void *), outp, linux32_reclen)))
 			goto out;



CVS commit: src/tests/lib/libm

2017-01-13 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Jan 13 21:00:59 UTC 2017

Modified Files:
src/tests/lib/libm: t_scalbn.c

Log Message:
terminate the statement properly


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libm/t_scalbn.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/libm/t_scalbn.c
diff -u src/tests/lib/libm/t_scalbn.c:1.12 src/tests/lib/libm/t_scalbn.c:1.13
--- src/tests/lib/libm/t_scalbn.c:1.12	Fri Jan 13 19:26:03 2017
+++ src/tests/lib/libm/t_scalbn.c	Fri Jan 13 21:00:59 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_scalbn.c,v 1.12 2017/01/13 19:26:03 christos Exp $ */
+/* $NetBSD: t_scalbn.c,v 1.13 2017/01/13 21:00:59 agc Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_scalbn.c,v 1.12 2017/01/13 19:26:03 christos Exp $");
+__RCSID("$NetBSD: t_scalbn.c,v 1.13 2017/01/13 21:00:59 agc Exp $");
 
 #include 
 #include 
@@ -223,7 +223,7 @@ ATF_TC_BODY(scalbnf_val, tc)
 	double rv;
 
 	for (i = 0; i < tcnt; i++) {
-		errno = 0
+		errno = 0;
 		rv = scalbnf(tests[i].inval, tests[i].exp);
 		ATF_CHECK_EQ_MSG(errno, tests[i].error,
 		"test %zu: errno %d instead of %d", i, errno,



CVS commit: src/tests/lib/libm

2017-01-13 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Jan 13 21:00:59 UTC 2017

Modified Files:
src/tests/lib/libm: t_scalbn.c

Log Message:
terminate the statement properly


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libm/t_scalbn.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jan 13 20:58:40 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
CG14CheckComposite():
- don't crash with SX_DEBUG set
- check destination format


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jan 13 20:58:40 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
CG14CheckComposite():
- don't crash with SX_DEBUG set
- check destination format


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.9 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.10
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.9	Fri Sep 16 22:05:47 2016
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Jan 13 20:58:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.9 2016/09/16 22:05:47 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.10 2017/01/13 20:58:40 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -549,20 +549,37 @@ CG14CheckComposite(int op, PicturePtr pS
 		DPRINTF(X_ERROR, "%s: rejecting %d\n", __func__, op);
 		return FALSE;
 	}
-	i = 0;
-	while ((i < arraysize(src_formats)) && (!ok)) {
-		ok =  (pSrcPicture->format == src_formats[i]);
-		i++;
-	}
 
-	if (!ok) {
-		DPRINTF(X_ERROR, "%s: unsupported src format %x\n",
-		__func__, pSrcPicture->format);
-		return FALSE;
+	if (pSrcPicture != NULL) {
+		i = 0;
+		while ((i < arraysize(src_formats)) && (!ok)) {
+			ok =  (pSrcPicture->format == src_formats[i]);
+			i++;
+		}
+
+		if (!ok) {
+			DPRINTF(X_ERROR, "%s: unsupported src format %x\n",
+			__func__, pSrcPicture->format);
+			return FALSE;
+		}
+		DPRINTF(X_ERROR, "src is %x, %d\n", pSrcPicture->format, op);
 	}
 
-	DPRINTF(X_ERROR, "src is %x, %d: %d %d\n", pSrcPicture->format, op,
-	pSrcPicture->pDrawable->width, pSrcPicture->pDrawable->height);
+	if (pDstPicture != NULL) {
+		i = 0;
+		ok = FALSE;
+		while ((i < arraysize(src_formats)) && (!ok)) {
+			ok =  (pDstPicture->format == src_formats[i]);
+			i++;
+		}
+
+		if (!ok) {
+			DPRINTF(X_ERROR, "%s: unsupported dst format %x\n",
+			__func__, pDstPicture->format);
+			return FALSE;
+		}
+		DPRINTF(X_ERROR, "dst is %x, %d\n", pDstPicture->format, op);
+	}
 
 	if (pMaskPicture != NULL) {
 		DPRINTF(X_ERROR, "mask is %x %d %d\n", pMaskPicture->format,



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:58:59 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_12.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/common/vfs_syscalls_12.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/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.31 src/sys/compat/common/vfs_syscalls_12.c:1.32
--- src/sys/compat/common/vfs_syscalls_12.c:1.31	Fri Sep  5 05:21:54 2014
+++ src/sys/compat/common/vfs_syscalls_12.c	Fri Jan 13 15:58:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.31 2014/09/05 09:21:54 matt Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.32 2017/01/13 20:58:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.31 2014/09/05 09:21:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.32 2017/01/13 20:58:59 christos Exp $");
 
 #include 
 #include 
@@ -196,7 +196,8 @@ again:
 		idb.d_reclen = (uint16_t)old_reclen;
 		idb.d_type = (uint8_t)bdp->d_type;
 		idb.d_namlen = (uint8_t)bdp->d_namlen;
-		strcpy(idb.d_name, bdp->d_name);
+		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
+		idb.d_namlen));
 		if ((error = copyout(, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:58:59 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_12.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


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

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



CVS commit: xsrc/external/mit/xf86-video-glint/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jan 13 20:54:48 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-glint/dist/src: pm3_exa.c

Log Message:
setting offScreenBase once is enough


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c
diff -u xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c:1.5 xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c:1.6
--- xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c:1.5	Wed Dec 14 20:34:17 2016
+++ xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c	Fri Jan 13 20:54:48 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pm3_exa.c,v 1.5 2016/12/14 20:34:17 macallan Exp $ */
+/* $NetBSD: pm3_exa.c,v 1.6 2017/01/13 20:54:48 macallan Exp $ */
 
 /*
  * Copyright (c) 2016 Michael Lorenz
@@ -348,7 +348,6 @@ Pm3InitEXA(ScreenPtr pScreen)
 	stride = pScrn->displayWidth * (pScrn->bitsPerPixel >> 3);
 	pExa->offScreenBase = stride * pScrn->virtualY;
 	pExa->memorySize = pGlint->FbMapSize;
-	pExa->offScreenBase = stride * pScrn->virtualY;
 
 	pExa->pixmapOffsetAlign = 32;
 	pExa->pixmapPitchAlign = 32;



CVS commit: xsrc/external/mit/xf86-video-glint/dist/src

2017-01-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jan 13 20:54:48 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-glint/dist/src: pm3_exa.c

Log Message:
setting offScreenBase once is enough


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-glint/dist/src/pm3_exa.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:44:45 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_msgctl.c t_msgrcv.c t_msgsnd.c

Log Message:
PR/51856: Ngie Cooper: add limits.h for INT_MAX


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_msgctl.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_msgrcv.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_msgsnd.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/libc/sys/t_msgctl.c
diff -u src/tests/lib/libc/sys/t_msgctl.c:1.4 src/tests/lib/libc/sys/t_msgctl.c:1.5
--- src/tests/lib/libc/sys/t_msgctl.c:1.4	Wed Feb 26 19:59:50 2014
+++ src/tests/lib/libc/sys/t_msgctl.c	Fri Jan 13 15:44:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $ */
+/* $NetBSD: t_msgctl.c,v 1.5 2017/01/13 20:44:45 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $");
+__RCSID("$NetBSD: t_msgctl.c,v 1.5 2017/01/13 20:44:45 christos Exp $");
 
 #include 
 #include 
@@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/tests/lib/libc/sys/t_msgrcv.c
diff -u src/tests/lib/libc/sys/t_msgrcv.c:1.3 src/tests/lib/libc/sys/t_msgrcv.c:1.4
--- src/tests/lib/libc/sys/t_msgrcv.c:1.3	Wed Jul 24 07:44:10 2013
+++ src/tests/lib/libc/sys/t_msgrcv.c	Fri Jan 13 15:44:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $ */
+/* $NetBSD: t_msgrcv.c,v 1.4 2017/01/13 20:44:45 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $");
+__RCSID("$NetBSD: t_msgrcv.c,v 1.4 2017/01/13 20:44:45 christos Exp $");
 
 #include 
 #include 
@@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/tests/lib/libc/sys/t_msgsnd.c
diff -u src/tests/lib/libc/sys/t_msgsnd.c:1.2 src/tests/lib/libc/sys/t_msgsnd.c:1.3
--- src/tests/lib/libc/sys/t_msgsnd.c:1.2	Sat Nov  5 04:47:54 2011
+++ src/tests/lib/libc/sys/t_msgsnd.c	Fri Jan 13 15:44:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $ */
+/* $NetBSD: t_msgsnd.c,v 1.3 2017/01/13 20:44:45 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $");
+__RCSID("$NetBSD: t_msgsnd.c,v 1.3 2017/01/13 20:44:45 christos Exp $");
 
 #include 
 #include 
@@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:46:16 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_pipe.c

Log Message:
PR/51858: Ngie Cooper: don't leak buf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_pipe.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:44:45 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_msgctl.c t_msgrcv.c t_msgsnd.c

Log Message:
PR/51856: Ngie Cooper: add limits.h for INT_MAX


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_msgctl.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_msgrcv.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_msgsnd.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:46:16 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_pipe.c

Log Message:
PR/51858: Ngie Cooper: don't leak buf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_pipe.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/libc/sys/t_pipe.c
diff -u src/tests/lib/libc/sys/t_pipe.c:1.3 src/tests/lib/libc/sys/t_pipe.c:1.4
--- src/tests/lib/libc/sys/t_pipe.c:1.3	Mon Oct 31 11:41:31 2011
+++ src/tests/lib/libc/sys/t_pipe.c	Fri Jan 13 15:46:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $ */
+/* $NetBSD: t_pipe.c,v 1.4 2017/01/13 20:46:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $");
+__RCSID("$NetBSD: t_pipe.c,v 1.4 2017/01/13 20:46:15 christos Exp $");
 
 #include 
 #include 
@@ -153,6 +153,7 @@ ATF_TC_BODY(pipe_restart, tc)
 
 		ATF_REQUIRE_EQ(WEXITSTATUS(st), 0);
 	}
+	free(f);
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:44:10 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_sigqueue.c

Log Message:
PR/51847: Ngie Cooper: More error checks, add __unused


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_sigqueue.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:44:10 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_sigqueue.c

Log Message:
PR/51847: Ngie Cooper: More error checks, add __unused


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_sigqueue.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/libc/sys/t_sigqueue.c
diff -u src/tests/lib/libc/sys/t_sigqueue.c:1.6 src/tests/lib/libc/sys/t_sigqueue.c:1.7
--- src/tests/lib/libc/sys/t_sigqueue.c:1.6	Thu Aug  4 02:43:43 2016
+++ src/tests/lib/libc/sys/t_sigqueue.c	Fri Jan 13 15:44:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sigqueue.c,v 1.6 2016/08/04 06:43:43 christos Exp $ */
+/* $NetBSD: t_sigqueue.c,v 1.7 2017/01/13 20:44:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_sigqueue.c,v 1.6 2016/08/04 06:43:43 christos Exp $");
-
+__RCSID("$NetBSD: t_sigqueue.c,v 1.7 2017/01/13 20:44:10 christos Exp $");
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -46,7 +47,7 @@ static void	handler(int, siginfo_t *, vo
 static int value;
 
 static void
-handler(int signo, siginfo_t *info, void *data)
+handler(int signo __unused, siginfo_t *info, void *data __unused)
 {
 	value = info->si_value.sival_int;
 	kill(0, SIGINFO);
@@ -107,9 +108,10 @@ static sig_atomic_t count = 0;
 static int delivered[CNT];
 
 static void
-myhandler(int signo, siginfo_t *info, void *context)
+myhandler(int signo, siginfo_t *info, void *context __unused)
 {
 	delivered[count++] = signo;
+	printf("Signal #%zu: signo: %d\n", (size_t)count, signo);
 }
 
 static int
@@ -176,7 +178,8 @@ ATF_TC_BODY(sigqueue_rt, tc)
 	sigset_t mask, orig;
 	sigemptyset();
 	for (size_t i = 0; i < CNT; i++)
-		sigaddset(, signals[i]);
+		if (sigaddset(, signals[i]) == -1)
+			warn("sigaddset");
 
 	ATF_REQUIRE(sigprocmask(SIG_BLOCK, , ) != -1);
 	
@@ -185,13 +188,17 @@ ATF_TC_BODY(sigqueue_rt, tc)
 	
 	ATF_REQUIRE(sigprocmask(SIG_UNBLOCK, , ) != -1);
 	sleep(1);
-	ATF_REQUIRE_MSG((size_t)count == ndelivered,
+	ATF_CHECK_MSG((size_t)count == ndelivered,
 	"count %zu != ndelivered %zu", (size_t)count, ndelivered);
 	for (size_t i = 0; i < ndelivered; i++)
 		ATF_REQUIRE_MSG(ordered[i] == delivered[i],
 		"%zu: ordered %d != delivered %d",
 		i, ordered[i], delivered[i]);
 
+	if ((size_t)count > ndelivered)
+		for (size_t i = ndelivered; i < (size_t)count; i++)
+			printf("Undelivered signal #%zu: %d\n", i, ordered[i]);
+
 	for (size_t i = 0; i < ndelivered; i++)
 		ATF_REQUIRE(sigaction(signals[i], [i], NULL) != -1);
 }



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:43:11 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
PR/51855: Ngie Cooper: fix leaks


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/sys/t_mmap.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:43:11 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
PR/51855: Ngie Cooper: fix leaks


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/sys/t_mmap.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/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.10 src/tests/lib/libc/sys/t_mmap.c:1.11
--- src/tests/lib/libc/sys/t_mmap.c:1.10	Tue Jan 10 17:36:29 2017
+++ src/tests/lib/libc/sys/t_mmap.c	Fri Jan 13 15:43:11 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $ */
+/* $NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $");
 
 #include 
 #include 
@@ -444,6 +444,7 @@ ATF_TC_BODY(mmap_truncate, tc)
 	ATF_REQUIRE(ftruncate(fd, page / 12) == 0);
 	ATF_REQUIRE(ftruncate(fd, page / 64) == 0);
 
+	(void)munmap(map, page);
 	ATF_REQUIRE(close(fd) == 0);
 }
 
@@ -496,6 +497,8 @@ ATF_TC_BODY(mmap_truncate_signal, tc)
 		   prevent the access to be optimized out */
 		ATF_REQUIRE(i == 0);
 		ATF_REQUIRE(sta == 0);
+		(void)munmap(map, page);
+		(void)close(fd);
 		return;
 	}
 



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:42:36 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_link.c

Log Message:
PR/51853: Ngie Cooper: add limits.h for MAXPATHLEN in FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_link.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/libc/sys/t_link.c
diff -u src/tests/lib/libc/sys/t_link.c:1.2 src/tests/lib/libc/sys/t_link.c:1.3
--- src/tests/lib/libc/sys/t_link.c:1.2	Mon Apr 21 10:39:36 2014
+++ src/tests/lib/libc/sys/t_link.c	Fri Jan 13 15:42:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $ */
+/* $NetBSD: t_link.c,v 1.3 2017/01/13 20:42:36 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $");
+__RCSID("$NetBSD: t_link.c,v 1.3 2017/01/13 20:42:36 christos Exp $");
 
 #include 
 #include 
@@ -37,6 +37,7 @@ __RCSID("$NetBSD: t_link.c,v 1.2 2014/04
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:42:36 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_link.c

Log Message:
PR/51853: Ngie Cooper: add limits.h for MAXPATHLEN in FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_link.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:41:50 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_listen.c

Log Message:
PR/51854: Ngie Cooper: sys/socket.h include and check result from socket(2)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_listen.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/libc/sys/t_listen.c
diff -u src/tests/lib/libc/sys/t_listen.c:1.4 src/tests/lib/libc/sys/t_listen.c:1.5
--- src/tests/lib/libc/sys/t_listen.c:1.4	Sun Mar 18 03:00:52 2012
+++ src/tests/lib/libc/sys/t_listen.c	Fri Jan 13 15:41:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_listen.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $	*/
+/*	$NetBSD: t_listen.c,v 1.5 2017/01/13 20:41:50 christos Exp $	*/
 /*
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -26,6 +26,7 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,7 @@ ATF_TC_BODY(listen_low_port, tc)
 	int sd, val;
 
 	sd = socket(AF_INET, SOCK_STREAM, 0);
+	ATF_REQUIRE_MSG(sd != -1, "socket failed: %s", strerror(errno));
 
 	val = IP_PORTRANGE_LOW;
 	if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, ,



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:41:50 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_listen.c

Log Message:
PR/51854: Ngie Cooper: sys/socket.h include and check result from socket(2)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_listen.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:31:53 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_dup.c

Log Message:
PR/51851: Ngie Cooper: add stdbool.h #include for false/true


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_dup.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/libc/sys/t_dup.c
diff -u src/tests/lib/libc/sys/t_dup.c:1.8 src/tests/lib/libc/sys/t_dup.c:1.9
--- src/tests/lib/libc/sys/t_dup.c:1.8	Sun Mar 18 03:00:51 2012
+++ src/tests/lib/libc/sys/t_dup.c	Fri Jan 13 15:31:53 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $ */
+/* $NetBSD: t_dup.c,v 1.9 2017/01/13 20:31:53 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $");
+__RCSID("$NetBSD: t_dup.c,v 1.9 2017/01/13 20:31:53 christos Exp $");
 
 #include 
 #include 
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:31:53 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_dup.c

Log Message:
PR/51851: Ngie Cooper: add stdbool.h #include for false/true


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_dup.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:31:06 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
PR/51852: Ngie Cooper: mark signo __unused


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_getrusage.c

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



CVS commit: src/tests/lib/libc/sys

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:31:06 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
PR/51852: Ngie Cooper: mark signo __unused


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_getrusage.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/libc/sys/t_getrusage.c
diff -u src/tests/lib/libc/sys/t_getrusage.c:1.4 src/tests/lib/libc/sys/t_getrusage.c:1.5
--- src/tests/lib/libc/sys/t_getrusage.c:1.4	Fri Aug  5 11:01:39 2016
+++ src/tests/lib/libc/sys/t_getrusage.c	Fri Jan 13 15:31:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getrusage.c,v 1.4 2016/08/05 15:01:39 scole Exp $ */
+/* $NetBSD: t_getrusage.c,v 1.5 2017/01/13 20:31:06 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_getrusage.c,v 1.4 2016/08/05 15:01:39 scole Exp $");
+__RCSID("$NetBSD: t_getrusage.c,v 1.5 2017/01/13 20:31:06 christos Exp $");
 
 #include 
 #include 
@@ -47,7 +47,7 @@ static void		sighandler(int);
 static const size_t	maxiter = 2000;
 
 static void
-sighandler(int signo)
+sighandler(int signo __unused)
 {
 	/* Nothing. */
 }



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:25:35 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_43.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/compat/common/vfs_syscalls_43.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/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.58 src/sys/compat/common/vfs_syscalls_43.c:1.59
--- src/sys/compat/common/vfs_syscalls_43.c:1.58	Fri Aug 19 20:34:42 2016
+++ src/sys/compat/common/vfs_syscalls_43.c	Fri Jan 13 15:25:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.58 2016/08/20 00:34:42 mrg Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.59 2017/01/13 20:25:35 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.58 2016/08/20 00:34:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.59 2017/01/13 20:25:35 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -475,7 +475,8 @@ again:
 		idb.d_fileno = (uint32_t)bdp->d_fileno;
 		idb.d_reclen = (uint16_t)old_reclen;
 		idb.d_namlen = (uint16_t)bdp->d_namlen;
-		strcpy(idb.d_name, bdp->d_name);
+		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
+		idb.d_namlen));
 		if ((error = copyout(, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */



CVS commit: src/sys/compat/common

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:25:35 UTC 2017

Modified Files:
src/sys/compat/common: vfs_syscalls_43.c

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/compat/common/vfs_syscalls_43.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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:24:37 UTC 2017

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

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


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

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

Modified files:

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.234 src/sys/compat/linux/common/linux_misc.c:1.235
--- src/sys/compat/linux/common/linux_misc.c:1.234	Mon Jan  2 11:32:10 2017
+++ src/sys/compat/linux/common/linux_misc.c	Fri Jan 13 15:24:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.234 2017/01/02 16:32:10 manu Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.235 2017/01/13 20:24:37 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.234 2017/01/02 16:32:10 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.235 2017/01/13 20:24:37 christos Exp $");
 
 #include 
 #include 
@@ -787,7 +787,8 @@ again:
 			/* Linux puts d_type at the end of each record */
 			*((char *) + idb.d_reclen - 1) = bdp->d_type;
 		}
-		strcpy(idb.d_name, bdp->d_name);
+		memcpy(idb.d_name, bdp->d_name,
+		MIN(sizeof(idb.d_name), idb.d_namlen));
 		if ((error = copyout((void *), outp, linux_reclen)))
 			goto out;
 		/* advance past this real entry */



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

2017-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 13 20:24:37 UTC 2017

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

Log Message:
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.


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

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



  1   2   >