CVS commit: src/lib/libc
Module Name:src Committed By: christos Date: Wed Apr 6 04:09:10 UTC 2016 Modified Files: src/lib/libc/gen: waitid.c src/lib/libc/sys: wait.2 Log Message: revert part of previous; not needed. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/waitid.c cvs rdiff -u -r1.30 -r1.31 src/lib/libc/sys/wait.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/gen/waitid.c diff -u src/lib/libc/gen/waitid.c:1.3 src/lib/libc/gen/waitid.c:1.4 --- src/lib/libc/gen/waitid.c:1.3 Tue Apr 5 23:50:03 2016 +++ src/lib/libc/gen/waitid.c Wed Apr 6 00:09:10 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $ */ +/* $NetBSD: waitid.c,v 1.4 2016/04/06 04:09:10 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $"); +__RCSID("$NetBSD: waitid.c,v 1.4 2016/04/06 04:09:10 christos Exp $"); #include "namespace.h" #include @@ -57,8 +57,6 @@ waitid(idtype_t idtype, id_t id, siginfo memset(info, 0, sizeof(*info)); /*FALLTHROUGH*/ default: - if (info != NULL && info->si_signo != 0) - info->si_signo = SIGCHLD; return 0; } } Index: src/lib/libc/sys/wait.2 diff -u src/lib/libc/sys/wait.2:1.30 src/lib/libc/sys/wait.2:1.31 --- src/lib/libc/sys/wait.2:1.30 Tue Apr 5 23:50:03 2016 +++ src/lib/libc/sys/wait.2 Wed Apr 6 00:09:10 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: wait.2,v 1.30 2016/04/06 03:50:03 christos Exp $ +.\" $NetBSD: wait.2,v 1.31 2016/04/06 04:09:10 christos Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -435,12 +435,7 @@ structure is returned with the .Fa si_signo field set to .Dv SIGCHLD -for -.Fn waitid -as required by POSIX and to the delivering signal -for -.Fn wait6 . -The +and the .Fa si_pid field set to the process ID of the process reporting status. For the exited process, the
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: christos Date: Wed Apr 6 03:52:27 UTC 2016 Modified Files: src/tests/lib/libc/sys: t_wait.c Log Message: Use WIFCONTINUED. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_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/lib/libc/sys/t_wait.c diff -u src/tests/lib/libc/sys/t_wait.c:1.2 src/tests/lib/libc/sys/t_wait.c:1.3 --- src/tests/lib/libc/sys/t_wait.c:1.2 Tue Apr 5 20:52:45 2016 +++ src/tests/lib/libc/sys/t_wait.c Tue Apr 5 23:52:27 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: t_wait.c,v 1.2 2016/04/06 00:52:45 christos Exp $ */ +/* $NetBSD: t_wait.c,v 1.3 2016/04/06 03:52:27 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_wait.c,v 1.2 2016/04/06 00:52:45 christos Exp $"); +__RCSID("$NetBSD: t_wait.c,v 1.3 2016/04/06 03:52:27 christos Exp $"); #include #include @@ -214,7 +214,7 @@ ATF_TC_BODY(wait6_stop_and_go, tc) ATF_REQUIRE(kill(pid, SIGCONT) == 0); ATF_REQUIRE(!wait6(P_PID, pid, , WCONTINUED, , )); - ATF_REQUIRE(WIFSTOPPED(st) && WSTOPSIG(st) == SIGCONT); + ATF_REQUIRE(WIFCONTINUED(st)); ATF_REQUIRE(si.si_status == SIGCONT); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid());
CVS commit: src/sys
Module Name:src Committed By: christos Date: Wed Apr 6 03:51:26 UTC 2016 Modified Files: src/sys/kern: kern_exit.c src/sys/sys: wait.h Log Message: Implement WIFCONTINUED using the linux value instead of the FreeBSD one... To generate a diff of this commit: cvs rdiff -u -r1.255 -r1.256 src/sys/kern/kern_exit.c cvs rdiff -u -r1.29 -r1.30 src/sys/sys/wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_exit.c diff -u src/sys/kern/kern_exit.c:1.255 src/sys/kern/kern_exit.c:1.256 --- src/sys/kern/kern_exit.c:1.255 Tue Apr 5 10:07:31 2016 +++ src/sys/kern/kern_exit.c Tue Apr 5 23:51:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $ */ +/* $NetBSD: kern_exit.c,v 1.256 2016/04/06 03:51:26 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.256 2016/04/06 03:51:26 christos Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -685,7 +685,8 @@ do_sys_waitid(idtype_t idtype, id_t id, } } else { /* Child state must have been SSTOP. */ - *status = W_STOPCODE(child->p_xsig); + *status = child->p_xsig == SIGCONT ? W_CONTCODE() : + W_STOPCODE(child->p_xsig); mutex_exit(proc_lock); } return 0; @@ -1032,7 +1033,6 @@ find_stopped_child(struct proc *parent, break; } } - /* XXX: WCONTINUED? */ if (child != NULL || error != 0 || ((options & WNOHANG) != 0 && dead == NULL)) { Index: src/sys/sys/wait.h diff -u src/sys/sys/wait.h:1.29 src/sys/sys/wait.h:1.30 --- src/sys/sys/wait.h:1.29 Sat Apr 2 17:09:43 2016 +++ src/sys/sys/wait.h Tue Apr 5 23:51:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: wait.h,v 1.29 2016/04/02 21:09:43 christos Exp $ */ +/* $NetBSD: wait.h,v 1.30 2016/04/06 03:51:26 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993, 1994 @@ -57,7 +57,9 @@ #define _WSTATUS(x) (_W_INT(x) & 0177) #define _WSTOPPED 0177 /* _WSTATUS if process is stopped */ +#define _WCONTINUED 0xU #define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED) +#define WIFCONTINUED(x) (_W_INT(x) == _WCONTINUED) #define WSTOPSIG(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff) #define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0) #define WTERMSIG(x) (_WSTATUS(x)) @@ -69,6 +71,7 @@ #define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) +#define W_CONTCODE() (_WCONTINUED) #endif /*
CVS commit: src/lib/libc
Module Name:src Committed By: christos Date: Wed Apr 6 03:50:03 UTC 2016 Modified Files: src/lib/libc/gen: waitid.c src/lib/libc/sys: wait.2 Log Message: - clarify si_signo difference for waitid and wait6 as per POSIX. - implement it. - document WIFCONTINUED To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/waitid.c cvs rdiff -u -r1.29 -r1.30 src/lib/libc/sys/wait.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/gen/waitid.c diff -u src/lib/libc/gen/waitid.c:1.2 src/lib/libc/gen/waitid.c:1.3 --- src/lib/libc/gen/waitid.c:1.2 Sat Apr 2 21:49:51 2016 +++ src/lib/libc/gen/waitid.c Tue Apr 5 23:50:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: waitid.c,v 1.2 2016/04/03 01:49:51 christos Exp $ */ +/* $NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: waitid.c,v 1.2 2016/04/03 01:49:51 christos Exp $"); +__RCSID("$NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $"); #include "namespace.h" #include @@ -57,6 +57,8 @@ waitid(idtype_t idtype, id_t id, siginfo memset(info, 0, sizeof(*info)); /*FALLTHROUGH*/ default: + if (info != NULL && info->si_signo != 0) + info->si_signo = SIGCHLD; return 0; } } Index: src/lib/libc/sys/wait.2 diff -u src/lib/libc/sys/wait.2:1.29 src/lib/libc/sys/wait.2:1.30 --- src/lib/libc/sys/wait.2:1.29 Mon Apr 4 09:13:09 2016 +++ src/lib/libc/sys/wait.2 Tue Apr 5 23:50:03 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: wait.2,v 1.29 2016/04/04 13:13:09 wiz Exp $ +.\" $NetBSD: wait.2,v 1.30 2016/04/06 03:50:03 christos Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" -.Dd April 2, 2016 +.Dd April 5, 2016 .Dt WAIT 2 .Os .Sh NAME @@ -435,7 +435,12 @@ structure is returned with the .Fa si_signo field set to .Dv SIGCHLD -and the +for +.Fn waitid +as required by POSIX and to the delivering signal +for +.Fn wait6 . +The .Fa si_pid field set to the process ID of the process reporting status. For the exited process, the @@ -508,6 +513,14 @@ This macro can be true only if the wait option or if the child process is being traced (see .Xr ptrace 2 ) . +.It Fn WIFCONTINUED status +True if the process has not terminated, but has been continued via the +delivery of the +.Dv SIGCONT +signal. +This macro can be true only if the wait call specified the +.Dv WCONTINUED +option. .El .Pp Depending on the values of those macros, the following macros
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: dholland Date: Wed Apr 6 03:38:31 UTC 2016 Modified Files: src/lib/libc/stdio: funopen.3 Log Message: improve usage To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/lib/libc/stdio/funopen.3 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/stdio/funopen.3 diff -u src/lib/libc/stdio/funopen.3:1.23 src/lib/libc/stdio/funopen.3:1.24 --- src/lib/libc/stdio/funopen.3:1.23 Sun Sep 6 01:36:21 2015 +++ src/lib/libc/stdio/funopen.3 Wed Apr 6 03:38:31 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: funopen.3,v 1.23 2015/09/06 01:36:21 dholland Exp $ +.\" $NetBSD: funopen.3,v 1.24 2016/04/06 03:38:31 dholland Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,9 +79,9 @@ close the new stream. The .Fn funopen2 function provides sightly different read and write signatures, which match -better the corresponding system calls, plus the ability to augment the -streams default flushing function. -If a flushing function is provided, then it is called after all data has +the corresponding system calls better, plus the ability to augment the +stream's default flushing function. +If a flushing function is provided, it is called after all data has been written to the stream. .Pp In general, omitting a function means that any attempt to perform the
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Wed Apr 6 03:11:32 UTC 2016 Modified Files: src/sys/kern: kern_sig.c Log Message: don't create ktrace records if we were not asked. To generate a diff of this commit: cvs rdiff -u -r1.324 -r1.325 src/sys/kern/kern_sig.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/kern/kern_sig.c diff -u src/sys/kern/kern_sig.c:1.324 src/sys/kern/kern_sig.c:1.325 --- src/sys/kern/kern_sig.c:1.324 Tue Apr 5 20:48:30 2016 +++ src/sys/kern/kern_sig.c Tue Apr 5 23:11:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.324 2016/04/06 00:48:30 christos Exp $ */ +/* $NetBSD: kern_sig.c,v 1.325 2016/04/06 03:11:31 christos Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.324 2016/04/06 00:48:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.325 2016/04/06 03:11:31 christos Exp $"); #include "opt_ptrace.h" #include "opt_dtrace.h" @@ -896,7 +896,10 @@ trapsignal(struct lwp *l, ksiginfo_t *ks l->l_ru.ru_nsignals++; kpsendsig(l, ksi, mask); mutex_exit(p->p_lock); - ktrpsig(signo, SIGACTION_PS(ps, signo).sa_handler, mask, ksi); + if (ktrpoint(KTR_PSIG)) { + ktrpsig(signo, SIGACTION_PS(ps, signo).sa_handler, + mask, ksi); + } } else { /* XXX for core dump/debugger */ p->p_sigctx.ps_lwp = l->l_lid;
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: christos Date: Wed Apr 6 00:52:45 UTC 2016 Modified Files: src/tests/lib/libc/sys: t_wait.c Log Message: Fix ATF_REQUIRE(false) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_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/lib/libc/sys/t_wait.c diff -u src/tests/lib/libc/sys/t_wait.c:1.1 src/tests/lib/libc/sys/t_wait.c:1.2 --- src/tests/lib/libc/sys/t_wait.c:1.1 Tue Apr 5 20:45:53 2016 +++ src/tests/lib/libc/sys/t_wait.c Tue Apr 5 20:52:45 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: t_wait.c,v 1.1 2016/04/06 00:45:53 christos Exp $ */ +/* $NetBSD: t_wait.c,v 1.2 2016/04/06 00:52:45 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_wait.c,v 1.1 2016/04/06 00:45:53 christos Exp $"); +__RCSID("$NetBSD: t_wait.c,v 1.2 2016/04/06 00:52:45 christos Exp $"); #include #include @@ -92,7 +92,7 @@ ATF_TC_BODY(wait6_exited, tc) switch (pid = fork()) { case -1: - ATF_REQUIRE(pid == 0); + ATF_REQUIRE(pid > 0); case 0: exit(0x5a5a5a5a); /*NOTREACHED*/ @@ -128,7 +128,7 @@ ATF_TC_BODY(wait6_terminated, tc) sleep(100); /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid == 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(kill(pid, SIGTERM) == 0); ATF_REQUIRE(!wait6(P_PID, pid, , WEXITED, , )); @@ -164,7 +164,7 @@ ATF_TC_BODY(wait6_coredumped, tc) *(char *)8 = 0; /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid == 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(!wait6(P_PID, pid, , WEXITED, , )); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGSEGV @@ -200,7 +200,7 @@ ATF_TC_BODY(wait6_stop_and_go, tc) sleep(100); /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid == 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(kill(pid, SIGSTOP) == 0); ATF_REQUIRE(!wait6(P_PID, pid, , WSTOPPED, , ));
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Wed Apr 6 00:48:30 UTC 2016 Modified Files: src/sys/kern: kern_sig.c Log Message: Add parent notification on SIGCONT as required by waitid(2)/wait6(2) To generate a diff of this commit: cvs rdiff -u -r1.323 -r1.324 src/sys/kern/kern_sig.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/kern/kern_sig.c diff -u src/sys/kern/kern_sig.c:1.323 src/sys/kern/kern_sig.c:1.324 --- src/sys/kern/kern_sig.c:1.323 Mon Apr 4 19:07:06 2016 +++ src/sys/kern/kern_sig.c Tue Apr 5 20:48:30 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.323 2016/04/04 23:07:06 christos Exp $ */ +/* $NetBSD: kern_sig.c,v 1.324 2016/04/06 00:48:30 christos Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.323 2016/04/04 23:07:06 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.324 2016/04/06 00:48:30 christos Exp $"); #include "opt_ptrace.h" #include "opt_dtrace.h" @@ -1377,9 +1377,13 @@ kpsignal2(struct proc *p, ksiginfo_t *ks * signal itself (if waiting on event - process runs, * otherwise continues sleeping). */ - if ((prop & SA_CONT) != 0 && action == SIG_DFL) { -KASSERT(signo != SIGKILL); -goto deliver; + if ((prop & SA_CONT) != 0) { +p->p_xsig = SIGCONT; +child_psignal(p, 0); +if (action == SIG_DFL) { + KASSERT(signo != SIGKILL); + goto deliver; +} } } else if ((prop & SA_STOP) != 0) { /*
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: christos Date: Wed Apr 6 00:47:15 UTC 2016 Modified Files: src/distrib/sets/lists/debug: mi src/distrib/sets/lists/tests: mi Log Message: Add wait tests. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.669 -r1.670 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/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.147 src/distrib/sets/lists/debug/mi:1.148 --- src/distrib/sets/lists/debug/mi:1.147 Fri Mar 18 14:24:25 2016 +++ src/distrib/sets/lists/debug/mi Tue Apr 5 20:47:15 2016 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.147 2016/03/18 18:24:25 christos Exp $ +# $NetBSD: mi,v 1.148 2016/04/06 00:47:15 christos Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2046,6 +2046,7 @@ ./usr/libdata/debug/usr/tests/lib/libc/sys/t_ucontext.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libc/sys/t_umask.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libc/sys/t_unlink.debug tests-lib-debug debug,atf,compattestfile +./usr/libdata/debug/usr/tests/lib/libc/sys/t_wait.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libc/sys/t_write.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libc/t_cdb.debug tests-lib-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/lib/libc/t_cerror.debug tests-obsolete obsolete,compattestfile Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.669 src/distrib/sets/lists/tests/mi:1.670 --- src/distrib/sets/lists/tests/mi:1.669 Sun Mar 20 18:57:49 2016 +++ src/distrib/sets/lists/tests/mi Tue Apr 5 20:47:15 2016 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.669 2016/03/20 22:57:49 christos Exp $ +# $NetBSD: mi,v 1.670 2016/04/06 00:47:15 christos Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -2717,6 +2717,7 @@ ./usr/tests/lib/libc/sys/t_ucontext tests-lib-tests compattestfile,atf ./usr/tests/lib/libc/sys/t_umask tests-lib-tests compattestfile,atf ./usr/tests/lib/libc/sys/t_unlink tests-lib-tests compattestfile,atf +./usr/tests/lib/libc/sys/t_wait tests-lib-tests compattestfile,atf ./usr/tests/lib/libc/sys/t_write 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
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: christos Date: Wed Apr 6 00:45:53 UTC 2016 Modified Files: src/tests/lib/libc/sys: Makefile Added Files: src/tests/lib/libc/sys: t_wait.c Log Message: Add wait6(2) tests. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/tests/lib/libc/sys/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_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/lib/libc/sys/Makefile diff -u src/tests/lib/libc/sys/Makefile:1.41 src/tests/lib/libc/sys/Makefile:1.42 --- src/tests/lib/libc/sys/Makefile:1.41 Sun Jan 24 10:11:08 2016 +++ src/tests/lib/libc/sys/Makefile Tue Apr 5 20:45:53 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.41 2016/01/24 15:11:08 christos Exp $ +# $NetBSD: Makefile,v 1.42 2016/04/06 00:45:53 christos Exp $ MKMAN= no @@ -65,6 +65,7 @@ TESTS_C+= t_truncate TESTS_C+= t_ucontext TESTS_C+= t_umask TESTS_C+= t_unlink +TESTS_C+= t_wait TESTS_C+= t_write SRCS.t_mprotect= t_mprotect.c ${SRCS_EXEC_PROT} Added files: Index: src/tests/lib/libc/sys/t_wait.c diff -u /dev/null src/tests/lib/libc/sys/t_wait.c:1.1 --- /dev/null Tue Apr 5 20:45:53 2016 +++ src/tests/lib/libc/sys/t_wait.c Tue Apr 5 20:45:53 2016 @@ -0,0 +1,249 @@ +/* $NetBSD: t_wait.c,v 1.1 2016/04/06 00:45:53 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: t_wait.c,v 1.1 2016/04/06 00:45:53 christos Exp $"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +ATF_TC(wait6_invalid); +ATF_TC_HEAD(wait6_invalid, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that wait6(2) returns EINVAL with 0 options"); +} + +ATF_TC_BODY(wait6_invalid, tc) +{ + siginfo_t si; + struct wrusage wru; + int st; + ATF_REQUIRE(wait6(P_ALL, 0, , 0, , ) == -1 + && errno == EINVAL); +} + +ATF_TC(wait6_noproc); +ATF_TC_HEAD(wait6_noproc, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that wait6(2) returns ECHILD with for no processes"); +} + +ATF_TC_BODY(wait6_noproc, tc) +{ + siginfo_t si; + struct wrusage wru; + int st; + ATF_REQUIRE(wait6(P_ALL, 0, , WEXITED, , ) == -1 + && errno == ECHILD); +} + +ATF_TC(wait6_exited); +ATF_TC_HEAD(wait6_exited, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that wait6(2) handled exiting process and code"); +} + +ATF_TC_BODY(wait6_exited, tc) +{ + siginfo_t si; + struct wrusage wru; + int st; + pid_t pid; + + switch (pid = fork()) { + case -1: + ATF_REQUIRE(pid == 0); + case 0: + exit(0x5a5a5a5a); + /*NOTREACHED*/ + default: + ATF_REQUIRE(!wait6(P_PID, pid, , WEXITED, , )); + ATF_REQUIRE(WIFEXITED(st) && WEXITSTATUS(st) == 0x5a); + ATF_REQUIRE(si.si_status = 0x5a5a5a5a); + ATF_REQUIRE(si.si_pid == pid); + ATF_REQUIRE(si.si_uid == getuid()); + ATF_REQUIRE(si.si_code == CLD_EXITED); + printf("user: %ju system: %ju\n", (uintmax_t)si.si_utime, + (uintmax_t)si.si_utime); + break; + } +} + +ATF_TC(wait6_terminated); +ATF_TC_HEAD(wait6_terminated, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that wait6(2) handled terminated process and code"); +} + +ATF_TC_BODY(wait6_terminated, tc) +{ + siginfo_t si; + struct wrusage wru; + int st; + pid_t pid; + + switch (pid = fork()) { + case 0: + sleep(100); + /*FALLTHROUGH*/ + case -1: + ATF_REQUIRE(pid == 0); + default: + ATF_REQUIRE(kill(pid, SIGTERM) == 0); + ATF_REQUIRE(!wait6(P_PID, pid, ,
CVS commit: src/sys/net
Module Name:src Committed By: pgoyette Date: Tue Apr 5 23:44:05 UTC 2016 Modified Files: src/sys/net: ppp-deflate.c Log Message: Add modular dependency on zlib module. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/net/ppp-deflate.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/net/ppp-deflate.c diff -u src/sys/net/ppp-deflate.c:1.20 src/sys/net/ppp-deflate.c:1.21 --- src/sys/net/ppp-deflate.c:1.20 Wed Dec 17 20:51:37 2008 +++ src/sys/net/ppp-deflate.c Tue Apr 5 23:44:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ppp-deflate.c,v 1.20 2008/12/17 20:51:37 cegger Exp $ */ +/* $NetBSD: ppp-deflate.c,v 1.21 2016/04/05 23:44:05 pgoyette Exp $ */ /* Id: ppp-deflate.c,v 1.5 1997/03/04 03:33:28 paulus Exp */ /* @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ppp-deflate.c,v 1.20 2008/12/17 20:51:37 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ppp-deflate.c,v 1.21 2016/04/05 23:44:05 pgoyette Exp $"); #include #include @@ -664,7 +664,7 @@ z_incomp(void *arg, struct mbuf *mi) state->stats.unc_packets++; } -MODULE(MODULE_CLASS_MISC, ppp_deflate, NULL); +MODULE(MODULE_CLASS_MISC, ppp_deflate, "zlib"); static int ppp_deflate_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys/net
Module Name:src Committed By: pgoyette Date: Tue Apr 5 22:51:01 UTC 2016 Modified Files: src/sys/net: files.net Log Message: Update dependency: zlib is only needed for the swcrypto device, not for any other component of opencrypto. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/net/files.net Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/files.net diff -u src/sys/net/files.net:1.8 src/sys/net/files.net:1.9 --- src/sys/net/files.net:1.8 Thu Nov 26 01:41:20 2015 +++ src/sys/net/files.net Tue Apr 5 22:51:01 2016 @@ -1,4 +1,4 @@ -# $NetBSD: files.net,v 1.8 2015/11/26 01:41:20 ozaki-r Exp $ +# $NetBSD: files.net,v 1.9 2016/04/05 22:51:01 pgoyette Exp $ # XXX CLEANUP define net @@ -49,7 +49,7 @@ file net/route.c net file net/rtbl.c net file net/rtsock.c net file net/slcompress.c sl | ppp | strip | (irip & irip_vj) -file net/zlib.c (ppp & ppp_deflate) | opencrypto | vnd_compression | kdtrace_hooks +file net/zlib.c (ppp & ppp_deflate) | swcrypto | vnd_compression | kdtrace_hooks file netinet/accf_data.c accf_data file netinet/accf_http.c accf_http file netinet/cpu_in_cksum.c (inet | inet6) & !cpu_in_cksum
CVS commit: [nick-nhusb] src/sys/dev/pci
Module Name:src Committed By: skrll Date: Tue Apr 5 15:36:48 UTC 2016 Modified Files: src/sys/dev/pci [nick-nhusb]: xhci_pci.c Log Message: Switch PCI xhci(4) attachment from pci_intr_map() to pci_intr_alloc()/pci_intr_release(). This enables MSI where available. To generate a diff of this commit: cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/sys/dev/pci/xhci_pci.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/dev/pci/xhci_pci.c diff -u src/sys/dev/pci/xhci_pci.c:1.4.2.4 src/sys/dev/pci/xhci_pci.c:1.4.2.5 --- src/sys/dev/pci/xhci_pci.c:1.4.2.4 Mon Aug 31 08:33:03 2015 +++ src/sys/dev/pci/xhci_pci.c Tue Apr 5 15:36:48 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci_pci.c,v 1.4.2.4 2015/08/31 08:33:03 skrll Exp $ */ +/* $NetBSD: xhci_pci.c,v 1.4.2.5 2016/04/05 15:36:48 skrll Exp $ */ /* OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.4.2.4 2015/08/31 08:33:03 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.4.2.5 2016/04/05 15:36:48 skrll Exp $"); #include #include @@ -70,6 +70,7 @@ struct xhci_pci_softc { pci_chipset_tag_t sc_pc; pcitag_t sc_tag; void *sc_ih; + pci_intr_handle_t *sc_pihp; }; static int @@ -142,7 +143,6 @@ xhci_pci_attach(device_t parent, device_ const pci_chipset_tag_t pc = pa->pa_pc; const pcitag_t tag = pa->pa_tag; char const *intrstr; - pci_intr_handle_t ih; pcireg_t csr, memtype; int err; uint32_t hccparams; @@ -198,17 +198,15 @@ xhci_pci_attach(device_t parent, device_ pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr | PCI_COMMAND_MASTER_ENABLE); - /* Map and establish the interrupt. */ - if (pci_intr_map(pa, )) { - aprint_error_dev(self, "couldn't map interrupt\n"); + /* Allocate and establish the interrupt. */ + if (pci_intr_alloc(pa, >sc_pihp, NULL, 0)) { + aprint_error_dev(self, "can't allocate handler\n"); goto fail; } - - /* - * Allocate IRQ - */ - intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf)); - psc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, xhci_intr, sc); + intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf, + sizeof(intrbuf)); + psc->sc_ih = pci_intr_establish(pc, psc->sc_pihp[0], IPL_USB, + xhci_intr, sc); if (psc->sc_ih == NULL) { aprint_error_dev(self, "couldn't establish interrupt"); if (intrstr != NULL) @@ -251,7 +249,7 @@ xhci_pci_attach(device_t parent, device_ fail: if (psc->sc_ih) { - pci_intr_disestablish(psc->sc_pc, psc->sc_ih); + pci_intr_release(psc->sc_pc, psc->sc_pihp, 1); psc->sc_ih = NULL; } if (sc->sc_ios) { @@ -285,7 +283,7 @@ xhci_pci_detach(device_t self, int flags } if (psc->sc_ih != NULL) { - pci_intr_disestablish(psc->sc_pc, psc->sc_ih); + pci_intr_release(psc->sc_pc, psc->sc_pihp, 1); psc->sc_ih = NULL; } if (sc->sc_ios) {
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: roy Date: Tue Apr 5 15:01:26 UTC 2016 Modified Files: src/lib/libc/stdlib: reallocarray.c Log Message: Stop calling reallocarr and just do the same bounds checking but without messing around with copying pointers which was causing ssh to crash. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/stdlib/reallocarray.c 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/stdlib/reallocarray.c diff -u src/lib/libc/stdlib/reallocarray.c:1.5 src/lib/libc/stdlib/reallocarray.c:1.6 --- src/lib/libc/stdlib/reallocarray.c:1.5 Sun Jul 26 02:22:33 2015 +++ src/lib/libc/stdlib/reallocarray.c Tue Apr 5 15:01:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: reallocarray.c,v 1.5 2015/07/26 02:22:33 kamil Exp $ */ +/* $NetBSD: reallocarray.c,v 1.6 2016/04/05 15:01:26 roy Exp $ */ /* $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $ */ /*- @@ -31,22 +31,29 @@ */ #include -__RCSID("$NetBSD: reallocarray.c,v 1.5 2015/07/26 02:22:33 kamil Exp $"); +__RCSID("$NetBSD: reallocarray.c,v 1.6 2016/04/05 15:01:26 roy Exp $"); #define _OPENBSD_SOURCE #include +#include #include +#define SQRT_SIZE_MAX (((size_t)1) << (sizeof(size_t) * CHAR_BIT / 2)) void * reallocarray(void *optr, size_t nmemb, size_t size) { - if (nmemb == 0 || size == 0) - return realloc(optr, 0); - int e = reallocarr(, nmemb, size); - - if (e == 0) - return optr; - errno = e; - return NULL; + /* + * Try to avoid division here. + * + * It isn't possible to overflow during multiplication if neither + * operand uses any of the most significant half of the bits. + */ + if (__predict_false((nmemb | size) >= SQRT_SIZE_MAX && + nmemb > SIZE_MAX / size)) + { + errno = EOVERFLOW; + return NULL; + } + return realloc(optr, nmemb * size); }
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Tue Apr 5 14:07:31 UTC 2016 Modified Files: src/sys/kern: kern_exit.c Log Message: Simplify even more to make it clear how the status is set. To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/kern/kern_exit.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/kern/kern_exit.c diff -u src/sys/kern/kern_exit.c:1.254 src/sys/kern/kern_exit.c:1.255 --- src/sys/kern/kern_exit.c:1.254 Tue Apr 5 09:01:46 2016 +++ src/sys/kern/kern_exit.c Tue Apr 5 10:07:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.254 2016/04/05 13:01:46 christos Exp $ */ +/* $NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.254 2016/04/05 13:01:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -119,7 +119,7 @@ int debug_exit = 0; #endif static int find_stopped_child(struct proc *, idtype_t, id_t, int, -struct proc **, int *, struct wrusage *, siginfo_t *); +struct proc **, struct wrusage *, siginfo_t *); static void proc_free(struct proc *, struct wrusage *); /* @@ -665,7 +665,7 @@ do_sys_waitid(idtype_t idtype, id_t id, memset(si, 0, sizeof(*si)); mutex_enter(proc_lock); - error = find_stopped_child(curproc, idtype, id, options, , status, + error = find_stopped_child(curproc, idtype, id, options, , wru, si); if (child == NULL) { mutex_exit(proc_lock); @@ -675,6 +675,8 @@ do_sys_waitid(idtype_t idtype, id_t id, *pid = child->p_pid; if (child->p_stat == SZOMB) { + /* Child is exiting */ + *status = P_WAITSTATUS(child); /* proc_free() will release the proc_lock. */ if (options & WNOWAIT) { mutex_exit(proc_lock); @@ -683,8 +685,8 @@ do_sys_waitid(idtype_t idtype, id_t id, } } else { /* Child state must have been SSTOP. */ + *status = W_STOPCODE(child->p_xsig); mutex_exit(proc_lock); - *status = W_STOPCODE(*status); } return 0; } @@ -918,7 +920,7 @@ match_process(struct proc *pp, struct pr */ static int find_stopped_child(struct proc *parent, idtype_t idtype, id_t id, int options, -struct proc **child_p, int *status_p, struct wrusage *wru, siginfo_t *si) +struct proc **child_p, struct wrusage *wru, siginfo_t *si) { struct proc *child, *dead; int error; @@ -1034,9 +1036,6 @@ find_stopped_child(struct proc *parent, if (child != NULL || error != 0 || ((options & WNOHANG) != 0 && dead == NULL)) { - if (child != NULL) { - *status_p = P_WAITSTATUS(child); - } *child_p = child; return error; }
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Tue Apr 5 13:01:46 UTC 2016 Modified Files: src/sys/kern: kern_exit.c Log Message: Set the exit status code properly. To generate a diff of this commit: cvs rdiff -u -r1.253 -r1.254 src/sys/kern/kern_exit.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/kern/kern_exit.c diff -u src/sys/kern/kern_exit.c:1.253 src/sys/kern/kern_exit.c:1.254 --- src/sys/kern/kern_exit.c:1.253 Mon Apr 4 19:07:06 2016 +++ src/sys/kern/kern_exit.c Tue Apr 5 09:01:46 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.253 2016/04/04 23:07:06 christos Exp $ */ +/* $NetBSD: kern_exit.c,v 1.254 2016/04/05 13:01:46 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.253 2016/04/04 23:07:06 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.254 2016/04/05 13:01:46 christos Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -1035,7 +1035,7 @@ find_stopped_child(struct proc *parent, if (child != NULL || error != 0 || ((options & WNOHANG) != 0 && dead == NULL)) { if (child != NULL) { - *status_p = child->p_xsig; + *status_p = P_WAITSTATUS(child); } *child_p = child; return error;
CVS commit: src/external/bsd/blacklist/port
Module Name:src Committed By: christos Date: Tue Apr 5 12:28:57 UTC 2016 Modified Files: src/external/bsd/blacklist/port: pidfile.c port.h sockaddr_snprintf.c Added Files: src/external/bsd/blacklist/port: config.h Log Message: more FreeBSD changes from Kurt Lidl. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/bsd/blacklist/port/config.h cvs rdiff -u -r1.1 -r1.2 src/external/bsd/blacklist/port/pidfile.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/blacklist/port/port.h cvs rdiff -u -r1.9 -r1.10 src/external/bsd/blacklist/port/sockaddr_snprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/blacklist/port/pidfile.c diff -u src/external/bsd/blacklist/port/pidfile.c:1.1 src/external/bsd/blacklist/port/pidfile.c:1.2 --- src/external/bsd/blacklist/port/pidfile.c:1.1 Thu Jan 22 11:19:53 2015 +++ src/external/bsd/blacklist/port/pidfile.c Tue Apr 5 08:28:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: pidfile.c,v 1.1 2015/01/22 16:19:53 christos Exp $ */ +/* $NetBSD: pidfile.c,v 1.2 2016/04/05 12:28:57 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pidfile.c,v 1.1 2015/01/22 16:19:53 christos Exp $"); +__RCSID("$NetBSD: pidfile.c,v 1.2 2016/04/05 12:28:57 christos Exp $"); #endif #include @@ -45,6 +45,9 @@ __RCSID("$NetBSD: pidfile.c,v 1.1 2015/0 #include #include #include +#ifdef HAVE_LIBUTIL_H +#include +#endif #ifdef HAVE_UTIL_H #include #endif Index: src/external/bsd/blacklist/port/port.h diff -u src/external/bsd/blacklist/port/port.h:1.7 src/external/bsd/blacklist/port/port.h:1.8 --- src/external/bsd/blacklist/port/port.h:1.7 Fri Mar 11 12:17:35 2016 +++ src/external/bsd/blacklist/port/port.h Tue Apr 5 08:28:57 2016 @@ -78,7 +78,9 @@ int clock_gettime(int, struct timespec * #define CLOCK_REALTIME 0 #endif +#if !defined(__FreeBSD__) #define _PATH_BLCONF "conf" #define _PATH_BLCONTROL "control" #define _PATH_BLSOCK "blacklistd.sock" #define _PATH_BLSTATE "blacklistd.db" +#endif Index: src/external/bsd/blacklist/port/sockaddr_snprintf.c diff -u src/external/bsd/blacklist/port/sockaddr_snprintf.c:1.9 src/external/bsd/blacklist/port/sockaddr_snprintf.c:1.10 --- src/external/bsd/blacklist/port/sockaddr_snprintf.c:1.9 Thu Jan 22 22:29:18 2015 +++ src/external/bsd/blacklist/port/sockaddr_snprintf.c Tue Apr 5 08:28:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: sockaddr_snprintf.c,v 1.9 2015/01/23 03:29:18 christos Exp $ */ +/* $NetBSD: sockaddr_snprintf.c,v 1.10 2016/04/05 12:28:57 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.9 2015/01/23 03:29:18 christos Exp $"); +__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.10 2016/04/05 12:28:57 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -57,6 +57,9 @@ __RCSID("$NetBSD: sockaddr_snprintf.c,v #include #include #include +#ifdef HAVE_LIBUTIL_H +#include +#endif #ifdef HAVE_UTIL_H #include #endif Added files: Index: src/external/bsd/blacklist/port/config.h diff -u /dev/null src/external/bsd/blacklist/port/config.h:1.1 --- /dev/null Tue Apr 5 08:28:57 2016 +++ src/external/bsd/blacklist/port/config.h Tue Apr 5 08:28:57 2016 @@ -0,0 +1,4 @@ +#if defined(__FreeBSD__) +#define HAVE_FPARSELN +#include "port.h" +#endif
CVS commit: src/usr.sbin/gpioctl
Module Name:src Committed By: bouyer Date: Tue Apr 5 10:58:04 UTC 2016 Modified Files: src/usr.sbin/gpioctl: gpioctl.c Log Message: Fix pasto for GPIO_PIN_EVENTS/GPIO_PIN_LEVEL/GPIO_PIN_FALLING (not used at this time) To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/gpioctl/gpioctl.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.sbin/gpioctl/gpioctl.c diff -u src/usr.sbin/gpioctl/gpioctl.c:1.22 src/usr.sbin/gpioctl/gpioctl.c:1.23 --- src/usr.sbin/gpioctl/gpioctl.c:1.22 Sun Dec 6 07:31:28 2015 +++ src/usr.sbin/gpioctl/gpioctl.c Tue Apr 5 10:58:04 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: gpioctl.c,v 1.22 2015/12/06 07:31:28 mlelstv Exp $ */ +/* $NetBSD: gpioctl.c,v 1.23 2016/04/05 10:58:04 bouyer Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2013 Marc Balmer@@ -72,9 +72,9 @@ static const struct bitstr { { GPIO_PIN_ALT5, "alt5" }, { GPIO_PIN_ALT6, "alt6" }, { GPIO_PIN_ALT7, "alt7" }, - { GPIO_PIN_ALT7, "events" }, - { GPIO_PIN_ALT7, "level" }, - { GPIO_PIN_ALT7, "falling" }, + { GPIO_PIN_EVENTS, "events" }, + { GPIO_PIN_LEVEL, "level" }, + { GPIO_PIN_FALLING, "falling" }, { GPIO_PIN_USER, "user" }, { 0, NULL }, };
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: bouyer Date: Tue Apr 5 10:53:16 UTC 2016 Modified Files: src/sys/dev/i2c: ds1307.c ds1307reg.h Log Message: Fix DS1672 suppport: need to provide dm_ch_reg to avoid a KASSERT on write. For consistency set dm_ch_value too, even if it's unused. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/i2c/ds1307.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/ds1307reg.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/dev/i2c/ds1307.c diff -u src/sys/dev/i2c/ds1307.c:1.21 src/sys/dev/i2c/ds1307.c:1.22 --- src/sys/dev/i2c/ds1307.c:1.21 Thu Nov 20 16:34:26 2014 +++ src/sys/dev/i2c/ds1307.c Tue Apr 5 10:53:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ds1307.c,v 1.21 2014/11/20 16:34:26 christos Exp $ */ +/* $NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.21 2014/11/20 16:34:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $"); #include #include @@ -86,6 +86,8 @@ static const struct dsrtc_model dsrtc_mo .dm_model = 1672, .dm_rtc_start = DS1672_RTC_START, .dm_rtc_size = DS1672_RTC_SIZE, + .dm_ch_reg = DS1672_CONTROL, + .dm_ch_value = DS1672_CONTROL_CH, .dm_flags = 0, }, { .dm_model = 3231, Index: src/sys/dev/i2c/ds1307reg.h diff -u src/sys/dev/i2c/ds1307reg.h:1.5 src/sys/dev/i2c/ds1307reg.h:1.6 --- src/sys/dev/i2c/ds1307reg.h:1.5 Sun Oct 12 01:23:23 2014 +++ src/sys/dev/i2c/ds1307reg.h Tue Apr 5 10:53:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ds1307reg.h,v 1.5 2014/10/12 01:23:23 macallan Exp $ */ +/* $NetBSD: ds1307reg.h,v 1.6 2016/04/05 10:53:16 bouyer Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -70,6 +70,7 @@ #define DS1672_CNTR3 0x02 #define DS1672_CNTR4 0x03 #define DS1672_CONTROL 0x04 +#define DS1672_CONTROL_CH (1 << 7) /* clock hold */ #define DS1672_TRICKLE 0x05 #define DS1672_RTC_START 0
CVS commit: src/sys/net
Module Name:src Committed By: ozaki-r Date: Tue Apr 5 10:03:33 UTC 2016 Modified Files: src/sys/net: rtsock.c Log Message: Unbreak build of kernels without INET To generate a diff of this commit: cvs rdiff -u -r1.178 -r1.179 src/sys/net/rtsock.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/net/rtsock.c diff -u src/sys/net/rtsock.c:1.178 src/sys/net/rtsock.c:1.179 --- src/sys/net/rtsock.c:1.178 Mon Apr 4 07:37:07 2016 +++ src/sys/net/rtsock.c Tue Apr 5 10:03:33 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: rtsock.c,v 1.178 2016/04/04 07:37:07 ozaki-r Exp $ */ +/* $NetBSD: rtsock.c,v 1.179 2016/04/05 10:03:33 ozaki-r Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.178 2016/04/04 07:37:07 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.179 2016/04/05 10:03:33 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -423,6 +423,7 @@ COMPATNAME(route_purgeif)(struct socket return EOPNOTSUPP; } +#ifdef INET static int route_get_sdl_index(struct rt_addrinfo *info, int *sdl_index) { @@ -441,6 +442,7 @@ route_get_sdl_index(struct rt_addrinfo * return 0; } +#endif /* INET */ static void route_get_sdl(const struct ifnet *ifp, const struct sockaddr *dst, @@ -563,6 +565,7 @@ COMPATNAME(route_output)(struct mbuf *m, if (info.rti_info[RTAX_GATEWAY] == NULL) { senderr(EINVAL); } +#ifdef INET /* support for new ARP code with keeping backcompat */ if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) { int sdl_index = @@ -600,6 +603,7 @@ COMPATNAME(route_output)(struct mbuf *m, break; } fallback: +#endif /* INET */ error = rtrequest1(rtm->rtm_type, , _nrt); if (error == 0) { rt_setmetrics(rtm->rtm_inits, rtm, saved_nrt); @@ -608,6 +612,7 @@ COMPATNAME(route_output)(struct mbuf *m, break; case RTM_DELETE: +#ifdef INET /* support for new ARP code */ if (info.rti_info[RTAX_GATEWAY] && (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) && @@ -616,6 +621,7 @@ COMPATNAME(route_output)(struct mbuf *m, rtm->rtm_rmx.rmx_expire, , 0); break; } +#endif /* INET */ error = rtrequest1(rtm->rtm_type, , _nrt); if (error == 0) { rt = saved_nrt; @@ -1545,6 +1551,7 @@ again: case NET_RT_DUMP: case NET_RT_FLAGS: +#ifdef INET /* * take care of llinfo entries, the caller must * specify an AF @@ -1557,6 +1564,7 @@ again: error = EINVAL; break; } +#endif /* INET */ for (i = 1; i <= AF_MAX; i++) if ((af == 0 || af == i) &&
CVS commit: src/external/gpl3/binutils
Module Name:src Committed By: skrll Date: Tue Apr 5 09:54:26 UTC 2016 Modified Files: src/external/gpl3/binutils/lib/libbfd/arch/aarch64: bfd.h bfd_stdint.h bfdver.h config.h defs.mk src/external/gpl3/binutils/lib/libiberty/arch/aarch64: config.h defs.mk src/external/gpl3/binutils/lib/libopcodes/arch/aarch64: config.h src/external/gpl3/binutils/usr.bin/common/arch/aarch64: config.h defs.mk src/external/gpl3/binutils/usr.bin/gas/arch/aarch64: config.h src/external/gpl3/binutils/usr.bin/gprof/arch/aarch64: defs.mk gconfig.h src/external/gpl3/binutils/usr.bin/ld/arch/aarch64: config.h defs.mk ldemul-list.h Log Message: binutils 2.26 mknative for aarch64 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h \ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd_stdint.h \ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfdver.h \ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/config.h \ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/defs.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/lib/libiberty/arch/aarch64/config.h \ src/external/gpl3/binutils/lib/libiberty/arch/aarch64/defs.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/lib/libopcodes/arch/aarch64/config.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/usr.bin/common/arch/aarch64/config.h \ src/external/gpl3/binutils/usr.bin/common/arch/aarch64/defs.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/usr.bin/gas/arch/aarch64/config.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/defs.mk \ src/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/gconfig.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/usr.bin/ld/arch/aarch64/config.h \ src/external/gpl3/binutils/usr.bin/ld/arch/aarch64/defs.mk \ src/external/gpl3/binutils/usr.bin/ld/arch/aarch64/ldemul-list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h diff -u src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h:1.1 src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h:1.2 --- src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h:1.1 Sun Aug 10 05:47:36 2014 +++ src/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h Tue Apr 5 09:54:26 2016 @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", @@ -11,9 +11,7 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -73,7 +71,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +82,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -285,7 +283,7 @@ alent; /* Object and core file sections. */ #define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align typedef struct bfd_section *sec_ptr; @@ -305,13 +303,13 @@ typedef struct bfd_section *sec_ptr; #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
CVS commit: src/external/gpl3/binutils/dist/ld/emulparams
Module Name:src Committed By: skrll Date: Tue Apr 5 09:52:22 UTC 2016 Modified Files: src/external/gpl3/binutils/dist/ld/emulparams: aarch64nbsd.sh Log Message: Set ELFSIZE to 64 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh diff -u src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.1 src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.2 --- src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.1 Sun Aug 10 05:47:36 2014 +++ src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh Tue Apr 5 09:52:22 2016 @@ -3,6 +3,7 @@ MACHINE= NOP=0 SCRIPT_NAME=elf +ELFSIZE=64 OUTPUT_FORMAT="elf64-littleaarch64" BIG_OUTPUT_FORMAT="elf64-bigaarch64" LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"