From owner-svn-src-stable-9@FreeBSD.ORG Sun Dec 9 04:15:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57841DA0; Sun, 9 Dec 2012 04:15:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC8B8FC08; Sun, 9 Dec 2012 04:15:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB94FqTP082746; Sun, 9 Dec 2012 04:15:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB94Fq2b082745; Sun, 9 Dec 2012 04:15:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212090415.qB94Fq2b082745@svn.freebsd.org> From: Eitan Adler Date: Sun, 9 Dec 2012 04:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244045 - stable/9/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 04:15:52 -0000 Author: eadler Date: Sun Dec 9 04:15:51 2012 New Revision: 244045 URL: http://svnweb.freebsd.org/changeset/base/244045 Log: MFC r243753: The getline function returns the number of characters read, not written. Use clearer text for this. PR: docs/174023 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/stdio/getline.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/getline.3 ============================================================================== --- stable/9/lib/libc/stdio/getline.3 Sun Dec 9 01:08:44 2012 (r244044) +++ stable/9/lib/libc/stdio/getline.3 Sun Dec 9 04:15:51 2012 (r244045) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2010 +.Dd November 30, 2012 .Dt GETLINE 3 .Os .Sh NAME @@ -76,7 +76,7 @@ The .Fn getdelim and .Fn getline -functions return the number of characters written, excluding the +functions return the number of characters stored in the buffer, excluding the terminating .Dv NUL character. From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 02:33:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0640C5B7; Mon, 10 Dec 2012 02:33:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDF1A8FC14; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2XHbZ095264; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2XHw1095257; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100233.qBA2XHw1095257@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244066 - stable/9/usr.sbin/chkgrp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:33:18 -0000 Author: eadler Date: Mon Dec 10 02:33:17 2012 New Revision: 244066 URL: http://svnweb.freebsd.org/changeset/base/244066 Log: MFC r243084: Add support for a -q flag. While here make the custom argument parsing use getopt instead of hacking on it more. This change also fixes the method of silencing the compiler warning about gfn being used uninitialized. Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/chkgrp/chkgrp.8 stable/9/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/9/usr.sbin/chkgrp/ (props changed) Modified: stable/9/usr.sbin/chkgrp/chkgrp.8 ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:16 2012 (r244065) +++ stable/9/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:17 2012 (r244066) @@ -34,6 +34,7 @@ .Nd check the syntax of the group file .Sh SYNOPSIS .Nm +.Op Fl q .Op Ar groupfile .Sh DESCRIPTION The @@ -47,6 +48,12 @@ contains whitespace, and that the third numeric. It will also check for invalid characters in the group names and group members. +The following options are available: +.Bl -tag -width indent +.It Fl q +This option disables printing of text when the group format +is correct. +.El .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Modified: stable/9/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:16 2012 (r244065) +++ stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:17 2012 (r244066) @@ -34,11 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static char empty[] = { 0 }; -static void +static void __dead2 usage(void) { fprintf(stderr, "usage: chkgrp [groupfile]\n"); @@ -50,24 +51,33 @@ main(int argc, char *argv[]) { unsigned int i; size_t len; + int quiet; + int ch; int n = 0, k, e = 0; char *line, *f[4], *p; const char *cp, *gfn; FILE *gf; - /* check arguments */ - switch (argc) { - case 1: - gfn = "/etc/group"; - break; - case 2: - gfn = argv[1]; - break; - default: - gfn = NULL; /* silence compiler */ - usage(); + quiet = 0; + while ((ch = getopt(argc, argv, "q")) != -1) { + switch (ch) { + case 'q': + quiet = 1; + break; + case '?': + default: + printf("hello\n"); + usage(); + } } + if (optind == argc) + gfn = "/etc/group"; + else if (optind == argc - 1) + gfn = argv[optind]; + else + usage(); + /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ @@ -163,7 +173,7 @@ main(int argc, char *argv[]) /* done */ fclose(gf); - if (e == 0) + if (e == 0 && quiet == 0) printf("%s is fine\n", gfn); exit(e ? EX_DATAERR : EX_OK); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 02:35:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 609789FA; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43BA38FC15; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ZKvW095919; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2ZKsA095917; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100235.qBA2ZKsA095917@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244067 - stable/9/usr.sbin/chkgrp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:35:20 -0000 Author: eadler Date: Mon Dec 10 02:35:19 2012 New Revision: 244067 URL: http://svnweb.freebsd.org/changeset/base/244067 Log: MFC r243077: Fix error code if file isn't readable. Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/9/usr.sbin/chkgrp/ (props changed) Modified: stable/9/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:17 2012 (r244066) +++ stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:19 2012 (r244067) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) - err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ + err(EX_NOINPUT, "%s", gfn); /* check line by line */ while (++n) { From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 02:40:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB7F01F6; Mon, 10 Dec 2012 02:40:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90BE78FC14; Mon, 10 Dec 2012 02:40:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2e8Qa097096; Mon, 10 Dec 2012 02:40:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2e8s7097095; Mon, 10 Dec 2012 02:40:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100240.qBA2e8s7097095@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244071 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:40:08 -0000 Author: eadler Date: Mon Dec 10 02:40:08 2012 New Revision: 244071 URL: http://svnweb.freebsd.org/changeset/base/244071 Log: MFC r243101: Using set -x produces output on stderr instead of stdout. It also doesn't work with make -s. Prefer the use of builtin make features. PR: misc/126312 Approved by: cperciva (implicit) Modified: stable/9/etc/Makefile Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Mon Dec 10 02:40:06 2012 (r244070) +++ stable/9/etc/Makefile Mon Dec 10 02:40:08 2012 (r244071) @@ -217,8 +217,7 @@ distribution: cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_BIND_MTREE} != "no" - @if [ ! -e ${DESTDIR}/etc/namedb ]; then \ - set -x; \ + if [ ! -e ${DESTDIR}/etc/namedb ]; then \ ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \ fi .endif @@ -264,9 +263,8 @@ distribution: .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail - @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ + if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ ! -f ${DESTDIR}/etc/aliases ]; then \ - set -x; \ ln -s mail/aliases ${DESTDIR}/etc/aliases; \ fi .endif From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 02:44:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30E4A609; Mon, 10 Dec 2012 02:44:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EFCA78FC12; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ilO9098112; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2il7G098109; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100244.qBA2il7G098109@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244074 - in stable/9: usr.bin/pr usr.bin/seq usr.sbin/nfscbd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:44:48 -0000 Author: eadler Date: Mon Dec 10 02:44:47 2012 New Revision: 244074 URL: http://svnweb.freebsd.org/changeset/base/244074 Log: MFC r243238: Standardize EXIT STATUS instructions in man pages when possible. Approved by: cperciva (implicit) Modified: stable/9/usr.bin/pr/pr.1 stable/9/usr.bin/seq/seq.1 stable/9/usr.sbin/nfscbd/nfscbd.8 Directory Properties: stable/9/usr.bin/pr/ (props changed) stable/9/usr.bin/seq/ (props changed) stable/9/usr.sbin/nfscbd/ (props changed) Modified: stable/9/usr.bin/pr/pr.1 ============================================================================== --- stable/9/usr.bin/pr/pr.1 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.bin/pr/pr.1 Mon Dec 10 02:44:47 2012 (r244074) @@ -361,9 +361,7 @@ and require that both arguments, if present, not be separated from the option letter. .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh DIAGNOSTICS If .Nm Modified: stable/9/usr.bin/seq/seq.1 ============================================================================== --- stable/9/usr.bin/seq/seq.1 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.bin/seq/seq.1 Mon Dec 10 02:44:47 2012 (r244074) @@ -127,10 +127,8 @@ If any sequence numbers will be printed the default conversion is changed to .Cm %e . .El -.Pp -The -.Nm -utility exits 0 on success and non-zero if an error occurs. +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES .Bd -literal -offset indent # seq 1 3 Modified: stable/9/usr.sbin/nfscbd/nfscbd.8 ============================================================================== --- stable/9/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:44:47 2012 (r244074) @@ -77,10 +77,8 @@ has been specified. For more information on what callbacks and Open Delegations do, see .%T "Network File System (NFS) Version 4 Protocol" , RFC3530. -.Pp -The -.Nm -utility exits 0 on success or >0 if an error occurred. +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr nfsv4 4 , .Xr mount_nfs 8 From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 03:11:21 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A50CECDD; Mon, 10 Dec 2012 03:11:21 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 877A28FC13; Mon, 10 Dec 2012 03:11:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA3BLmM004060; Mon, 10 Dec 2012 03:11:21 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA3BKL6004047; Mon, 10 Dec 2012 03:11:20 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212100311.qBA3BKL6004047@svn.freebsd.org> From: Greg Lehey Date: Mon, 10 Dec 2012 03:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244075 - stable/9/bin/ls X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 03:11:21 -0000 Author: grog Date: Mon Dec 10 03:11:19 2012 New Revision: 244075 URL: http://svnweb.freebsd.org/changeset/base/244075 Log: MFC to r242840: Add y flag and environment variable LS_SAMESORT to specify the same sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. Modified: stable/9/bin/ls/Makefile stable/9/bin/ls/cmp.c stable/9/bin/ls/ls.1 stable/9/bin/ls/ls.c stable/9/bin/ls/ls.h stable/9/bin/ls/print.c stable/9/bin/ls/util.c Modified: stable/9/bin/ls/Makefile ============================================================================== --- stable/9/bin/ls/Makefile Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/Makefile Mon Dec 10 03:11:19 2012 (r244075) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 # $FreeBSD$ +.include + PROG= ls SRCS= cmp.c ls.c print.c util.c DPADD= ${LIBUTIL} Modified: stable/9/bin/ls/cmp.c ============================================================================== --- stable/9/bin/ls/cmp.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/cmp.c Mon Dec 10 03:11:19 2012 (r244075) @@ -78,6 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -104,6 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -130,6 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * if (b->fts_statp->st_birthtim.tv_nsec < a->fts_statp->st_birthtim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -156,6 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } Modified: stable/9/bin/ls/ls.1 ============================================================================== --- stable/9/bin/ls/ls.1 Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.1 Mon Dec 10 03:11:19 2012 (r244075) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd November 8, 2012 .Dt LS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1 +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, .Op Fl D Ar format .Op Ar .Sh DESCRIPTION @@ -130,6 +130,8 @@ This option is equivalent to defining .Ev CLICOLOR in the environment. (See below.) +This functionality can be compiled out by removing the definition of +.Ev COLORLS . .It Fl H Symbolic links on the command line are followed. This option is assumed if @@ -249,12 +251,35 @@ subsection below, except (if the long fo the directory totals are not output when the output is in a single column, even if multi-column output is requested. .It Fl t -Sort by time modified (most recently modified -first) before sorting the operands in lexicographical -order. +Sort by descending time modified (most recently modified first). If two files +have the same modification timestamp, sort their names in ascending +lexicographical order. +The +.Fl r +option reverses both of these sort orders. +.Pp +Note that these sort orders are contradictory: the time sequence is in +descending order, the lexicographical sort is in ascending order. +This behavior is mandated by +.St -p1003.2 . +This feature can cause problems listing files stored with sequential names on +FAT file systems, such as from digital cameras, where it is possible to have +more than one image with the same timestamp. +In such a case, the photos cannot be listed in the sequence in which +they were taken. +To ensure the same sort order for time and for lexicographical sorting, set the +environment variable +.Ev LS_SAMESORT +or use the +.Fl y +option. +This causes +.Nm +to reverse the lexicographal sort order when sorting files with the +same modification timestamp. .It Fl u Use time of last access, -instead of last modification +instead of time of last modification of the file for sorting .Pq Fl t or printing @@ -268,6 +293,15 @@ The same as .Fl C , except that the multi-column output is produced with entries sorted across, rather than down, the columns. +.It Fl y +When the +.Fl t +option is set, sort the alphabetical output in the same order as the time output. +This has the same effect as setting +.Ev LS_SAMESORT . +See the description of the +.Fl t +option for more details. .It Fl 1 (The numeric digit .Dq one . ) @@ -275,6 +309,15 @@ Force output to be one entry per line. This is the default when output is not to a terminal. +.It Fl , +(Comma) When the +.Fl l +option is set, print file sizes grouped and separated by thousands using the +non-monetary separator returned by +.Xr localeconv 3 , +typically a comma or period. +If no locale is set, or the locale does not have a non-monetary separator, this +option has no effect. .El .Pp The @@ -357,8 +400,7 @@ option is given, the numeric ID's are displayed. .Pp If the file is a character special or block special file, -the major and minor device numbers for the file are displayed -in the size field. +the device number for the file is displayed in the size field. If the file is a symbolic link the pathname of the linked-to file is preceded by .Dq Li -> . @@ -530,7 +572,7 @@ variable is defined. .It Ev CLICOLOR_FORCE Color sequences are normally disabled if the output is not directed to a terminal. -This can be overridden by setting this flag. +This can be overridden by setting this variable. The .Ev TERM variable still needs to reference a color capable terminal however @@ -656,6 +698,14 @@ Not all columns have changeable widths. The fields are, in order: inode, block count, number of links, user name, group name, flags, file size, file name. +.It Ev LS_SAMESORT +If this variable is set, the +.Fl t +option sorts the names of files with the same modification timestamp in the same +sense as the time sort. +See the description of the +.Fl t +option for more details. .It Ev TERM The .Ev CLICOLOR @@ -679,6 +729,7 @@ specification. .Xr getfacl 1 , .Xr sort 1 , .Xr xterm 1 , +.Xr localeconv 3 , .Xr strftime 3 , .Xr strmode 3 , .Xr termcap 5 , @@ -717,3 +768,9 @@ option description might be a feature th based on the fact that single-column output usually goes to something other than a terminal. It is debatable whether this is a design bug. +.Pp +.St -p1003.2 +mandates opposite sort orders for files with the same timestamp when +sorting with the +.Fl t +option. Modified: stable/9/bin/ls/ls.c ============================================================================== --- stable/9/bin/ls/ls.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.c Mon Dec 10 03:11:19 2012 (r244075) @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Be #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include @@ -109,10 +109,11 @@ int termwidth = 80; /* default terminal int f_humanval; /* show human-readable file sizes */ int f_inode; /* print inode */ static int f_kblocks; /* print size in kilobytes */ + int f_label; /* show MAC label */ static int f_listdir; /* list actual directory, not contents */ static int f_listdot; /* list files beginning with . */ -static int f_noautodot; /* do not automatically enable -A for root */ int f_longform; /* long listing format */ +static int f_noautodot; /* do not automatically enable -A for root */ static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ @@ -122,19 +123,21 @@ static int f_numericonly; /* don't conve int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ static int f_reversesort; /* reverse whatever sort is used */ - int f_sectime; /* print the real time for all files */ + int f_samesort; /* sort time and name in same direction */ + int f_sectime; /* print full time information */ static int f_singlecol; /* use single column output */ int f_size; /* list size in short listing */ +static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ -static int f_timesort; /* sort by time vice name */ + int f_thousands; /* show file sizes with thousands separators */ char *f_timeformat; /* user-specified time format */ -static int f_sizesort; +static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ - int f_label; /* show MAC label */ + #ifdef COLORLS int f_color; /* add type in color for non-regular files */ @@ -180,8 +183,10 @@ main(int argc, char *argv[]) } fts_options = FTS_PHYSICAL; - while ((ch = getopt(argc, argv, - "1ABCD:FGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { + if (getenv("LS_SAMESORT")) + f_samesort = 1; + while ((ch = getopt(argc, argv, + "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* * The -1, -C, -x and -l options all override each other so @@ -192,17 +197,9 @@ main(int argc, char *argv[]) f_longform = 0; f_stream = 0; break; - case 'B': - f_nonprint = 0; - f_octal = 1; - f_octal_escape = 0; - break; case 'C': f_sortacross = f_longform = f_singlecol = 0; break; - case 'D': - f_timeformat = optarg; - break; case 'l': f_longform = 1; f_singlecol = 0; @@ -229,16 +226,46 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; + case 'a': + fts_options |= FTS_SEEDOT; + /* FALLTHROUGH */ + case 'A': + f_listdot = 1; + break; + /* The -t and -S options override each other. */ + case 'S': + f_sizesort = 1; + f_timesort = 0; + break; + case 't': + f_timesort = 1; + f_sizesort = 0; + break; + /* Other flags. Please keep alphabetic. */ + case ',': + f_thousands = 1; + break; + case 'B': + f_nonprint = 0; + f_octal = 1; + f_octal_escape = 0; + break; + case 'D': + f_timeformat = optarg; + break; case 'F': f_type = 1; f_slash = 0; break; + case 'G': + setenv("CLICOLOR", "", 1); + break; case 'H': fts_options |= FTS_COMFOLLOW; f_nofollow = 0; break; - case 'G': - setenv("CLICOLOR", "", 1); + case 'I': + f_noautodot = 1; break; case 'L': fts_options &= ~FTS_PHYSICAL; @@ -254,14 +281,19 @@ main(int argc, char *argv[]) case 'R': f_recursive = 1; break; - case 'a': - fts_options |= FTS_SEEDOT; - /* FALLTHROUGH */ - case 'A': - f_listdot = 1; + case 'T': + f_sectime = 1; break; - case 'I': - f_noautodot = 1; + case 'W': + f_whiteout = 1; + break; + case 'Z': + f_label = 1; + break; + case 'b': + f_nonprint = 0; + f_octal = 0; + f_octal_escape = 1; break; /* The -d option turns off the -R option. */ case 'd': @@ -309,33 +341,13 @@ main(int argc, char *argv[]) case 's': f_size = 1; break; - case 'T': - f_sectime = 1; - break; - /* The -t and -S options override each other. */ - case 't': - f_timesort = 1; - f_sizesort = 0; - break; - case 'S': - f_sizesort = 1; - f_timesort = 0; - break; - case 'W': - f_whiteout = 1; - break; - case 'b': - f_nonprint = 0; - f_octal = 0; - f_octal_escape = 1; - break; case 'w': f_nonprint = 0; f_octal = 0; f_octal_escape = 0; break; - case 'Z': - f_label = 1; + case 'y': + f_samesort = 1; break; default: case '?': @@ -414,8 +426,8 @@ main(int argc, char *argv[]) fts_options |= FTS_WHITEOUT; #endif - /* If -l or -s, figure out block size. */ - if (f_longform || f_size) { + /* If -i, -l or -s, figure out block size. */ + if (f_inode || f_longform || f_size) { if (f_kblocks) blocksize = 2; else { @@ -561,9 +573,10 @@ display(const FTSENT *p, FTSENT *list, i NAMES *np; off_t maxsize; long maxblock; - u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; + uintmax_t maxinode; + u_long btotal, labelstrlen, maxlen, maxnlink; u_long maxlabelstr; - u_int devstrlen; + u_int sizelen; int maxflags; gid_t maxgroup; uid_t maxuser; @@ -572,7 +585,6 @@ display(const FTSENT *p, FTSENT *list, i int entries, needstats; const char *user, *group; char *flags, *labelstr = NULL; - char buf[STRBUF_SIZEOF(u_quad_t) + 1]; char ngroup[STRBUF_SIZEOF(uid_t) + 1]; char nuser[STRBUF_SIZEOF(gid_t) + 1]; @@ -581,8 +593,9 @@ display(const FTSENT *p, FTSENT *list, i btotal = 0; initmax = getenv("LS_COLWIDTHS"); /* Fields match -lios order. New ones should be added at the end. */ - maxlabelstr = maxblock = maxinode = maxlen = maxnlink = + maxlabelstr = maxblock = maxlen = maxnlink = 0; maxuser = maxgroup = maxflags = maxsize = 0; + maxinode = 0; if (initmax != NULL && *initmax != '\0') { char *initmax2, *jinitmax; int ninitmax; @@ -610,7 +623,7 @@ display(const FTSENT *p, FTSENT *list, i strcpy(initmax2, "0"); ninitmax = sscanf(jinitmax, - " %lu : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", + " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", &maxinode, &maxblock, &maxnlink, &maxuser, &maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr); f_notabs = 1; @@ -656,7 +669,8 @@ display(const FTSENT *p, FTSENT *list, i MAKENINES(maxsize); free(jinitmax); } - devstrlen = 0; + d.s_size = 0; + sizelen = 0; flags = NULL; for (cur = list, entries = 0; cur; cur = cur->fts_link) { if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) { @@ -796,14 +810,12 @@ label_out: np->group = &np->data[ulen + 1]; (void)strcpy(np->group, group); - if ((S_ISCHR(sp->st_mode) || - S_ISBLK(sp->st_mode)) && - devstrlen < DEVSTR_HEX_LEN) { - if (minor(sp->st_rdev) > 255 || - minor(sp->st_rdev) < 0) - devstrlen = DEVSTR_HEX_LEN; - else - devstrlen = DEVSTR_LEN; + if (S_ISCHR(sp->st_mode) || + S_ISBLK(sp->st_mode)) { + sizelen = snprintf(NULL, 0, + "%#jx", (uintmax_t)sp->st_rdev); + if (d.s_size < sizelen) + d.s_size = sizelen; } if (f_flags) { @@ -837,25 +849,20 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - (void)snprintf(buf, sizeof(buf), "%lu", maxblock); - d.s_block = strlen(buf); + d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; - (void)snprintf(buf, sizeof(buf), "%lu", maxinode); - d.s_inode = strlen(buf); - (void)snprintf(buf, sizeof(buf), "%lu", maxnlink); - d.s_nlink = strlen(buf); - if (f_humanval) - d.s_size = HUMANVALSTR_LEN; - else { - (void)snprintf(buf, sizeof(buf), "%ju", maxsize); - d.s_size = strlen(buf); - } - if (d.s_size < devstrlen) - d.s_size = devstrlen; + d.s_inode = snprintf(NULL, 0, "%ju", maxinode); + d.s_nlink = snprintf(NULL, 0, "%lu", maxnlink); + sizelen = f_humanval ? HUMANVALSTR_LEN : + snprintf(NULL, 0, "%ju", maxsize); + if (d.s_size < sizelen) + d.s_size = sizelen; d.s_user = maxuser; } + if (f_thousands) /* make space for commas */ + d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; Modified: stable/9/bin/ls/ls.h ============================================================================== --- stable/9/bin/ls/ls.h Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.h Mon Dec 10 03:11:19 2012 (r244075) @@ -36,8 +36,6 @@ #define NO_PRINT 1 #define HUMANVALSTR_LEN 5 -#define DEVSTR_LEN 8 -#define DEVSTR_HEX_LEN 15 extern long blocksize; /* block size units */ @@ -51,11 +49,13 @@ extern int f_longform; /* long listing extern int f_octal; /* print unprintables in octal */ extern int f_octal_escape; /* like f_octal but use C escapes if possible */ extern int f_nonprint; /* show unprintables as ? */ +extern int f_samesort; /* sort time and name in same direction */ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ extern int f_statustime; /* use time of last mode change */ +extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ extern int f_type; /* add type character for non-regular files */ Modified: stable/9/bin/ls/print.c ============================================================================== --- stable/9/bin/ls/print.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/print.c Mon Dec 10 03:11:19 2012 (r244075) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,7 +152,8 @@ printlong(const DISPLAY *dp) continue; sp = p->fts_statp; if (f_inode) - (void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino); + (void)printf("%*ju ", + dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) (void)printf("%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); @@ -327,7 +329,8 @@ printaname(const FTSENT *p, u_long inode sp = p->fts_statp; chcnt = 0; if (f_inode) - chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); + chcnt += printf("%*ju ", + (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) chcnt += printf("%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); @@ -351,16 +354,8 @@ printaname(const FTSENT *p, u_long inode static void printdev(size_t width, dev_t dev) { - char buf[DEVSTR_HEX_LEN + 1]; - if (minor(dev) > 255 || minor(dev) < 0) - (void)snprintf(buf, sizeof(buf), "%3d, 0x%08x", - major(dev), (u_int)minor(dev)); - else - (void)snprintf(buf, sizeof(buf), "%3d, %3d", - major(dev), minor(dev)); - - (void)printf("%*s ", (u_int)width, buf); + (void)printf("%#*jx ", (u_int)width, (uintmax_t)dev); } static void @@ -611,6 +606,10 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); + } else if (f_thousands) { /* with commas */ + /* This format assignment needed to work round gcc bug. */ + const char *format = "%*j'd "; + (void)printf(format, (u_int)width, bytes); } else (void)printf("%*jd ", (u_int)width, bytes); } Modified: stable/9/bin/ls/util.c ============================================================================== --- stable/9/bin/ls/util.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/util.c Mon Dec 10 03:11:19 2012 (r244075) @@ -222,9 +222,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #else - "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #endif " [file ...]\n"); exit(1); From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 11:26:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5417AFBF; Mon, 10 Dec 2012 11:26:19 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DAA28FC08; Mon, 10 Dec 2012 11:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBABQI72000282; Mon, 10 Dec 2012 11:26:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBABQIVq000281; Mon, 10 Dec 2012 11:26:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201212101126.qBABQIVq000281@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 10 Dec 2012 11:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244079 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 11:26:19 -0000 Author: pluknet Date: Mon Dec 10 11:26:18 2012 New Revision: 244079 URL: http://svnweb.freebsd.org/changeset/base/244079 Log: MFC rr243398-243399: - core(5) references sysctl debug.num_cores, but it is really debug.ncores. - [mdoc] remove hard sentence breaks. PR: docs/173831 Modified: stable/9/share/man/man5/core.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/core.5 ============================================================================== --- stable/9/share/man/man5/core.5 Mon Dec 10 07:00:46 2012 (r244078) +++ stable/9/share/man/man5/core.5 Mon Dec 10 11:26:18 2012 (r244079) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 22, 2010 +.Dd November 22, 2012 .Dt CORE 5 .Os .Sh NAME @@ -78,8 +78,9 @@ name: Machine hostname. .It Em \&%I An index starting at zero until the sysctl -.Em debug.num_cores -is reached. This can be useful for limiting the number of corefiles +.Em debug.ncores +is reached. +This can be useful for limiting the number of corefiles generated by a particular process. .It Em \&%N process name. @@ -117,9 +118,11 @@ When COMPRESS_USER_CORES is included the if core files will be compressed: .Bl -tag -width "kern.compress_user_cores_gzlevel" -compact -offset "12345" .It Em kern.compress_user_cores_gzlevel -Gzip compression level. Defaults to -1. +Gzip compression level. +Defaults to -1. .It Em kern.compress_user_cores -Actually compress user cores. Core files will have the suffix +Actually compress user cores. +Core files will have the suffix .Em .gz appended to them. .El From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 12:47:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 353FC4CE; Mon, 10 Dec 2012 12:47:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 174AF8FC1A; Mon, 10 Dec 2012 12:47:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAClXBM011941; Mon, 10 Dec 2012 12:47:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAClXoc011940; Mon, 10 Dec 2012 12:47:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212101247.qBAClXoc011940@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 10 Dec 2012 12:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244081 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 12:47:34 -0000 Author: glebius Date: Mon Dec 10 12:47:33 2012 New Revision: 244081 URL: http://svnweb.freebsd.org/changeset/base/244081 Log: Merge r242474: Remove separate paragraph on ASCII messages and instead provide this information along with messages documentation, like this done in manual pages for other netgraph nodes. Submitted by: Mamontov Roman Modified: stable/9/share/man/man4/ng_netflow.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_netflow.4 ============================================================================== --- stable/9/share/man/man4/ng_netflow.4 Mon Dec 10 12:19:03 2012 (r244080) +++ stable/9/share/man/man4/ng_netflow.4 Mon Dec 10 12:47:33 2012 (r244081) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2011 +.Dd Nov 2, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME @@ -101,15 +101,15 @@ node. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width indent -.It Dv NGM_NETFLOW_INFO +.It Dv NGM_NETFLOW_INFO Pq Ic info Returns some node statistics and the current timeout values in a .Vt "struct ng_netflow_info" . -.It Dv NGM_NETFLOW_IFINFO +.It Dv NGM_NETFLOW_IFINFO Pq Ic ifinfo Returns information about the .Va iface Ns Ar N hook. The hook number is passed as an argument. -.It Dv NGM_NETFLOW_SETDLT +.It Dv NGM_NETFLOW_SETDLT Pq Ic setdlt Sets data link type on the .Va iface Ns Ar N hook. @@ -119,7 +119,7 @@ This message type uses as an argument: .Bd -literal -offset 4n struct ng_netflow_setdlt { - uint16_t iface; /* which iface to operate on */ + uint16_t iface; /* which iface dlt change */ uint8_t dlt; /* DLT_XXX from bpf.h */ }; .Ed @@ -128,7 +128,7 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise message send operation will return an error. -.It Dv NGM_NETFLOW_SETIFINDEX +.It Dv NGM_NETFLOW_SETIFINDEX Pq Ic setifindex In some cases, .Nm may be unable to determine the input interface index of a packet. @@ -148,8 +148,8 @@ This message requires as an argument: .Bd -literal -offset 4n struct ng_netflow_setifindex { - u_int16_t iface; /* which iface to operate on */ - u_int16_t index; /* new index */ + uint16_t iface; /* which iface index change */ + uint16_t index; /* new index */ }; .Ed .Pp @@ -157,26 +157,26 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise the message send operation will return an error. -.It Dv NGM_NETFLOW_SETTIMEOUTS +.It Dv NGM_NETFLOW_SETTIMEOUTS Pq Ic settimeouts Sets values in seconds for NetFlow active/inactive timeouts. This message requires .Vt "struct ng_netflow_settimeouts" as an argument: .Bd -literal -offset 4n struct ng_netflow_settimeouts { - uint32_t inactive_timeout; - uint32_t active_timeout; + uint32_t inactive_timeout; /* flow inactive timeout */ + uint32_t active_timeout; /* flow active timeout */ }; .Ed -.It Dv NGM_NETFLOW_SETCONFIG +.It Dv NGM_NETFLOW_SETCONFIG Pq Ic setconfig Sets configuration for the specified interface. This message requires .Vt "struct ng_netflow_setconfig" as an argument: .Bd -literal -offset 4n struct ng_netflow_setconfig { - u_int16_t iface; - u_int32_t conf; + uint16_t iface; /* which iface config change */ + uint32_t conf; /* new config */ #define NG_NETFLOW_CONF_INGRESS 1 #define NG_NETFLOW_CONF_EGRESS 2 #define NG_NETFLOW_CONF_ONCE 4 @@ -193,29 +193,29 @@ NG_NETFLOW_CONF_THISONCE defines that pa if it several times passes via exactly this netflow node. Last two options are important to avoid duplicate accounting when both ingress and egress NetFlow are enabled. -.It Dv NGM_NETFLOW_SETTEMPLATE +.It Dv NGM_NETFLOW_SETTEMPLATE Pq Ic settemplate Sets various timeouts to announce data flow templates (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_settemplate" as an argument: .Bd -literal -offset 4n struct ng_netflow_settemplate { - uint16_t time; - uint16_t packets; + uint16_t time; /* max time between announce */ + uint16_t packets; /* max packets between announce */ }; .Ed .Pp Value of time field represents time in seconds to re-announce data templates. Value of packets field represents maximum packets count between re-announcing data templates. -.It Dv NGM_NETFLOW_SETMTU +.It Dv NGM_NETFLOW_SETMTU Pq Ic setmtu Sets export interface MTU to build packets of specified size (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_setmtu" as an argument: .Bd -literal -offset 4n -struct ng_netflow_settemtu { - uint16_t mtu; +struct ng_netflow_setemtu { + uint16_t mtu; /* MTU for packet */ }; .Ed .Pp @@ -229,37 +229,15 @@ not directly from See also .Sx BUGS section. -.It Dv NGM_NETFLOW_V9INFO +.It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a -.Vt "struct ng_netflow_v9info" . -.El -.Sh ASCII CONTROL MESSAGES -Most binary control messages have an -.Tn ASCII -equivalent. -The supported -.Tn ASCII -commands are: -.Pp -.Bl -tag -width ".Dv NGM_NETFLOW_SETTIMEOUTS" -compact -.It Dv NGM_NETFLOW_INFO -.Qq Li info -.It Dv NGM_NETFLOW_IFINFO -.Qq Li "ifinfo %u" -.It Dv NGM_NETFLOW_SETDLT -.Qq Li "setdlt { iface = %u dlt = %u }" -.It Dv NGM_NETFLOW_SETIFINDEX -.Qq Li "setifindex { iface = %u index = %u }" -.It Dv NGM_NETFLOW_SETTIMEOUTS -.Qq Li "settimeouts { inactive = %u active = %u }" -.It Dv NGM_NETFLOW_SETCONFIG -.Qq Li "setconfig { iface = %u conf = %u }" -.It Dv NGM_NETFLOW_SETTEMPLATE -.Qq Li "settemplate { time = %u packets = %u }" -.It Dv NGM_NETFLOW_SETMTU -.Qq Li "setmtu { mtu = %u }" -.It Dv NGM_NETFLOW_V9INFO -.Qq Li v9info +.Bd -literal -offset 4n +struct ng_netflow_v9info { + uint16_t templ_packets; /* v9 template packets */ + uint16_t templ_time; /* v9 template time */ + uint16_t mtu; /* v9 MTU */ +}; +.Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 14:36:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8C77541; Mon, 10 Dec 2012 14:36:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80708FC15; Mon, 10 Dec 2012 14:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAEaqS0033880; Mon, 10 Dec 2012 14:36:52 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAEamSL033849; Mon, 10 Dec 2012 14:36:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212101436.qBAEamSL033849@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 Dec 2012 14:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244087 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 14:36:53 -0000 Author: mm Date: Mon Dec 10 14:36:48 2012 New Revision: 244087 URL: http://svnweb.freebsd.org/changeset/base/244087 Log: MFC recent ZFS changes from illumos: 243503, 243524, 243525, 243560, 243561 MFC r243503: Illumos 13879:4eac7a87eff2 3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb() 3330 space_seg_t should have its own kmem_cache 3331 deferred frees should happen after sync_pass 1 3335 make SYNC_PASS_* constants tunable New loader-only tunables: vfs.zfs.sync_pass_deferred_free vfs.zfs.sync_pass_dont_compress vfs.zfs.sync_pass_rewrite References: https://www.illumos.org/issues/3329 https://www.illumos.org/issues/3330 https://www.illumos.org/issues/3331 https://www.illumos.org/issues/3335 MFC r243524: Import the zio nop-write improvement from Illumos. To reduce I/O, nop-write omits overwriting data if the checksum (cryptographically secure) of new data matches the checksum of existing data. It also saves space if snapshots are in use. It currently works only on datasets with enabled compression, disabled deduplication and sha256 checksums. IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 3236 zio nop-write References: https://www.illumos.org/issues/3236 MFC r243525: Add loader(8) tunable to enable/disable nopwrite functionality: vfs.zfs.nopwrite_enabled MFC r243560: Introduce a new dataset aclmode setting "restricted" to protect ACL's being destroyed or corrupted by a drive-by chmod. illumos-gate 13889:a67716f16746 3254 add support in zfs for aclmode=restricted MFC r243561: Update manpage dates in zfs.8 and zpool.8 Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:36:48 2012 (r244087) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2012 +.Dd November 26, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -754,7 +754,7 @@ If no inheritable .Tn ACE Ns s exist that affect the mode, then the mode is set in accordance to the requested mode from the application. -.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough +.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough | restricted Controls how an .Tn ACL is modified during @@ -784,6 +784,32 @@ indicates that no changes are made to th other than creating or updating the necessary .Tn ACL entries to represent the new mode of the file or directory. +An +.Sy aclmode +property of +.Cm restricted +will cause the +.Xr chmod 2 +operation to return an error when used on any file or directory which has +a non-trivial +.Tn ACL +whose entries can not be represented by a mode. +.Xr chmod 2 +is required to change the set user ID, set group ID, or sticky bits on a file +or directory, as they do not have equivalent +.Tn ACL +entries. +In order to use +.Xr chmod 2 +on a file or directory with a non-trivial +.Tn ACL +when +.Sy aclmode +is set to +.Cm restricted , +you must first remove all +.Tn ACL +entries which do not represent the current mode. .It Sy atime Ns = Ns Cm on | off Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:36:48 2012 (r244087) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2011 +.Dd November 15, 2012 .Dt ZPOOL 8 .Os .Sh NAME Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:36:48 2012 (r244087) @@ -204,6 +204,7 @@ enum ztest_io_type { ZTEST_IO_WRITE_ZEROES, ZTEST_IO_TRUNCATE, ZTEST_IO_SETATTR, + ZTEST_IO_REWRITE, ZTEST_IO_TYPES }; @@ -1859,6 +1860,12 @@ ztest_get_data(void *arg, lr_write_t *lr DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -2004,6 +2011,9 @@ ztest_remove(ztest_ds_t *zd, ztest_od_t continue; } + /* + * No object was found. + */ if (od->od_object == 0) continue; @@ -2119,6 +2129,7 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t static void ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset) { + int err; ztest_block_tag_t wbt; dmu_object_info_t doi; enum ztest_io_type io_type; @@ -2171,6 +2182,25 @@ ztest_io(ztest_ds_t *zd, uint64_t object case ZTEST_IO_SETATTR: (void) ztest_setattr(zd, object); break; + + case ZTEST_IO_REWRITE: + (void) rw_rdlock(&ztest_name_lock); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_COMPRESSION, + ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + (void) rw_unlock(&ztest_name_lock); + + VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data, + DMU_READ_NO_PREFETCH)); + + (void) ztest_write(zd, object, offset, blocksize, data); + break; } (void) rw_unlock(&zd->zd_zilog_lock); @@ -2258,7 +2288,12 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; - VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); + /* + * We grab the zd_dirobj_lock to ensure that no other thread is + * updating the zil (i.e. adding in-memory log records) and the + * zd_zilog_lock to block any I/O. + */ + VERIFY0(mutex_lock(&zd->zd_dirobj_lock)); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -4906,8 +4941,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ */ for (int i = 0; i < copies; i++) { uint64_t offset = i * blocksize; - VERIFY(dmu_buf_hold(os, object, offset, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db, + DMU_READ_NO_PREFETCH)); ASSERT(db->db_offset == offset); ASSERT(db->db_size == blocksize); ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) || @@ -4923,8 +4958,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ /* * Find out what block we got. */ - VERIFY(dmu_buf_hold(os, object, 0, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, 0, FTAG, &db, + DMU_READ_NO_PREFETCH)); blk = *((dmu_buf_impl_t *)db)->db_blkptr; dmu_buf_rele(db, FTAG); @@ -5602,6 +5637,8 @@ ztest_freeze(void) kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); VERIFY3U(0, ==, ztest_dataset_open(0)); + spa->spa_debug = B_TRUE; + ztest_spa = spa; /* * Force the first log block to be transactionally allocated. Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:36:48 2012 (r244087) @@ -109,6 +109,7 @@ zfs_prop_init(void) { "discard", ZFS_ACL_DISCARD }, { "groupmask", ZFS_ACL_GROUPMASK }, { "passthrough", ZFS_ACL_PASSTHROUGH }, + { "restricted", ZFS_ACL_RESTRICTED }, { NULL } }; @@ -217,7 +218,8 @@ zfs_prop_init(void) "hidden | visible", "SNAPDIR", snapdir_table); zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); + "discard | groupmask | passthrough | restricted", "ACLMODE", + acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 10 14:36:48 2012 (r244087) @@ -3606,6 +3606,12 @@ arc_write_done(zio_t *zio) arc_hdr_destroy(exists); exists = buf_hash_insert(hdr, &hash_lock); ASSERT3P(exists, ==, NULL); + } else if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + /* nopwrite */ + ASSERT(zio->io_prop.zp_nopwrite); + if (!BP_EQUAL(&zio->io_bp_orig, zio->io_bp)) + panic("bad nopwrite, hdr=%p exists=%p", + (void *)hdr, (void *)exists); } else { /* Dedup */ ASSERT(hdr->b_datacnt == 1); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 10 14:36:48 2012 (r244087) @@ -768,13 +768,15 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp)) { + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { spa_t *spa; DB_GET_SPA(&spa, db); zio_free(spa, txg, bp); } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; + dr->dt.dl.dr_nopwrite = B_FALSE; + /* * Release the already-written buffer, so we leave it in * a consistent dirty state. Note that all callers are @@ -2172,6 +2174,13 @@ dmu_buf_freeable(dmu_buf_t *dbuf) return (res); } +blkptr_t * +dmu_buf_get_blkptr(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + return (dbi->db_blkptr); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { @@ -2514,7 +2523,11 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b ASSERT0(zio->io_error); ASSERT(db->db_blkptr == bp); - if (zio->io_flags & ZIO_FLAG_IO_REWRITE) { + /* + * For nopwrites and rewrites we ensure that the bp matches our + * original and bypass all the accounting. + */ + if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { objset_t *os; @@ -2705,7 +2718,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, - dr->dt.dl.dr_copies); + dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Dec 10 14:36:48 2012 (r244087) @@ -40,11 +40,21 @@ #include #include #include +#include #include #ifdef _KERNEL #include #endif +/* + * Enable/disable nopwrite feature. + */ +int zfs_nopwrite_enabled = 1; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled); +SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, + &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -1287,6 +1297,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf mutex_enter(&db->db_mtx); ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC); if (zio->io_error == 0) { + dr->dt.dl.dr_nopwrite = !!(zio->io_flags & ZIO_FLAG_NOPWRITE); + if (dr->dt.dl.dr_nopwrite) { + blkptr_t *bp = zio->io_bp; + blkptr_t *bp_orig = &zio->io_bp_orig; + uint8_t chksum = BP_GET_CHECKSUM(bp_orig); + + ASSERT(BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); + ASSERT(zio_checksum_table[chksum].ci_dedup); + } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; @@ -1308,11 +1328,22 @@ dmu_sync_late_arrival_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; dmu_sync_arg_t *dsa = zio->io_private; + blkptr_t *bp_orig = &zio->io_bp_orig; if (zio->io_error == 0 && !BP_IS_HOLE(bp)) { - ASSERT(zio->io_bp->blk_birth == zio->io_txg); - ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); - zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + /* + * If we didn't allocate a new block (i.e. ZIO_FLAG_NOPWRITE) + * then there is nothing to do here. Otherwise, free the + * newly allocated block in this txg. + */ + if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + ASSERT(BP_EQUAL(bp, bp_orig)); + } else { + ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_bp->blk_birth == zio->io_txg); + ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); + zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + } } dmu_tx_commit(dsa->dsa_tx); @@ -1357,7 +1388,7 @@ dmu_sync_late_arrival(zio_t *pio, objset * * Return values: * - * EEXIST: this txg has already been synced, so there's nothing to to. + * EEXIST: this txg has already been synced, so there's nothing to do. * The caller should not log the write. * * ENOENT: the block was dbuf_free_range()'d, so there's nothing to do. @@ -1389,7 +1420,6 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s dnode_t *dn; ASSERT(pio != NULL); - ASSERT(BP_IS_HOLE(bp)); ASSERT(txg != 0); SET_BOOKMARK(&zb, ds->ds_object, @@ -1444,6 +1474,23 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s return (ENOENT); } + ASSERT(dr->dr_next == NULL || dr->dr_next->dr_txg < txg); + + /* + * Assume the on-disk data is X, the current syncing data is Y, + * and the current in-memory data is Z (currently in dmu_sync). + * X and Z are identical but Y is has been modified. Normally, + * when X and Z are the same we will perform a nopwrite but if Y + * is different we must disable nopwrite since the resulting write + * of Y to disk can free the block containing X. If we allowed a + * nopwrite to occur the block pointing to Z would reference a freed + * block. Since this is a rare case we simplify this by disabling + * nopwrite if the current dmu_sync-ing dbuf has been modified in + * a previous transaction. + */ + if (dr->dr_next) + zp.zp_nopwrite = B_FALSE; + ASSERT(dr->dr_txg == txg); if (dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC || dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { @@ -1519,7 +1566,6 @@ dmu_object_set_compress(objset_t *os, ui int zfs_mdcomp_disable = 0; TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable); -SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); @@ -1532,15 +1578,27 @@ dmu_write_policy(objset_t *os, dnode_t * enum zio_checksum checksum = os->os_checksum; enum zio_compress compress = os->os_compress; enum zio_checksum dedup_checksum = os->os_dedup_checksum; - boolean_t dedup; + boolean_t dedup = B_FALSE; + boolean_t nopwrite = B_FALSE; boolean_t dedup_verify = os->os_dedup_verify; int copies = os->os_copies; /* - * Determine checksum setting. + * We maintain different write policies for each of the following + * types of data: + * 1. metadata + * 2. preallocated blocks (i.e. level-0 blocks of a dump device) + * 3. all other level 0 blocks */ if (ismd) { /* + * XXX -- we should design a compression algorithm + * that specializes in arrays of bps. + */ + compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : + ZIO_COMPRESS_LZJB; + + /* * Metadata always gets checksummed. If the data * checksum is multi-bit correctable, and it's not a * ZBT-style checksum, then it's suitable for metadata @@ -1550,45 +1608,47 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; - } else { - checksum = zio_checksum_select(dn->dn_checksum, checksum); - } + } else if (wp & WP_NOFILL) { + ASSERT(level == 0); - /* - * Determine compression setting. - */ - if (ismd) { /* - * XXX -- we should design a compression algorithm - * that specializes in arrays of bps. + * If we're writing preallocated blocks, we aren't actually + * writing them so don't set any policy properties. These + * blocks are currently only used by an external subsystem + * outside of zfs (i.e. dump) and not written by the zio + * pipeline. */ - compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : - ZIO_COMPRESS_LZJB; + compress = ZIO_COMPRESS_OFF; + checksum = ZIO_CHECKSUM_OFF; } else { compress = zio_compress_select(dn->dn_compress, compress); - } - /* - * Determine dedup setting. If we are in dmu_sync(), we won't - * actually dedup now because that's all done in syncing context; - * but we do want to use the dedup checkum. If the checksum is not - * strong enough to ensure unique signatures, force dedup_verify. - */ - dedup = (!ismd && dedup_checksum != ZIO_CHECKSUM_OFF); - if (dedup) { - checksum = dedup_checksum; - if (!zio_checksum_table[checksum].ci_dedup) - dedup_verify = 1; - } + checksum = (dedup_checksum == ZIO_CHECKSUM_OFF) ? + zio_checksum_select(dn->dn_checksum, checksum) : + dedup_checksum; - if (wp & WP_DMU_SYNC) - dedup = 0; + /* + * Determine dedup setting. If we are in dmu_sync(), + * we won't actually dedup now because that's all + * done in syncing context; but we do want to use the + * dedup checkum. If the checksum is not strong + * enough to ensure unique signatures, force + * dedup_verify. + */ + if (dedup_checksum != ZIO_CHECKSUM_OFF) { + dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; + if (!zio_checksum_table[checksum].ci_dedup) + dedup_verify = B_TRUE; + } - if (wp & WP_NOFILL) { - ASSERT(!ismd && level == 0); - checksum = ZIO_CHECKSUM_OFF; - compress = ZIO_COMPRESS_OFF; - dedup = B_FALSE; + /* + * Enable nopwrite if we have a cryptographically secure + * checksum that has no known collisions (i.e. SHA-256) + * and compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually exclusive. + */ + nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } zp->zp_checksum = checksum; @@ -1598,6 +1658,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; + zp->zp_nopwrite = nopwrite; } int Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:36:48 2012 (r244087) @@ -440,7 +440,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * clean up our in-memory structures accumulated while syncing: * * - move dead blocks from the pending deadlist to the on-disk deadlist - * - clean up zil records * - release hold from dsl_dataset_dirty() */ while (ds = list_remove_head(&synced_datasets)) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:36:48 2012 (r244087) @@ -881,8 +881,9 @@ metaslab_activate(metaslab_t *msp, uint6 if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { space_map_load_wait(sm); if (!sm->sm_loaded) { - int error = space_map_load(sm, sm_ops, SM_FREE, - &msp->ms_smo, + space_map_obj_t *smo = &msp->ms_smo; + + int error = space_map_load(sm, sm_ops, SM_FREE, smo, spa_meta_objset(msp->ms_group->mg_vd->vdev_spa)); if (error) { metaslab_group_sort(msp->ms_group, msp, 0); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 10 14:36:48 2012 (r244087) @@ -138,6 +138,7 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* u uint_t zio_taskq_basedc = 80; /* base duty cycle */ boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ +extern int zfs_sync_pass_deferred_free; /* * This (illegal) pool name is used when temporarily importing a spa_t in order @@ -6227,7 +6228,7 @@ spa_sync(spa_t *spa, uint64_t txg) spa_errlog_sync(spa, txg); dsl_pool_sync(dp, txg); - if (pass <= SYNC_PASS_DEFERRED_FREE) { + if (pass < zfs_sync_pass_deferred_free) { zio_t *zio = zio_root(spa, NULL, NULL, 0); bplist_iterate(free_bpl, spa_free_sync_cb, zio, tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:36:48 2012 (r244087) @@ -1619,6 +1619,7 @@ spa_init(int mode) #endif /* illumos */ refcount_sysinit(); unique_init(); + space_map_init(); zio_init(); dmu_init(); zil_init(); @@ -1641,6 +1642,7 @@ spa_fini(void) zil_fini(); dmu_fini(); zio_fini(); + space_map_fini(); unique_fini(); refcount_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:36:48 2012 (r244087) @@ -32,6 +32,23 @@ #include #include +static kmem_cache_t *space_seg_cache; + +void +space_map_init(void) +{ + ASSERT(space_seg_cache == NULL); + space_seg_cache = kmem_cache_create("space_seg_cache", + sizeof (space_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +space_map_fini(void) +{ + kmem_cache_destroy(space_seg_cache); + space_seg_cache = NULL; +} + /* * Space map routines. * NOTE: caller is responsible for all locking. @@ -124,7 +141,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); } ss_after->ss_start = ss_before->ss_start; - kmem_free(ss_before, sizeof (*ss_before)); + kmem_cache_free(space_seg_cache, ss_before); ss = ss_after; } else if (merge_before) { ss_before->ss_end = end; @@ -137,7 +154,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); ss = ss_after; } else { - ss = kmem_alloc(sizeof (*ss), KM_SLEEP); + ss = kmem_cache_alloc(space_seg_cache, KM_SLEEP); ss->ss_start = start; ss->ss_end = end; avl_insert(&sm->sm_root, ss, where); @@ -183,7 +200,7 @@ space_map_remove(space_map_t *sm, uint64 avl_remove(sm->sm_pp_root, ss); if (left_over && right_over) { - newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP); + newseg = kmem_cache_alloc(space_seg_cache, KM_SLEEP); newseg->ss_start = end; newseg->ss_end = ss->ss_end; ss->ss_end = start; @@ -196,7 +213,7 @@ space_map_remove(space_map_t *sm, uint64 ss->ss_start = end; } else { avl_remove(&sm->sm_root, ss); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); ss = NULL; } @@ -236,7 +253,7 @@ space_map_vacate(space_map_t *sm, space_ while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { if (func != NULL) func(mdest, ss->ss_start, ss->ss_end - ss->ss_start); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } sm->sm_space = 0; } @@ -408,7 +425,7 @@ space_map_sync(space_map_t *sm, uint8_t spa_t *spa = dmu_objset_spa(os); void *cookie = NULL; space_seg_t *ss; - uint64_t bufsize, start, size, run_len; + uint64_t bufsize, start, size, run_len, delta, sm_space; uint64_t *entry, *entry_map, *entry_map_end; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -437,11 +454,13 @@ space_map_sync(space_map_t *sm, uint8_t SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx)); + delta = 0; + sm_space = sm->sm_space; while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { size = ss->ss_end - ss->ss_start; start = (ss->ss_start - sm->sm_start) >> sm->sm_shift; - sm->sm_space -= size; + delta += size; size >>= sm->sm_shift; while (size) { @@ -463,7 +482,7 @@ space_map_sync(space_map_t *sm, uint8_t start += run_len; size -= run_len; } - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } if (entry != entry_map) { @@ -475,8 +494,15 @@ space_map_sync(space_map_t *sm, uint8_t smo->smo_objsize += size; } + /* + * Ensure that the space_map's accounting wasn't changed + * while we were in the middle of writing it out. + */ + VERIFY3U(sm->sm_space, ==, sm_space); + zio_buf_free(entry_map, bufsize); + sm->sm_space -= delta; VERIFY0(sm->sm_space); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:36:48 2012 (r244087) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DBUF_H @@ -130,6 +131,7 @@ typedef struct dbuf_dirty_record { blkptr_t dr_overridden_by; override_states_t dr_override_state; uint8_t dr_copies; + boolean_t dr_nopwrite; } dl; } dt; } dbuf_dirty_record_t; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:36:48 2012 (r244087) @@ -505,6 +505,11 @@ void dmu_evict_user(objset_t *os, dmu_bu void *dmu_buf_get_user(dmu_buf_t *db); /* + * Returns the blkptr associated with this dbuf, or NULL if not set. + */ +struct blkptr *dmu_buf_get_blkptr(dmu_buf_t *db); + +/* * Indicate that you are going to modify the buffer's data (db_data). * * The transaction (tx) must be assigned to a txg (ie. you've called Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:36:48 2012 (r244087) @@ -21,7 +21,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:36:48 2012 (r244087) @@ -489,14 +489,6 @@ extern int spa_scan_stop(spa_t *spa); extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ extern void spa_sync_allpools(void); -/* - * DEFERRED_FREE must be large enough that regular blocks are not - * deferred. XXX so can't we change it back to 1? - */ -#define SYNC_PASS_DEFERRED_FREE 2 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* spa namespace global mutex */ extern kmutex_t spa_namespace_lock; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:36:48 2012 (r244087) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPACE_MAP_H #define _SYS_SPACE_MAP_H @@ -136,6 +140,8 @@ struct space_map_ops { typedef void space_map_func_t(space_map_t *sm, uint64_t start, uint64_t size); +extern void space_map_init(void); +extern void space_map_fini(void); extern void space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift, kmutex_t *lp); extern void space_map_destroy(space_map_t *sm); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:36:48 2012 (r244087) @@ -186,7 +186,9 @@ enum zio_flag { ZIO_FLAG_RAW = 1 << 21, ZIO_FLAG_GANG_CHILD = 1 << 22, ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24 + ZIO_FLAG_GODFATHER = 1 << 24, + ZIO_FLAG_NOPWRITE = 1 << 25, + ZIO_FLAG_REEXECUTED = 1 << 26, }; #define ZIO_FLAG_MUSTSUCCEED 0 @@ -285,8 +287,9 @@ typedef struct zio_prop { dmu_object_type_t zp_type; uint8_t zp_level; uint8_t zp_copies; - uint8_t zp_dedup; - uint8_t zp_dedup_verify; + boolean_t zp_dedup; + boolean_t zp_dedup_verify; + boolean_t zp_nopwrite; } zio_prop_t; typedef struct zio_cksum_report zio_cksum_report_t; @@ -454,7 +457,8 @@ extern zio_t *zio_rewrite(zio_t *pio, sp void *data, uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, zbookmark_t *zb); -extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies); +extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, + boolean_t nopwrite); extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:36:48 2012 (r244087) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _ZIO_IMPL_H #define _ZIO_IMPL_H @@ -34,6 +38,70 @@ extern "C" { #endif /* + * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * + * The ZFS I/O pipeline is comprised of various stages which are defined + * in the zio_stage enum below. The individual stages are used to construct + * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. + * + * I/O operations: (XXX - provide detail for each of the operations) + * + * Read: + * Write: + * Free: + * Claim: + * Ioctl: + * + * Although the most common pipeline are used by the basic I/O operations + * above, there are some helper pipelines (one could consider them + * sub-pipelines) which are used internally by the ZIO module and are + * explained below: + * + * Interlock Pipeline: + * The interlock pipeline is the most basic pipeline and is used by all + * of the I/O operations. The interlock pipeline does not perform any I/O + * and is used to coordinate the dependencies between I/Os that are being + * issued (i.e. the parent/child relationship). + * + * Vdev child Pipeline: + * The vdev child pipeline is responsible for performing the physical I/O. + * It is in this pipeline where the I/O are queued and possibly cached. + * + * In addition to performing I/O, the pipeline is also responsible for + * data transformations. The transformations performed are based on the + * specific properties that user may have selected and modify the + * behavior of the pipeline. Examples of supported transformations are + * compression, dedup, and nop writes. Transformations will either modify + * the data or the pipeline. This list below further describes each of + * the supported transformations: + * + * Compression: + * ZFS supports three different flavors of compression -- gzip, lzjb, and + * zle. Compression occurs as part of the write pipeline and is performed + * in the ZIO_STAGE_WRITE_BP_INIT stage. + * + * Dedup: + * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and + * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing + * read pipeline if the dedup bit is set on the block pointer. + * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage + * and added to a write pipeline if a user has enabled dedup on that + * particular dataset. + * + * NOP Write: + * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage + * and is added to an existing write pipeline if a crypographically + * secure checksum (i.e. SHA256) is enabled and compression is turned on. + * The NOP write stage will compare the checksums of the current data + * on-disk (level-0 blocks only) and the data that is currently being written. + * If the checksum values are identical then the pipeline is converted to + * an interlock pipeline skipping block allocation and bypassing the + * physical I/O. The nop write feature can handle writes in either + * syncing or open context (i.e. zil writes) and as a result is mutually + * exclusive with dedup. + */ + +/* * zio pipeline stage definitions */ enum zio_stage { @@ -46,27 +114,29 @@ enum zio_stage { ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ - ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */ - ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */ - ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */ - ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */ + ZIO_STAGE_NOP_WRITE = 1 << 6, /* -W--- */ - ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */ - ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */ + ZIO_STAGE_DDT_READ_START = 1 << 7, /* R---- */ + ZIO_STAGE_DDT_READ_DONE = 1 << 8, /* R---- */ + ZIO_STAGE_DDT_WRITE = 1 << 9, /* -W--- */ + ZIO_STAGE_DDT_FREE = 1 << 10, /* --F-- */ - ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */ - ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */ - ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */ + ZIO_STAGE_GANG_ASSEMBLE = 1 << 11, /* RWFC- */ + ZIO_STAGE_GANG_ISSUE = 1 << 12, /* RWFC- */ - ZIO_STAGE_READY = 1 << 15, /* RWFCI */ + ZIO_STAGE_DVA_ALLOCATE = 1 << 13, /* -W--- */ + ZIO_STAGE_DVA_FREE = 1 << 14, /* --F-- */ + ZIO_STAGE_DVA_CLAIM = 1 << 15, /* ---C- */ - ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RW--I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--- */ - ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RW--I */ + ZIO_STAGE_READY = 1 << 16, /* RWFCI */ - ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ + ZIO_STAGE_VDEV_IO_START = 1 << 17, /* RW--I */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 18, /* RW--- */ + ZIO_STAGE_VDEV_IO_ASSESS = 1 << 19, /* RW--I */ - ZIO_STAGE_DONE = 1 << 20 /* RWFCI */ + ZIO_STAGE_CHECKSUM_VERIFY = 1 << 20, /* R---- */ + + ZIO_STAGE_DONE = 1 << 21 /* RWFCI */ }; #define ZIO_INTERLOCK_STAGES \ @@ -143,6 +213,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 10 14:36:48 2012 (r244087) @@ -1206,6 +1206,12 @@ zfs_get_data(void *arg, lr_write_t *lr, DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -3254,6 +3260,12 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED && + !(zp->z_pflags & ZFS_ACL_TRIVIAL)) { + err = EPERM; + goto out; + } + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) goto out; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:36:48 2012 (r244087) @@ -89,6 +89,31 @@ extern vmem_t *zio_alloc_arena; extern int zfs_mg_alloc_failures; /* + * The following actions directly effect the spa's sync-to-convergence logic. + * The values below define the sync pass when we start performing the action. + * Care should be taken when changing these values as they directly impact + * spa_sync() performance. Tuning these values may introduce subtle performance + * pathologies and should only be done in the context of performance analysis. + * These tunables will eventually be removed and replaced with #defines once + * enough analysis has been done to determine optimal values. + * + * The 'zfs_sync_pass_deferred_free' pass must be greater than 1 to ensure that + * regular blocks are not deferred. + */ +int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_deferred_free", &zfs_sync_pass_deferred_free); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_deferred_free, CTLFLAG_RDTUN, + &zfs_sync_pass_deferred_free, 0, "defer frees starting in this pass"); +int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_dont_compress", &zfs_sync_pass_dont_compress); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_dont_compress, CTLFLAG_RDTUN, + &zfs_sync_pass_dont_compress, 0, "don't compress starting in this pass"); +int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_rewrite", &zfs_sync_pass_rewrite); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_rewrite, CTLFLAG_RDTUN, + &zfs_sync_pass_rewrite, 0, "rewrite new bps starting in this pass"); + +/* * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ @@ -650,9 +675,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 19:33:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09F5F1A9; Mon, 10 Dec 2012 19:33:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E23508FC0C; Mon, 10 Dec 2012 19:33:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAJXeNb095902; Mon, 10 Dec 2012 19:33:40 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAJXehD095898; Mon, 10 Dec 2012 19:33:40 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201212101933.qBAJXehD095898@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 10 Dec 2012 19:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244093 - in stable/9/sys: cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 19:33:41 -0000 Author: gnn Date: Mon Dec 10 19:33:39 2012 New Revision: 244093 URL: http://svnweb.freebsd.org/changeset/base/244093 Log: MFC: 238537,238552 Add support for walltimestamp in DTrace. Submitted by: Fabian Keil Includes correction by: avg Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/9/sys/kern/kern_tc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 10 19:33:39 2012 (r244093) @@ -43,6 +43,8 @@ extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -456,8 +458,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ Modified: stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 10 19:33:39 2012 (r244093) @@ -45,6 +45,8 @@ extern uintptr_t kernelbase; extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -457,8 +459,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ Modified: stable/9/sys/kern/kern_tc.c ============================================================================== --- stable/9/sys/kern/kern_tc.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/kern/kern_tc.c Mon Dec 10 19:33:39 2012 (r244093) @@ -110,6 +110,8 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, static void tc_windup(void); static void cpu_tick_calibrate(int); +void dtrace_getnanotime(struct timespec *tsp); + static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) { @@ -303,6 +305,24 @@ getmicrotime(struct timeval *tvp) } /* + * This is a clone of getnanotime and used for walltimestamps. + * The dtrace_ prefix prevents fbt from creating probes for + * it so walltimestamp can be safely used in all fbt probes. + */ +void +dtrace_getnanotime(struct timespec *tsp) +{ + struct timehands *th; + u_int gen; + + do { + th = timehands; + gen = th->th_generation; + *tsp = th->th_nanotime; + } while (gen == 0 || gen != th->th_generation); +} + +/* * Initialize a new timecounter and possibly use it. */ void From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 21:18:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9F3DED4; Mon, 10 Dec 2012 21:18:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC2D08FC16; Mon, 10 Dec 2012 21:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBALI2ed015691; Mon, 10 Dec 2012 21:18:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBALI2Rk015690; Mon, 10 Dec 2012 21:18:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201212102118.qBALI2Rk015690@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 10 Dec 2012 21:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244097 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 21:18:02 -0000 Author: gnn Date: Mon Dec 10 21:18:02 2012 New Revision: 244097 URL: http://svnweb.freebsd.org/changeset/base/244097 Log: MFC: 238979 When we return with an error we cannot unlock the mutex, because it's been freed. Protect against that, hopefully unlikely, case. Reviewed by: rpaulo Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Mon Dec 10 20:52:52 2012 (r244096) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Mon Dec 10 21:18:02 2012 (r244097) @@ -942,7 +942,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, (int)dpr->dpr_pid, strerror(err)); } - (void) pthread_mutex_unlock(&dpr->dpr_lock); + if (err == 0) + (void) pthread_mutex_unlock(&dpr->dpr_lock); (void) pthread_attr_destroy(&a); return (err); From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 22:13:14 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20BAD44C; Mon, 10 Dec 2012 22:13:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E0F338FC17; Mon, 10 Dec 2012 22:13:13 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5DA81B94A; Mon, 10 Dec 2012 17:13:13 -0500 (EST) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles Date: Mon, 10 Dec 2012 16:56:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212101656.04306.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 10 Dec 2012 17:13:13 -0500 (EST) Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:13:14 -0000 On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: > On 26 October 2012 10:10, Nathan Whitehorn wrote: > > No. It is staying for the duration of the branch. So this MFC may have been > > premature. > > As I said previously: I MFCed this because it is a low-impact change > and it makes future MFCs easier in the event that the fortune file > changes again. I think it is fine to start training users to not use sysintall, but when doing an MFC like this, you need to refine the message to be relevant to the branch you are merging to if needed. Blindly copying and pasting the original message is nomt always appropriate. -- John Baldwin From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 22:19:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0AF327B1 for ; Mon, 10 Dec 2012 22:19:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8428FC21 for ; Mon, 10 Dec 2012 22:19:32 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3056150lah.13 for ; Mon, 10 Dec 2012 14:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=JL9nQsoBWMbwG+I5QMU1rmr7UNhAJaYmlXi6S2xwjNk=; b=m3t+k0b9xYRYlWS7yVVOXmasIgeqZJz+LGl59z586BrJiKCJM/ETQMLyP2sDDtXPjY UAmgbr5Q+/7D2FqpT26qcHYm2dW1XHxuZXOjzrcT+V6/5yr0xZsjsIuvs4L1mSxXIisO ARdG+NP4b1O4wKKPh3b9dDSCmSFl4CvEbEuc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=JL9nQsoBWMbwG+I5QMU1rmr7UNhAJaYmlXi6S2xwjNk=; b=nNb4NxYydSZxyg/gtU2GTvKcotWUrv+0ZKrFGILR1YpZy7VbCijO0ORgO/Tgre+qya 5dfszjFPpoDxll7RU4w+BLQp+fqxfaJ8HTdwI3aXHqbaF+jfr3em4Xg43g6R8sE5vUNQ gFg0mmro5aj2U6YiM2faaGuDj2COC4Br9QPR+rohZWmGLnRAX1wwfe+qlwg/1y3qb1tn IWWRocnbl2WX/MlN5MXaFfnBXoSKh3kSQTZOcV+O0p4gYkIFZGEc7WvuNzdGn3WaDDRy /qsVo/5oOGmPD6Ub3p7GnAN8vz+1Qi75QOWz3oyPxnzg39XSUzqW50tjlgX6fCKsXHV/ CjQg== Received: by 10.152.144.201 with SMTP id so9mr15459536lab.24.1355177971147; Mon, 10 Dec 2012 14:19:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.43.229 with HTTP; Mon, 10 Dec 2012 14:19:00 -0800 (PST) In-Reply-To: <201212101656.04306.jhb@freebsd.org> References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> <201212101656.04306.jhb@freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 17:19:00 -0500 X-Google-Sender-Auth: -JoG_YibfABoE03aLdl0y3_Horc Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl44JAN5DbrlvIiM9XEPdwuTDXlwTxoRks/VxHPUleTmbNDvvSKipB4YWD2TKVbJx9kMyKv Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:19:33 -0000 On 10 December 2012 16:56, John Baldwin wrote: > On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: >> On 26 October 2012 10:10, Nathan Whitehorn wrote: >> > No. It is staying for the duration of the branch. So this MFC may have been >> > premature. >> >> As I said previously: I MFCed this because it is a low-impact change >> and it makes future MFCs easier in the event that the fortune file >> changes again. > > I think it is fine to start training users to not use sysintall, but > when doing an MFC like this, you need to refine the message to be > relevant to the branch you are merging to if needed. Blindly > copying and pasting the original message is nomt always appropriate. See r242109 and r242110: I clarified it in those commits. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 10 22:23:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CB6BC8E for ; Mon, 10 Dec 2012 22:23:50 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D6B1D8FC1A for ; Mon, 10 Dec 2012 22:23:49 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3062307lah.13 for ; Mon, 10 Dec 2012 14:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=53Iua9Nqj8kG9CXRHsGDxT4XLj7zbm4Bi0xB+t9RsDw=; b=sA72HiM+4q6afSof4wYYMuXowc0W82G4PM5qkIi2Sd56Icn2Lk2LJmJkKAJbBcC33O /XaaOInIXhvbv7IxZxmOoFPI2Sq83b4ry5++wfR1wTWNUwjTpkTyhok04LC6G4CcHHmz CZa2fOrUtJHtbQ2j43RqyX/gsq9jkw10/2kUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=53Iua9Nqj8kG9CXRHsGDxT4XLj7zbm4Bi0xB+t9RsDw=; b=lpTV3WHeH9EgSq8LWk2sE70cp/7sv7vpk9GiuKZAiKq3vfq1wL27xvapycg5pW//rZ dQM52X866P6mkdyikouUBzNWp+Afulqgbk1/KHErnk8/voeVSr+BJ3EV5aZG17Bcl1LE /U+/9/KG0PdP3ssGVeD518/rk++CBqhqefa2xOfrbLPLClgfGRDUlSR334nPVGHKMMtt YkuaU7UQ0AvHshQo/4fBu9bb38uE/emwd4rR4uMsC3xeRPWzFc0fpcPegSlatuOj0fm2 3tfiosLNAMf5AxS5+SLWeCmXNhMKysAcoiT9/Ww5Pc907IouKg+DzsZntb7rcsXIgnuM PXbA== Received: by 10.112.29.104 with SMTP id j8mr6822561lbh.0.1355178228684; Mon, 10 Dec 2012 14:23:48 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.43.229 with HTTP; Mon, 10 Dec 2012 14:23:18 -0800 (PST) In-Reply-To: References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> <201212101656.04306.jhb@freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 17:23:18 -0500 X-Google-Sender-Auth: nI0Dd8IbtZR5aWPi1t5LlKDdGCw Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk710SZqlG8xNMZzLU2knFOna2YHiV6AtQFtXD4+u0AWCf2ivnrDHsRO5cz9JyqlCYB+srK Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:23:50 -0000 On 10 December 2012 17:19, Eitan Adler wrote: > On 10 December 2012 16:56, John Baldwin wrote: >> On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: >>> On 26 October 2012 10:10, Nathan Whitehorn wrote: >>> > No. It is staying for the duration of the branch. So this MFC may have been >>> > premature. >>> >>> As I said previously: I MFCed this because it is a low-impact change >>> and it makes future MFCs easier in the event that the fortune file >>> changes again. >> >> I think it is fine to start training users to not use sysintall, but >> when doing an MFC like this, you need to refine the message to be >> relevant to the branch you are merging to if needed. Blindly >> copying and pasting the original message is nomt always appropriate. > > See r242109 and r242110: I clarified it in those commits. I meant r242110 and r242111 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 01:49:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB5C3C8C; Tue, 11 Dec 2012 01:49:57 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFCA58FC13; Tue, 11 Dec 2012 01:49:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1nviU065243; Tue, 11 Dec 2012 01:49:57 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1nvGj065242; Tue, 11 Dec 2012 01:49:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201212110149.qBB1nvGj065242@svn.freebsd.org> From: Kevin Lo Date: Tue, 11 Dec 2012 01:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244107 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 01:49:57 -0000 Author: kevlo Date: Tue Dec 11 01:49:57 2012 New Revision: 244107 URL: http://svnweb.freebsd.org/changeset/base/244107 Log: MFC r235767: Add missing header needed by free(). Reported by: tinderbox Modified: stable/9/lib/libc/net/nsparser.y Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/nsparser.y ============================================================================== --- stable/9/lib/libc/net/nsparser.y Tue Dec 11 01:28:06 2012 (r244106) +++ stable/9/lib/libc/net/nsparser.y Tue Dec 11 01:49:57 2012 (r244107) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define _NS_PRIVATE #include #include +#include #include #include #include "un-namespace.h" From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 02:40:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E23767D; Tue, 11 Dec 2012 02:40:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 236398FC15; Tue, 11 Dec 2012 02:40:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB2e2PK074919; Tue, 11 Dec 2012 02:40:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB2e1Dj074917; Tue, 11 Dec 2012 02:40:01 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201212110240.qBB2e1Dj074917@svn.freebsd.org> From: Kevin Lo Date: Tue, 11 Dec 2012 02:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244108 - stable/9/bin/expr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 02:40:02 -0000 Author: kevlo Date: Tue Dec 11 02:40:01 2012 New Revision: 244108 URL: http://svnweb.freebsd.org/changeset/base/244108 Log: MFC r235771: Remove redundant declaration of yyparse. Reported by: tinderbox Modified: stable/9/bin/expr/expr.y Directory Properties: stable/9/bin/expr/ (props changed) Modified: stable/9/bin/expr/expr.y ============================================================================== --- stable/9/bin/expr/expr.y Tue Dec 11 01:49:57 2012 (r244107) +++ stable/9/bin/expr/expr.y Tue Dec 11 02:40:01 2012 (r244108) @@ -74,7 +74,6 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); -int yyparse(void); %} From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 05:11:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D44A6A9D; Tue, 11 Dec 2012 05:11:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A11BE8FC1A; Tue, 11 Dec 2012 05:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB5BSD8003910; Tue, 11 Dec 2012 05:11:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB5BSt2003909; Tue, 11 Dec 2012 05:11:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212110511.qBB5BSt2003909@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 11 Dec 2012 05:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244110 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 05:11:28 -0000 Author: kib Date: Tue Dec 11 05:11:28 2012 New Revision: 244110 URL: http://svnweb.freebsd.org/changeset/base/244110 Log: MFC r243868: Do not allocate buffer of the 255 bytes length on the stack. Modified: stable/9/sys/kern/vfs_mountroot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mountroot.c ============================================================================== --- stable/9/sys/kern/vfs_mountroot.c Tue Dec 11 04:19:51 2012 (r244109) +++ stable/9/sys/kern/vfs_mountroot.c Tue Dec 11 05:11:28 2012 (r244110) @@ -672,10 +672,11 @@ parse_mount_dev_present(const char *dev) return (error != 0) ? 0 : 1; } +#define ERRMSGL 255 static int parse_mount(char **conf) { - char errmsg[255]; + char *errmsg; struct mntarg *ma; char *dev, *fs, *opts, *tok; int delay, error, timeout; @@ -707,7 +708,7 @@ parse_mount(char **conf) printf("Trying to mount root from %s:%s [%s]...\n", fs, dev, (opts != NULL) ? opts : ""); - bzero(errmsg, sizeof(errmsg)); + errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO); if (vfs_byname(fs) == NULL) { strlcpy(errmsg, "unknown file system", sizeof(errmsg)); @@ -734,7 +735,7 @@ parse_mount(char **conf) ma = mount_arg(ma, "fstype", fs, -1); ma = mount_arg(ma, "fspath", "/", -1); ma = mount_arg(ma, "from", dev, -1); - ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); ma = mount_arg(ma, "ro", NULL, 0); ma = parse_mountroot_options(ma, opts); error = kernel_mount(ma, MNT_ROOTFS); @@ -748,11 +749,13 @@ parse_mount(char **conf) printf(".\n"); } free(fs, M_TEMP); + free(errmsg, M_TEMP); if (opts != NULL) free(opts, M_TEMP); /* kernel_mount can return -1 on error. */ return ((error < 0) ? EDOOFUS : error); } +#undef ERRMSGL static int vfs_mountroot_parse(struct sbuf *sb, struct mount *mpdevfs) From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 12:32:14 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83EAEC63; Tue, 11 Dec 2012 12:32:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 501698FC21; Tue, 11 Dec 2012 12:32:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCWEW5090957; Tue, 11 Dec 2012 12:32:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCWCsx090938; Tue, 11 Dec 2012 12:32:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111232.qBBCWCsx090938@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244115 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:32:14 -0000 Author: emaste Date: Tue Dec 11 12:32:11 2012 New Revision: 244115 URL: http://svnweb.freebsd.org/changeset/base/244115 Log: MFC r242936: Set optimized_out instead of reporting an error. This provides a better display when debugging code compiled with optimization on. GDB git revision e8395b4efd184f745070afb953f451f99e922be7 (prior to GDB's switch to GPLv3), modified for the interfaces provided by GDB 6.1.1. 2005-02-28 Daniel Jacobowitz * dwarf2loc.c (loclist_read_variable): Set optimized_out instead of reporting an error. * valprint.c (value_check_printable): New function. (common_val_print): New function. Use value_check_printable. (value_print): Use value_check_printable. * value.h (common_val_print): Add prototype. * c-valprint.c (c_val_print): Use common_val_print. * cp-valprint.c (cp_print_value_fields): Likewise. (cp_print_hpacc_virtual_table_entries): Likewise. * f-valprint.c (f_val_print): Likewise. * jv-valprint.c (java_value_print, java_print_value_fields): Likewise. * scm-valprint.c (scm_value_print): Likewise. * stack.c (print_frame_args): Likewise. * varobj.c (c_value_of_variable): Likewise. * p-valprint.c (pascal_val_print, pascal_value_print): Likewise. (pascal_object_print_value_fields): Likewise. Update call to pascal_object_print_static_field. (pascal_object_print_static_field): Remove TYPE argument. Use common_val_print. Sponsored by: ADARA Networks Modified: stable/9/contrib/gdb/gdb/c-valprint.c stable/9/contrib/gdb/gdb/cp-valprint.c stable/9/contrib/gdb/gdb/dwarf2loc.c stable/9/contrib/gdb/gdb/f-valprint.c stable/9/contrib/gdb/gdb/jv-valprint.c stable/9/contrib/gdb/gdb/p-valprint.c stable/9/contrib/gdb/gdb/scm-valprint.c stable/9/contrib/gdb/gdb/stack.c stable/9/contrib/gdb/gdb/valprint.c stable/9/contrib/gdb/gdb/value.h stable/9/contrib/gdb/gdb/varobj.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/c-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/c-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/c-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -232,9 +232,8 @@ c_val_print (struct type *type, char *va wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, + deref_ref, recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -283,15 +282,8 @@ c_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse, pretty); } else fputs_filtered ("???", stream); Modified: stable/9/contrib/gdb/gdb/cp-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -361,8 +361,7 @@ cp_print_value_fields (struct type *type (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr + offset, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), - 0, 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -426,8 +425,7 @@ cp_print_value_fields (struct type *type v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long), *(unsigned long *) (valaddr + offset)); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); fields_seen = 1; if (vtblprint) @@ -791,8 +789,7 @@ cp_print_hpacc_virtual_table_entries (st VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */ /* print out the entry */ - val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (vf, stream, format, 0, recurse + 1, pretty); field_physname = TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi); /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */ Modified: stable/9/contrib/gdb/gdb/dwarf2loc.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 12:32:11 2012 (r244115) @@ -492,9 +492,14 @@ loclist_read_variable (struct symbol *sy data = find_location_expression (dlbaton, &size, frame ? get_frame_pc (frame) : 0); if (data == NULL) - error ("Variable \"%s\" is not available.", SYMBOL_NATURAL_NAME (symbol)); - - val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, dlbaton->objfile); + { + val = allocate_value (SYMBOL_TYPE (symbol)); + VALUE_LVAL (val) = not_lval; + VALUE_OPTIMIZED_OUT (val) = 1; + } + else + val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, + dlbaton->objfile); return val; } Modified: stable/9/contrib/gdb/gdb/f-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/f-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/f-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -444,15 +444,8 @@ f_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, recurse, + pretty); } else fputs_filtered ("???", stream); Modified: stable/9/contrib/gdb/gdb/jv-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -189,8 +189,7 @@ java_value_print (struct value *val, str else fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 2, 1, pretty); + common_val_print (v, stream, format, 2, 1, pretty); things_printed++; i += reps; @@ -242,8 +241,7 @@ java_value_print (struct value *val, str return 0; } - return (val_print (type, VALUE_CONTENTS (val), 0, address, - stream, format, 1, 0, pretty)); + return common_val_print (val, stream, format, 1, 0, pretty); } /* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the @@ -391,8 +389,7 @@ java_print_value_fields (struct type *ty v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, - 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -411,9 +408,8 @@ java_print_value_fields (struct type *ty struct type *t = check_typedef (VALUE_TYPE (v)); if (TYPE_CODE (t) == TYPE_CODE_STRUCT) v = value_addr (v); - val_print (VALUE_TYPE (v), - VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v), - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, + pretty); } } else if (TYPE_FIELD_TYPE (type, i) == NULL) Modified: stable/9/contrib/gdb/gdb/p-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/p-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/p-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -238,9 +238,8 @@ pascal_val_print (struct type *type, cha wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, deref_ref, + recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -291,10 +290,8 @@ pascal_val_print (struct type *type, cha unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), 0, - VALUE_ADDRESS (deref_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse + 1, pretty); } else fputs_filtered ("???", stream); @@ -565,9 +562,7 @@ pascal_value_print (struct value *val, s fprintf_filtered (stream, ") "); } } - return val_print (type, VALUE_CONTENTS (val), VALUE_EMBEDDED_OFFSET (val), - VALUE_ADDRESS (val) + VALUE_OFFSET (val), - stream, format, 1, 0, pretty); + return common_val_print (val, stream, format, 1, 0, pretty); } @@ -583,7 +578,7 @@ static int pascal_static_field_print; /* static struct obstack dont_print_vb_obstack; static struct obstack dont_print_statmem_obstack; -static void pascal_object_print_static_field (struct type *, struct value *, +static void pascal_object_print_static_field (struct value *, struct ui_file *, int, int, enum val_prettyprint); @@ -844,8 +839,7 @@ pascal_object_print_value_fields (struct v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -864,9 +858,8 @@ pascal_object_print_value_fields (struct if (v == NULL) fputs_filtered ("", stream); else - pascal_object_print_static_field (TYPE_FIELD_TYPE (type, i), v, - stream, format, recurse + 1, - pretty); + pascal_object_print_static_field (v, stream, format, + recurse + 1, pretty); } else { @@ -1005,14 +998,16 @@ pascal_object_print_value (struct type * static member classes in an obstack and refuse to print them more than once. - VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY + VAL contains the value to print, STREAM, RECURSE, and PRETTY have the same meanings as in c_val_print. */ static void -pascal_object_print_static_field (struct type *type, struct value *val, +pascal_object_print_static_field (struct value *val, struct ui_file *stream, int format, int recurse, enum val_prettyprint pretty) { + struct type *type = VALUE_TYPE (val); + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) { CORE_ADDR *first_dont_print; @@ -1041,8 +1036,7 @@ pascal_object_print_static_field (struct stream, format, recurse, pretty, NULL, 1); return; } - val_print (type, VALUE_CONTENTS (val), 0, VALUE_ADDRESS (val), - stream, format, 0, recurse, pretty); + common_val_print (val, stream, format, 0, recurse, pretty); } void Modified: stable/9/contrib/gdb/gdb/scm-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -390,6 +390,5 @@ int scm_value_print (struct value *val, struct ui_file *stream, int format, enum val_prettyprint pretty) { - return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), stream, format, 1, 0, pretty)); + return (common_val_print (val, stream, format, 1, 0, pretty)); } Modified: stable/9/contrib/gdb/gdb/stack.c ============================================================================== --- stable/9/contrib/gdb/gdb/stack.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/stack.c Tue Dec 11 12:32:11 2012 (r244115) @@ -354,9 +354,7 @@ print_frame_args (struct symbol *func, s if (val) { - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), - stb->stream, 0, 0, 2, Val_no_prettyprint); + common_val_print (val, stb->stream, 0, 0, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); } else Modified: stable/9/contrib/gdb/gdb/valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -150,25 +150,66 @@ val_print (struct type *type, char *vala stream, format, deref_ref, recurse, pretty)); } -/* Print the value VAL in C-ish syntax on stream STREAM. - FORMAT is a format-letter, or 0 for print in natural format of data type. - If the object printed is a string pointer, returns - the number of string bytes printed. */ +/* Check whether the value VAL is printable. Return 1 if it is; + return 0 and print an appropriate error message to STREAM if it + is not. */ -int -value_print (struct value *val, struct ui_file *stream, int format, - enum val_prettyprint pretty) +static int +value_check_printable (struct value *val, struct ui_file *stream) { if (val == 0) { - printf_filtered ("
"); + fprintf_filtered (stream, "
"); return 0; } + if (VALUE_OPTIMIZED_OUT (val)) { - printf_filtered (""); + fprintf_filtered (stream, ""); return 0; } + + return 1; +} + +/* Print the value VAL onto stream STREAM according to FORMAT (a + letter, or 0 for natural format using TYPE). + + If DEREF_REF is nonzero, then dereference references, otherwise just print + them like pointers. + + The PRETTY parameter controls prettyprinting. + + If the data are a string pointer, returns the number of string characters + printed. + + This is a preferable interface to val_print, above, because it uses + GDB's value mechanism. */ + +int +common_val_print (struct value *val, struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + + return val_print (VALUE_TYPE(val), VALUE_CONTENTS_ALL (val), + VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val), + stream, format, deref_ref, recurse, pretty); +} + +/* Print the value VAL in C-ish syntax on stream STREAM. + FORMAT is a format-letter, or 0 for print in natural format of data type. + If the object printed is a string pointer, returns + the number of string bytes printed. */ + +int +value_print (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + return LA_VALUE_PRINT (val, stream, format, pretty); } Modified: stable/9/contrib/gdb/gdb/value.h ============================================================================== --- stable/9/contrib/gdb/gdb/value.h Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/value.h Tue Dec 11 12:32:11 2012 (r244115) @@ -523,6 +523,11 @@ extern int val_print (struct type * type int deref_ref, int recurse, enum val_prettyprint pretty); +extern int common_val_print (struct value *val, + struct ui_file *stream, int format, + int deref_ref, int recurse, + enum val_prettyprint pretty); + extern int val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream); extern void print_variable_value (struct symbol * var, Modified: stable/9/contrib/gdb/gdb/varobj.c ============================================================================== --- stable/9/contrib/gdb/gdb/varobj.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/varobj.c Tue Dec 11 12:32:11 2012 (r244115) @@ -2093,10 +2093,8 @@ c_value_of_variable (struct varobj *var) if (VALUE_LAZY (var->value)) gdb_value_fetch_lazy (var->value); - val_print (VALUE_TYPE (var->value), - VALUE_CONTENTS_RAW (var->value), 0, - VALUE_ADDRESS (var->value), stb, - format_code[(int) var->format], 1, 0, 0); + common_val_print (var->value, stb, + format_code[(int) var->format], 1, 0, 0); thevalue = ui_file_xstrdup (stb, &dummy); do_cleanups (old_chain); return thevalue; From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 12:34:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49E7A104; Tue, 11 Dec 2012 12:34:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14DE88FC13; Tue, 11 Dec 2012 12:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCYkw4091768; Tue, 11 Dec 2012 12:34:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCYksK091767; Tue, 11 Dec 2012 12:34:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111234.qBBCYksK091767@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244116 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:34:47 -0000 Author: emaste Date: Tue Dec 11 12:34:46 2012 New Revision: 244116 URL: http://svnweb.freebsd.org/changeset/base/244116 Log: MFC r242943: Do not unwind past a zero PC frame. This improves GDB usability when debugging code compiled with optimization. Upstream GDB revision f0031b6d3ae9b164b3747986ab898190bd4dcf8c (prior to GDB's switch to GPLv3), with frame_debug_got_null_frame expanded inline. | 2004-12-12 Andrew Cagney | | * frame.c (get_prev_frame): When unwinding normal frames, check | that the PC isn't zero. Sponsored by: ADARA Networks Modified: stable/9/contrib/gdb/gdb/frame.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/frame.c ============================================================================== --- stable/9/contrib/gdb/gdb/frame.c Tue Dec 11 12:32:11 2012 (r244115) +++ stable/9/contrib/gdb/gdb/frame.c Tue Dec 11 12:34:46 2012 (r244116) @@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_ return NULL; } + /* Assume that the only way to get a zero PC is through something + like a SIGSEGV or a dummy frame, and hence that NORMAL frames + will never unwind a zero PC. */ + if (this_frame->level > 0 + && get_frame_type (this_frame) == NORMAL_FRAME + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { + if (frame_debug) + { + fprintf_unfiltered (gdb_stdlog, "-> "); + fprint_frame (gdb_stdlog, this_frame->prev); + fprintf_unfiltered (gdb_stdlog, " // zero PC \n"); + } + return NULL; + } + /* Only try to do the unwind once. */ if (this_frame->prev_p) { From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 12:40:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1C163DA; Tue, 11 Dec 2012 12:40:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B506B8FC08; Tue, 11 Dec 2012 12:40:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCesIW092915; Tue, 11 Dec 2012 12:40:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCesUU092914; Tue, 11 Dec 2012 12:40:54 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212111240.qBBCesUU092914@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Dec 2012 12:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244117 - stable/9/bin/expr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:40:54 -0000 Author: glebius Date: Tue Dec 11 12:40:54 2012 New Revision: 244117 URL: http://svnweb.freebsd.org/changeset/base/244117 Log: Revert r244108. yyparse() declaration isn't redundant in stable/9. Reported by: tinderbox :) Modified: stable/9/bin/expr/expr.y Modified: stable/9/bin/expr/expr.y ============================================================================== --- stable/9/bin/expr/expr.y Tue Dec 11 12:34:46 2012 (r244116) +++ stable/9/bin/expr/expr.y Tue Dec 11 12:40:54 2012 (r244117) @@ -74,6 +74,7 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); +int yyparse(void); %} From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 11 13:35:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1E86150; Tue, 11 Dec 2012 13:35:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 692C78FC08; Tue, 11 Dec 2012 13:35:38 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 17E721512D7; Tue, 11 Dec 2012 15:35:25 +0200 (EET) Date: Tue, 11 Dec 2012 15:35:25 +0200 From: Jaakko Heinonen To: Greg Lehey Subject: Re: svn commit: r244075 - stable/9/bin/ls Message-ID: <20121211133525.GA43682@jh> References: <201212100311.qBA3BKL6004047@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201212100311.qBA3BKL6004047@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 13:35:40 -0000 On 2012-12-10, Greg Lehey wrote: > MFC to r242840: I found confusing that this commit merges changes not mentioned in the commit message below. It make me while to notice "to" before the revision number. Also the commit didn't record mergeinfo. > Add y flag and environment variable LS_SAMESORT to specify the same > sorting order for time and name with the -t option. IEEE Std 1003.2 > (POSIX.2) mandates that the -t option sort in descending order, and > that if two files have the same timestamp, they should be sorted in > ascending order of their names. The -r flag reverses both of these > sort orders, so they're never the same. This creates significant > problems for sequentially named files stored on FAT file systems, > where it can be impossible to list them in the order in which they > were created. > > Add , (comma) option to print file sizes grouped and separated by > thousands using the non-monetary separator returned by localeconv(3), > typically a comma or period. > Modified: stable/9/bin/ls/cmp.c > ============================================================================== > --- stable/9/bin/ls/cmp.c Mon Dec 10 02:44:47 2012 (r244074) > +++ stable/9/bin/ls/cmp.c Mon Dec 10 03:11:19 2012 (r244075) > @@ -78,6 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) > if (b->fts_statp->st_mtim.tv_nsec < > a->fts_statp->st_mtim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Wrong indentation. Merge error? > @@ -104,6 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) > if (b->fts_statp->st_atim.tv_nsec < > a->fts_statp->st_atim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. > @@ -130,6 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * > if (b->fts_statp->st_birthtim.tv_nsec < > a->fts_statp->st_birthtim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. > @@ -156,6 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b > if (b->fts_statp->st_ctim.tv_nsec < > a->fts_statp->st_ctim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. -- Jaakko From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 12 00:39:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87E07B27; Wed, 12 Dec 2012 00:39:05 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF478FC16; Wed, 12 Dec 2012 00:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC0d5xP026317; Wed, 12 Dec 2012 00:39:05 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC0d594026316; Wed, 12 Dec 2012 00:39:05 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212120039.qBC0d594026316@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 00:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244128 - stable/9/sys/dev/isci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 00:39:05 -0000 Author: jimharris Date: Wed Dec 12 00:39:04 2012 New Revision: 244128 URL: http://svnweb.freebsd.org/changeset/base/244128 Log: MFC r243904: Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing to map, and technically this isn't allowed. Functionally, it works OK (at least on x86) to call bus_dmamap_load with a NULL data pointer and zero length, so this is primarily for correctness and consistency with other drivers. While here, remove check in isci_io_request_construct for nseg==0. Previously, bus_dmamap_load would pass nseg==1, even for case where buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs to get processed. This check is not correct though, and needed to be removed both for the changes elsewhere in this patch, as well as jeff's preliminary bus_dmamap_load_ccb patch (which uncovered all of this in the first place). Modified: stable/9/sys/dev/isci/isci_io_request.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/9/sys/dev/isci/isci_io_request.c Tue Dec 11 23:59:14 2012 (r244127) +++ stable/9/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:04 2012 (r244128) @@ -670,8 +670,7 @@ isci_io_request_construct(void *arg, bus io_request->sge = seg; ccb = io_request->ccb; - /* XXX More cleanup is needed here */ - if ((nseg == 0) || (error != 0)) { + if (error != 0) { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); return; @@ -757,18 +756,21 @@ isci_io_request_execute_scsi_io(union cc panic("Unexpected CAM_DATA_PHYS flag! flags = 0x%x\n", ccb->ccb_h.flags); - error = bus_dmamap_load(io_request->parent.dma_tag, - io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, - isci_io_request_construct, io_request, 0x0); - - /* A resource shortage from BUSDMA will be automatically - * continued at a later point, pushing the CCB processing - * forward, which will in turn unfreeze the simq. - */ - if (error == EINPROGRESS) { - xpt_freeze_simq(controller->sim, 1); - ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; - } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + error = bus_dmamap_load(io_request->parent.dma_tag, + io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, + isci_io_request_construct, io_request, 0x0); + + /* A resource shortage from BUSDMA will be automatically + * continued at a later point, pushing the CCB processing + * forward, which will in turn unfreeze the simq. + */ + if (error == EINPROGRESS) { + xpt_freeze_simq(controller->sim, 1); + ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; + } + } else + isci_io_request_construct(io_request, NULL, 0, 0); } void From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 12 01:05:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02885381; Wed, 12 Dec 2012 01:05:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC1728FC08; Wed, 12 Dec 2012 01:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC15JOv030311; Wed, 12 Dec 2012 01:05:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC15JHS030310; Wed, 12 Dec 2012 01:05:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212120105.qBC15JHS030310@svn.freebsd.org> From: Glen Barber Date: Wed, 12 Dec 2012 01:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244131 - stable/9/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 01:05:20 -0000 Author: gjb (doc,ports committer) Date: Wed Dec 12 01:05:19 2012 New Revision: 244131 URL: http://svnweb.freebsd.org/changeset/base/244131 Log: MFC r244057, r244059: r244057: Get 'uname -r' earlier, so it can be used to determine what branch is being run to set BSDINSTALL_DISTSITE accordingly. This change allows non-RELEASE branches to use the FTP snapshots directory for bootonly.iso installations. r244059: Add missed BETA* to list. Modified: stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Wed Dec 12 00:39:54 2012 (r244130) +++ stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Wed Dec 12 01:05:19 2012 (r244131) @@ -192,7 +192,18 @@ MIRROR=`dialog --backtitle "FreeBSD Inst MIRROR_BUTTON=$? exec 3>&- -BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/releases/`uname -m`/`uname -p`/`uname -r`" +_UNAME_R=`uname -r` + +case ${_UNAME_R} in + *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) + RELDIR="snapshots" + ;; + *) + RELDIR="releases" + ;; +esac + +BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" case $MIRROR_BUTTON in $DIALOG_CANCEL) From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 12 05:00:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A68E92D3; Wed, 12 Dec 2012 05:00:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B1F48FC08; Wed, 12 Dec 2012 05:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC50R7j065073; Wed, 12 Dec 2012 05:00:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC50RLJ065072; Wed, 12 Dec 2012 05:00:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212120500.qBC50RLJ065072@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Dec 2012 05:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244135 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 05:00:27 -0000 Author: kib Date: Wed Dec 12 05:00:26 2012 New Revision: 244135 URL: http://svnweb.freebsd.org/changeset/base/244135 Log: MFC r244053: Fix typo. Modified: stable/9/sys/kern/vfs_mount.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mount.c ============================================================================== --- stable/9/sys/kern/vfs_mount.c Wed Dec 12 04:18:25 2012 (r244134) +++ stable/9/sys/kern/vfs_mount.c Wed Dec 12 05:00:26 2012 (r244135) @@ -709,7 +709,7 @@ sys_mount(td, uap) int error; /* - * Mount flags are now 64-bits. On 32-bit archtectures only + * Mount flags are now 64-bits. On 32-bit architectures only * 32-bits are passed in, but from here on everything handles * 64-bit flags correctly. */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 12 05:02:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0C035A9; Wed, 12 Dec 2012 05:02:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D41B08FC0C; Wed, 12 Dec 2012 05:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC52upX065639; Wed, 12 Dec 2012 05:02:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC52uCo065637; Wed, 12 Dec 2012 05:02:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212120502.qBC52uCo065637@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Dec 2012 05:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244137 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 05:02:57 -0000 Author: kib Date: Wed Dec 12 05:02:56 2012 New Revision: 244137 URL: http://svnweb.freebsd.org/changeset/base/244137 Log: MFC r244054: Remove useless comment. Modified: stable/9/sys/kern/vfs_bio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Wed Dec 12 05:01:01 2012 (r244136) +++ stable/9/sys/kern/vfs_bio.c Wed Dec 12 05:02:56 2012 (r244137) @@ -2649,8 +2649,6 @@ loop: * If this check ever becomes a bottleneck it may be better to * move it into the else, when gbincore() fails. At the moment * it isn't a problem. - * - * XXX remove if 0 sections (clean this up after its proven) */ if (numfreebuffers == 0) { if (TD_IS_IDLETHREAD(curthread)) From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 12 07:19:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C30F6B07; Wed, 12 Dec 2012 07:19:15 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CF838FC08; Wed, 12 Dec 2012 07:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC7JFeN087074; Wed, 12 Dec 2012 07:19:15 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC7JFW1087073; Wed, 12 Dec 2012 07:19:15 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201212120719.qBC7JFW1087073@svn.freebsd.org> From: Remko Lodder Date: Wed, 12 Dec 2012 07:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244139 - stable/9/sys/dev/uart X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 07:19:15 -0000 Author: remko Date: Wed Dec 12 07:19:14 2012 New Revision: 244139 URL: http://svnweb.freebsd.org/changeset/base/244139 Log: Merge r232639 Original commit: Add support for the MosChip MCS9904 four serial ports controller. PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:25:17 2012 (r232638) +++ head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:42:21 2012 (r232639) @@ -126,6 +126,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; Modified: stable/9/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 12 05:21:04 2012 (r244138) +++ stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:19:14 2012 (r244139) @@ -127,6 +127,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 13 06:17:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D5BC423; Thu, 13 Dec 2012 06:17:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3048FC0A; Thu, 13 Dec 2012 06:17:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6H8oo060892; Thu, 13 Dec 2012 06:17:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6H5SN060871; Thu, 13 Dec 2012 06:17:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130617.qBD6H5SN060871@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244172 - in stable/9/sys: bsm cddl/contrib/opensolaris/uts/common/sys compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:17:08 -0000 Author: kib Date: Thu Dec 13 06:17:05 2012 New Revision: 244172 URL: http://svnweb.freebsd.org/changeset/base/244172 Log: MFC r242958: Add the wait6(2) system call. It takes POSIX waitid()-like process designator to select a process which is waited for. The system call optionally returns siginfo_t which would be otherwise provided to SIGCHLD handler, as well as extended structure accounting for child and cumulative grandchild resource usage. Allow to get the current rusage information for non-exited processes as well, similar to Solaris. The explicit WEXITED flag is required to wait for exited processes, allowing for more fine-grained control of the events the waiter is interested in. Fix the handling of siginfo for WNOWAIT option for all wait*(2) family, by not removing the queued signal state. PR: standards/170346 MFC r243133: Style fixes for r242958. MFC r243134: Alphabetically reorder the forward-declarations of the structures. Add the declaration for enum idtype, to be used later. MFC r243135: Move the definition of the idtype_t from sys/types.h to sys/wait.h. Fix the bug, use #if __BSD_VISIBLE instead of #if defined(__BSD_VISIBLE), since __BSD_VISIBLE is always defined. Reformat the comments from the Solaris style to KNF. MFC r243136: Restore the proper handling of the pid 0 for waitpid(2). Fix the style around. Modified: stable/9/sys/bsm/audit_kevents.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h stable/9/sys/compat/freebsd32/freebsd32.h stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/kern_exit.c stable/9/sys/kern/sys_procdesc.c stable/9/sys/kern/syscalls.master stable/9/sys/sys/proc.h stable/9/sys/sys/resource.h stable/9/sys/sys/syscallsubr.h stable/9/sys/sys/wait.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/bsm/audit_kevents.h ============================================================================== --- stable/9/sys/bsm/audit_kevents.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/bsm/audit_kevents.h Thu Dec 13 06:17:05 2012 (r244172) @@ -602,6 +602,7 @@ #define AUE_PDKILL 43198 /* FreeBSD. */ #define AUE_PDGETPID 43199 /* FreeBSD. */ #define AUE_PDWAIT 43200 /* FreeBSD. */ +#define AUE_WAIT6 43201 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h Thu Dec 13 06:17:05 2012 (r244172) @@ -51,6 +51,7 @@ extern "C" { #define P_INITUID 0 #define P_INITPGID 0 +#ifndef _IDTYPE_T_DECLARED /* * The following defines the values for an identifier type. It @@ -81,6 +82,9 @@ typedef enum P_PSETID /* Processor set identifier */ } idtype_t; +#define _IDTYPE_T_DECLARED + +#endif /* * The following defines the operations which can be performed to Modified: stable/9/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/freebsd32.h Thu Dec 13 06:17:05 2012 (r244172) @@ -79,6 +79,11 @@ struct rusage32 { int32_t ru_nivcsw; }; +struct wrusage32 { + struct rusage32 wru_self; + struct rusage32 wru_children; +}; + struct itimerval32 { struct timeval32 it_interval; struct timeval32 it_value; Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Dec 13 06:17:05 2012 (r244172) @@ -174,6 +174,42 @@ freebsd32_wait4(struct thread *td, struc return (error); } +int +freebsd32_wait6(struct thread *td, struct freebsd32_wait6_args *uap) +{ + struct wrusage32 wru32; + struct __wrusage wru, *wrup; + struct siginfo32 si32; + struct __siginfo si, *sip; + int error, status; + + if (uap->wrusage != NULL) + wrup = &wru; + else + wrup = NULL; + if (uap->info != NULL) { + sip = &si; + bzero(sip, sizeof(*sip)); + } else + sip = NULL; + error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options, + wrup, sip); + if (error != 0) + return (error); + if (uap->status != NULL) + error = copyout(&status, uap->status, sizeof(status)); + if (uap->wrusage != NULL && error == 0) { + freebsd32_rusage_out(&wru.wru_self, &wru32.wru_self); + freebsd32_rusage_out(&wru.wru_children, &wru32.wru_children); + error = copyout(&wru32, uap->wrusage, sizeof(wru32)); + } + if (uap->info != NULL && error == 0) { + siginfo_to_siginfo32 (&si, &si32); + error = copyout(&si32, uap->info, sizeof(si32)); + } + return (error); +} + #ifdef COMPAT_FREEBSD4 static void copy_statfs(struct statfs *in, struct statfs32 *out) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/syscalls.master Thu Dec 13 06:17:05 2012 (r244172) @@ -997,3 +997,8 @@ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \ + int *status, int options, \ + struct wrusage32 *wrusage, \ + siginfo_t *info); } + Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/kern_exit.c Thu Dec 13 06:17:05 2012 (r244172) @@ -144,7 +144,7 @@ exit1(struct thread *td, int rv) * XXX in case we're rebooting we just let init die in order to * work around an unsolved stack overflow seen very late during * shutdown on sparc64 when the gmirror worker process exists. - */ + */ if (p == initproc && rebooting == 0) { printf("init died (signal %d, exit %d)\n", WTERMSIG(rv), WEXITSTATUS(rv)); @@ -612,7 +612,7 @@ sys_abort2(struct thread *td, struct abo sbuf_clear(sb); sbuf_printf(sb, "%s(pid %d uid %d) aborted: ", p->p_comm, p->p_pid, td->td_ucred->cr_uid); - /* + /* * Since we can't return from abort2(), send SIGKILL in cases, where * abort2() was called improperly */ @@ -684,7 +684,7 @@ owait(struct thread *td, struct owait_ar * The dirty work is handled by kern_wait(). */ int -sys_wait4(struct thread *td, struct wait_args *uap) +sys_wait4(struct thread *td, struct wait4_args *uap) { struct rusage ru, *rup; int error, status; @@ -701,14 +701,51 @@ sys_wait4(struct thread *td, struct wait return (error); } +int +sys_wait6(struct thread *td, struct wait6_args *uap) +{ + struct __wrusage wru, *wrup; + siginfo_t si, *sip; + idtype_t idtype; + id_t id; + int error, status; + + idtype = uap->idtype; + id = uap->id; + + if (uap->wrusage != NULL) + wrup = &wru; + else + wrup = NULL; + + if (uap->info != NULL) { + sip = &si; + bzero(sip, sizeof(*sip)); + } else + sip = NULL; + + /* + * We expect all callers of wait6() to know about WEXITED and + * WTRAPPED. + */ + error = kern_wait6(td, idtype, id, &status, uap->options, wrup, sip); + + if (uap->status != NULL && error == 0) + error = copyout(&status, uap->status, sizeof(status)); + if (uap->wrusage != NULL && error == 0) + error = copyout(&wru, uap->wrusage, sizeof(wru)); + if (uap->info != NULL && error == 0) + error = copyout(&si, uap->info, sizeof(si)); + return (error); +} + /* * Reap the remains of a zombie process and optionally return status and * rusage. Asserts and will release both the proctree_lock and the process * lock as part of its work. */ void -proc_reap(struct thread *td, struct proc *p, int *status, int options, - struct rusage *rusage) +proc_reap(struct thread *td, struct proc *p, int *status, int options) { struct proc *q, *t; @@ -718,10 +755,7 @@ proc_reap(struct thread *td, struct proc KASSERT(p->p_state == PRS_ZOMBIE, ("proc_reap: !PRS_ZOMBIE")); q = td->td_proc; - if (rusage) { - *rusage = p->p_ru; - calcru(p, &rusage->ru_utime, &rusage->ru_stime); - } + PROC_SUNLOCK(p); td->td_retval[0] = p->p_pid; if (status) @@ -834,24 +868,77 @@ proc_reap(struct thread *td, struct proc } static int -proc_to_reap(struct thread *td, struct proc *p, pid_t pid, int *status, - int options, struct rusage *rusage) +proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id, + int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo) { struct proc *q; + struct rusage *rup; sx_assert(&proctree_lock, SA_XLOCKED); q = td->td_proc; PROC_LOCK(p); - if (pid != WAIT_ANY && p->p_pid != pid && p->p_pgid != -pid) { + + switch (idtype) { + case P_ALL: + break; + case P_PID: + if (p->p_pid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_PGID: + if (p->p_pgid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_SID: + if (p->p_session->s_sid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_UID: + if (p->p_ucred->cr_uid != (uid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_GID: + if (p->p_ucred->cr_gid != (gid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_JAILID: + if (p->p_ucred->cr_prison == NULL || + (p->p_ucred->cr_prison->pr_id != (int)id)) { + PROC_UNLOCK(p); + return (0); + } + break; + /* + * It seems that the thread structures get zeroed out + * at process exit. This makes it impossible to + * support P_SETID, P_CID or P_CPUID. + */ + default: PROC_UNLOCK(p); return (0); } + if (p_canwait(td, p)) { PROC_UNLOCK(p); return (0); } + if (((options & WEXITED) == 0) && (p->p_state == PRS_ZOMBIE)) { + PROC_UNLOCK(p); + return (0); + } + /* * This special case handles a kthread spawned by linux_clone * (see linux_misc.c). The linux_wait4 and linux_waitpid @@ -867,8 +954,59 @@ proc_to_reap(struct thread *td, struct p } PROC_SLOCK(p); + + if (siginfo != NULL) { + bzero(siginfo, sizeof(*siginfo)); + siginfo->si_errno = 0; + + /* + * SUSv4 requires that the si_signo value is always + * SIGCHLD. Obey it despite the rfork(2) interface + * allows to request other signal for child exit + * notification. + */ + siginfo->si_signo = SIGCHLD; + + /* + * This is still a rough estimate. We will fix the + * cases TRAPPED, STOPPED, and CONTINUED later. + */ + if (WCOREDUMP(p->p_xstat)) + siginfo->si_code = CLD_DUMPED; + else if (WIFSIGNALED(p->p_xstat)) + siginfo->si_code = CLD_KILLED; + else + siginfo->si_code = CLD_EXITED; + + siginfo->si_pid = p->p_pid; + siginfo->si_uid = p->p_ucred->cr_uid; + siginfo->si_status = p->p_xstat; + + /* + * The si_addr field would be useful additional + * detail, but apparently the PC value may be lost + * when we reach this point. bzero() above sets + * siginfo->si_addr to NULL. + */ + } + + /* + * There should be no reason to limit resources usage info to + * exited processes only. A snapshot about any resources used + * by a stopped process may be exactly what is needed. + */ + if (wrusage != NULL) { + rup = &wrusage->wru_self; + *rup = p->p_ru; + calcru(p, &rup->ru_utime, &rup->ru_stime); + + rup = &wrusage->wru_children; + *rup = p->p_stats->p_cru; + calccru(p, &rup->ru_utime, &rup->ru_stime); + } + if (p->p_state == PRS_ZOMBIE) { - proc_reap(td, p, status, options, rusage); + proc_reap(td, p, status, options); return (-1); } PROC_SUNLOCK(p); @@ -880,21 +1018,75 @@ int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rusage) { + struct __wrusage wru, *wrup; + struct proc *q; + idtype_t idtype; + id_t id; + int ret; + + if (pid == WAIT_ANY) { + idtype = P_ALL; + id = 0; + } else if (pid == WAIT_MYPGRP) { + idtype = P_PGID; + q = td->td_proc; + PROC_LOCK(q); + id = (id_t)q->p_pgid; + PROC_UNLOCK(q); + } else if (pid < 0) { + idtype = P_PGID; + id = (id_t)-pid; + } else { + idtype = P_PID; + id = (id_t)pid; + } + if (rusage != NULL) + wrup = &wru; + else + wrup = NULL; + /* + * For backward compatibility we implicitly add flags WEXITED + * and WTRAPPED here. + */ + options |= WEXITED | WTRAPPED; + ret = kern_wait6(td, idtype, id, status, options, wrup, NULL); + if (rusage != NULL) + *rusage = wru.wru_self; + return (ret); +} + +int +kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, + int options, struct __wrusage *wrusage, siginfo_t *siginfo) +{ struct proc *p, *q; int error, nfound, ret; - AUDIT_ARG_PID(pid); + AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ + AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ AUDIT_ARG_VALUE(options); q = td->td_proc; - if (pid == 0) { - PROC_LOCK(q); - pid = -q->p_pgid; - PROC_UNLOCK(q); + + if ((pid_t)id == WAIT_MYPGRP && (idtype == P_PID || idtype == P_PGID)) { + id = (id_t)q->p_pgid; + idtype = P_PGID; } + /* If we don't know the option, just return. */ - if (options & ~(WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) + if ((options & ~(WUNTRACED | WNOHANG | WCONTINUED | WNOWAIT | + WEXITED | WTRAPPED | WLINUXCLONE)) != 0) return (EINVAL); + if ((options & (WEXITED | WUNTRACED | WCONTINUED | WTRAPPED)) == 0) { + /* + * We will be unable to find any matching processes, + * because there are no known events to look for. + * Prefer to return error instead of blocking + * indefinitely. + */ + return (EINVAL); + } + loop: if (q->p_flag & P_STATCHILD) { PROC_LOCK(q); @@ -904,7 +1096,8 @@ loop: nfound = 0; sx_xlock(&proctree_lock); LIST_FOREACH(p, &q->p_children, p_sibling) { - ret = proc_to_reap(td, p, pid, status, options, rusage); + ret = proc_to_reap(td, p, idtype, id, status, options, + wrusage, siginfo); if (ret == 0) continue; else if (ret == 1) @@ -914,37 +1107,77 @@ loop: PROC_LOCK(p); PROC_SLOCK(p); - if ((p->p_flag & P_STOPPED_SIG) && + + if ((options & WTRAPPED) != 0 && + (p->p_flag & P_TRACED) != 0 && + (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && (p->p_suspcount == p->p_numthreads) && - (p->p_flag & P_WAITED) == 0 && - (p->p_flag & P_TRACED || options & WUNTRACED)) { + ((p->p_flag & P_WAITED) == 0)) { PROC_SUNLOCK(p); - p->p_flag |= P_WAITED; + if ((options & WNOWAIT) == 0) + p->p_flag |= P_WAITED; sx_xunlock(&proctree_lock); td->td_retval[0] = p->p_pid; - if (status) + + if (status != NULL) *status = W_STOPCODE(p->p_xstat); + if (siginfo != NULL) { + siginfo->si_status = p->p_xstat; + siginfo->si_code = CLD_TRAPPED; + } + if ((options & WNOWAIT) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); PROC_UNLOCK(p); + return (0); + } + if ((options & WUNTRACED) != 0 && + (p->p_flag & P_STOPPED_SIG) != 0 && + (p->p_suspcount == p->p_numthreads) && + ((p->p_flag & P_WAITED) == 0)) { + PROC_SUNLOCK(p); + if ((options & WNOWAIT) == 0) + p->p_flag |= P_WAITED; + sx_xunlock(&proctree_lock); + td->td_retval[0] = p->p_pid; + + if (status != NULL) + *status = W_STOPCODE(p->p_xstat); + if (siginfo != NULL) { + siginfo->si_status = p->p_xstat; + siginfo->si_code = CLD_STOPPED; + } + if ((options & WNOWAIT) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } + PROC_UNLOCK(p); return (0); } PROC_SUNLOCK(p); - if (options & WCONTINUED && (p->p_flag & P_CONTINUED)) { + if ((options & WCONTINUED) != 0 && + (p->p_flag & P_CONTINUED) != 0) { sx_xunlock(&proctree_lock); td->td_retval[0] = p->p_pid; - p->p_flag &= ~P_CONTINUED; - - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); + if ((options & WNOWAIT) == 0) { + p->p_flag &= ~P_CONTINUED; + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } PROC_UNLOCK(p); - if (status) + if (status != NULL) *status = SIGCONT; + if (siginfo != NULL) { + siginfo->si_status = SIGCONT; + siginfo->si_code = CLD_CONTINUED; + } return (0); } PROC_UNLOCK(p); @@ -963,7 +1196,8 @@ loop: * to successfully wait until the child becomes a zombie. */ LIST_FOREACH(p, &q->p_orphans, p_orphan) { - ret = proc_to_reap(td, p, pid, status, options, rusage); + ret = proc_to_reap(td, p, idtype, id, status, options, + wrusage, siginfo); if (ret == 0) continue; else if (ret == 1) @@ -989,7 +1223,7 @@ loop: error = msleep(q, &q->p_mtx, PWAIT | PCATCH, "wait", 0); PROC_UNLOCK(q); if (error) - return (error); + return (error); goto loop; } Modified: stable/9/sys/kern/sys_procdesc.c ============================================================================== --- stable/9/sys/kern/sys_procdesc.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/sys_procdesc.c Thu Dec 13 06:17:05 2012 (r244172) @@ -367,7 +367,7 @@ procdesc_close(struct file *fp, struct t * procdesc_reap(). */ PROC_SLOCK(p); - proc_reap(curthread, p, NULL, 0, NULL); + proc_reap(curthread, p, NULL, 0); } else { /* * If the process is not yet dead, we need to kill it, but we Modified: stable/9/sys/kern/syscalls.master ============================================================================== --- stable/9/sys/kern/syscalls.master Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/syscalls.master Thu Dec 13 06:17:05 2012 (r244172) @@ -71,8 +71,7 @@ ; XXX man page says `mode_t mode'. 6 AUE_CLOSE STD { int close(int fd); } 7 AUE_WAIT4 STD { int wait4(int pid, int *status, \ - int options, struct rusage *rusage); } \ - wait4 wait_args int + int options, struct rusage *rusage); } 8 AUE_CREAT COMPAT { int creat(char *path, int mode); } 9 AUE_LINK STD { int link(char *path, char *link); } 10 AUE_UNLINK STD { int unlink(char *path); } @@ -949,5 +948,9 @@ off_t offset, off_t len); } 531 AUE_NULL STD { int posix_fadvise(int fd, off_t offset, \ off_t len, int advice); } +532 AUE_WAIT6 STD { int wait6(int idtype, int id, \ + int *status, int options, \ + struct __wrusage *wrusage, \ + siginfo_t *info); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/proc.h Thu Dec 13 06:17:05 2012 (r244172) @@ -886,8 +886,7 @@ int proc_getenvv(struct thread *td, stru void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); -void proc_reap(struct thread *td, struct proc *p, int *status, int options, - struct rusage *rusage); +void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); Modified: stable/9/sys/sys/resource.h ============================================================================== --- stable/9/sys/sys/resource.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/resource.h Thu Dec 13 06:17:05 2012 (r244172) @@ -79,6 +79,13 @@ struct rusage { #define ru_last ru_nivcsw }; +#if __BSD_VISIBLE +struct __wrusage { + struct rusage wru_self; + struct rusage wru_children; +}; +#endif + /* * Resource limits */ Modified: stable/9/sys/sys/syscallsubr.h ============================================================================== --- stable/9/sys/sys/syscallsubr.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/syscallsubr.h Thu Dec 13 06:17:05 2012 (r244172) @@ -35,24 +35,26 @@ #include struct file; +enum idtype; struct itimerval; struct image_args; struct jail; +struct kevent; +struct kevent_copyops; +struct kld_file_stat; +struct ksiginfo; struct mbuf; struct msghdr; struct msqid_ds; +struct ogetdirentries_args; struct rlimit; struct rusage; union semun; +struct sendfile_args; struct sockaddr; struct stat; -struct kevent; -struct kevent_copyops; -struct kld_file_stat; -struct ksiginfo; -struct sendfile_args; struct thr_param; -struct ogetdirentries_args; +struct __wrusage; int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen); @@ -233,6 +235,8 @@ int kern_utimesat(struct thread *td, int enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); +int kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status, + int options, struct __wrusage *wrup, siginfo_t *sip); int kern_writev(struct thread *td, int fd, struct uio *auio); int kern_socketpair(struct thread *td, int domain, int type, int protocol, int *rsv); Modified: stable/9/sys/sys/wait.h ============================================================================== --- stable/9/sys/sys/wait.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/wait.h Thu Dec 13 06:17:05 2012 (r244172) @@ -80,13 +80,58 @@ #define WSTOPPED WUNTRACED /* SUS compatibility */ #define WCONTINUED 4 /* Report a job control continued process. */ #define WNOWAIT 8 /* Poll only. Don't delete the proc entry. */ +#define WEXITED 16 /* Wait for exited processes. */ +#define WTRAPPED 32 /* Wait for a process to hit a trap or + a breakpoint. */ #if __BSD_VISIBLE #define WLINUXCLONE 0x80000000 /* Wait for kthread spawned from linux_clone. */ #endif +#ifndef _IDTYPE_T_DECLARED +typedef enum +#if __BSD_VISIBLE + idtype /* pollutes XPG4.2 namespace */ +#endif + { + /* + * These names were mostly lifted from Solaris source code and + * still use Solaris style naming to avoid breaking any + * OpenSolaris code which has been ported to FreeBSD. There + * is no clear FreeBSD counterpart for all of the names, but + * some have a clear correspondence to FreeBSD entities. + * + * The numerical values are kept synchronized with the Solaris + * values. + */ + P_PID, /* A process identifier. */ + P_PPID, /* A parent process identifier. */ + P_PGID, /* A process group identifier. */ + P_SID, /* A session identifier. */ + P_CID, /* A scheduling class identifier. */ + P_UID, /* A user identifier. */ + P_GID, /* A group identifier. */ + P_ALL, /* All processes. */ + P_LWPID, /* An LWP identifier. */ + P_TASKID, /* A task identifier. */ + P_PROJID, /* A project identifier. */ + P_POOLID, /* A pool identifier. */ + P_JAILID, /* A zone identifier. */ + P_CTID, /* A (process) contract identifier. */ + P_CPUID, /* CPU identifier. */ + P_PSETID /* Processor set identifier. */ +} idtype_t; /* The type of id_t we are using. */ + +#if __BSD_VISIBLE +#define P_ZONEID P_JAILID +#endif +#define _IDTYPE_T_DECLARED +#endif + /* * Tokens for special values of the "pid" parameter to wait4. + * Extended struct __wrusage to collect rusage for both the target + * process and its children within one wait6() call. */ #if __BSD_VISIBLE #define WAIT_ANY (-1) /* any process */ @@ -97,12 +142,19 @@ #include __BEGIN_DECLS +struct __siginfo; pid_t wait(int *); pid_t waitpid(pid_t, int *, int); +#if __POSIX_VISIBLE >= 200112 +int waitid(idtype_t, id_t, struct __siginfo *, int); +#endif #if __BSD_VISIBLE struct rusage; +struct __wrusage; pid_t wait3(int *, int, struct rusage *); pid_t wait4(pid_t, int *, int, struct rusage *); +pid_t wait6(idtype_t, id_t, int *, int, struct __wrusage *, + struct __siginfo *); #endif __END_DECLS #endif /* !_KERNEL */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 13 06:20:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E6D1767; Thu, 13 Dec 2012 06:20:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6E3A8FC1D; Thu, 13 Dec 2012 06:20:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6K3Ya061555; Thu, 13 Dec 2012 06:20:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6K14v061538; Thu, 13 Dec 2012 06:20:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130620.qBD6K14v061538@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244174 - in stable/9/sys: compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:20:04 -0000 Author: kib Date: Thu Dec 13 06:20:01 2012 New Revision: 244174 URL: http://svnweb.freebsd.org/changeset/base/244174 Log: Regenerate. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c stable/9/sys/kern/init_sysent.c stable/9/sys/kern/syscalls.c stable/9/sys/kern/systrace_args.c stable/9/sys/sys/syscall.h stable/9/sys/sys/syscall.mk stable/9/sys/sys/sysproto.h Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -588,6 +588,14 @@ struct freebsd32_posix_fadvise_args { char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; +struct freebsd32_wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -699,6 +707,7 @@ int freebsd32_shmctl(struct thread *, st int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); +int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); #ifdef COMPAT_43 @@ -1075,6 +1084,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -425,4 +425,5 @@ #define FREEBSD32_SYS_rctl_remove_rule 529 #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 -#define FREEBSD32_SYS_MAXSYSCALL 532 +#define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_MAXSYSCALL 533 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ const char *freebsd32_syscallnames[] = { @@ -555,4 +555,5 @@ const char *freebsd32_syscallnames[] = { "rctl_remove_rule", /* 529 = rctl_remove_rule */ "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ + "freebsd32_wait6", /* 532 = freebsd32_wait6 */ }; Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #include "opt_compat.h" @@ -592,4 +592,5 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ }; Modified: stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3046,6 +3046,18 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* freebsd32_wait6 */ + case 532: { + struct freebsd32_wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* int */ + uarg[2] = (intptr_t) p->status; /* int * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[5] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8130,6 +8142,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* freebsd32_wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "int *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "struct wrusage32 *"; + break; + case 5: + p = "siginfo_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/9/sys/kern/init_sysent.c ============================================================================== --- stable/9/sys/kern/init_sysent.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/init_sysent.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #include "opt_compat.h" @@ -41,7 +41,7 @@ struct sysent sysent[] = { { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = write */ { AS(open_args), (sy_call_t *)sys_open, AUE_OPEN_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = open */ { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = close */ - { AS(wait_args), (sy_call_t *)sys_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ + { AS(wait4_args), (sy_call_t *)sys_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ { compat(AS(ocreat_args),creat), AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = old creat */ { AS(link_args), (sy_call_t *)sys_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */ { AS(unlink_args), (sy_call_t *)sys_unlink, AUE_UNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = unlink */ @@ -566,4 +566,5 @@ struct sysent sysent[] = { { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ + { AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = wait6 */ }; Modified: stable/9/sys/kern/syscalls.c ============================================================================== --- stable/9/sys/kern/syscalls.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/syscalls.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ const char *syscallnames[] = { @@ -539,4 +539,5 @@ const char *syscallnames[] = { "rctl_remove_rule", /* 529 = rctl_remove_rule */ "posix_fallocate", /* 530 = posix_fallocate */ "posix_fadvise", /* 531 = posix_fadvise */ + "wait6", /* 532 = wait6 */ }; Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/systrace_args.c Thu Dec 13 06:20:01 2012 (r244174) @@ -64,7 +64,7 @@ systrace_args(int sysnum, void *params, } /* wait4 */ case 7: { - struct wait_args *p = params; + struct wait4_args *p = params; iarg[0] = p->pid; /* int */ uarg[1] = (intptr_t) p->status; /* int * */ iarg[2] = p->options; /* int */ @@ -3244,6 +3244,18 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* wait6 */ + case 532: { + struct wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* int */ + uarg[2] = (intptr_t) p->status; /* int * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->wrusage; /* struct __wrusage * */ + uarg[5] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8632,6 +8644,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "int *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "struct __wrusage *"; + break; + case 5: + p = "siginfo_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/9/sys/sys/syscall.h ============================================================================== --- stable/9/sys/sys/syscall.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/syscall.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #define SYS_syscall 0 @@ -447,4 +447,5 @@ #define SYS_rctl_remove_rule 529 #define SYS_posix_fallocate 530 #define SYS_posix_fadvise 531 -#define SYS_MAXSYSCALL 532 +#define SYS_wait6 532 +#define SYS_MAXSYSCALL 533 Modified: stable/9/sys/sys/syscall.mk ============================================================================== --- stable/9/sys/sys/syscall.mk Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/syscall.mk Thu Dec 13 06:20:01 2012 (r244174) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb +# created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib MIASM = \ syscall.o \ exit.o \ @@ -395,4 +395,5 @@ MIASM = \ rctl_add_rule.o \ rctl_remove_rule.o \ posix_fallocate.o \ - posix_fadvise.o + posix_fadvise.o \ + wait6.o Modified: stable/9/sys/sys/sysproto.h ============================================================================== --- stable/9/sys/sys/sysproto.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/sysproto.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -59,7 +59,7 @@ struct open_args { struct close_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; -struct wait_args { +struct wait4_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; @@ -1739,6 +1739,14 @@ struct posix_fadvise_args { char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)]; char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; +struct wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -1746,7 +1754,7 @@ int sys_read(struct thread *, struct rea int sys_write(struct thread *, struct write_args *); int sys_open(struct thread *, struct open_args *); int sys_close(struct thread *, struct close_args *); -int sys_wait4(struct thread *, struct wait_args *); +int sys_wait4(struct thread *, struct wait4_args *); int sys_link(struct thread *, struct link_args *); int sys_unlink(struct thread *, struct unlink_args *); int sys_chdir(struct thread *, struct chdir_args *); @@ -2116,6 +2124,7 @@ int sys_rctl_add_rule(struct thread *, s int sys_rctl_remove_rule(struct thread *, struct rctl_remove_rule_args *); int sys_posix_fallocate(struct thread *, struct posix_fallocate_args *); int sys_posix_fadvise(struct thread *, struct posix_fadvise_args *); +int sys_wait6(struct thread *, struct wait6_args *); #ifdef COMPAT_43 @@ -2807,6 +2816,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_rctl_remove_rule AUE_NULL #define SYS_AUE_posix_fallocate AUE_NULL #define SYS_AUE_posix_fadvise AUE_NULL +#define SYS_AUE_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 13 06:24:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41D33907; Thu, 13 Dec 2012 06:24:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 261418FC08; Thu, 13 Dec 2012 06:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6Ou6L062481; Thu, 13 Dec 2012 06:24:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6OsEX062474; Thu, 13 Dec 2012 06:24:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130624.qBD6OsEX062474@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244175 - in stable/9/lib/libc: gen include sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:24:56 -0000 Author: kib Date: Thu Dec 13 06:24:54 2012 New Revision: 244175 URL: http://svnweb.freebsd.org/changeset/base/244175 Log: MFC r242960: Implement the waitid() SUSv4 function using wait6() system call. PR: standards/170346 Added: stable/9/lib/libc/gen/waitid.c - copied unchanged from r242960, head/lib/libc/gen/waitid.c Modified: stable/9/lib/libc/gen/Makefile.inc stable/9/lib/libc/gen/Symbol.map stable/9/lib/libc/include/namespace.h stable/9/lib/libc/include/un-namespace.h stable/9/lib/libc/sys/Symbol.map Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/gen/Makefile.inc ============================================================================== --- stable/9/lib/libc/gen/Makefile.inc Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/gen/Makefile.inc Thu Dec 13 06:24:54 2012 (r244175) @@ -34,7 +34,7 @@ SRCS+= __getosreldate.c __xuname.c \ syslog.c telldir.c termios.c time.c times.c timezone.c tls.c \ ttyname.c ttyslot.c ualarm.c ulimit.c uname.c unvis.c \ usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \ - wordexp.c + waitid.c wordexp.c CANCELPOINTS_SRCS=sem.c sem_new.c .for src in ${CANCELPOINTS_SRCS} Modified: stable/9/lib/libc/gen/Symbol.map ============================================================================== --- stable/9/lib/libc/gen/Symbol.map Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/gen/Symbol.map Thu Dec 13 06:24:54 2012 (r244175) @@ -384,6 +384,7 @@ FBSD_1.3 { fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; + waitid; }; FBSDprivate_1.0 { Copied: stable/9/lib/libc/gen/waitid.c (from r242960, head/lib/libc/gen/waitid.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/gen/waitid.c Thu Dec 13 06:24:54 2012 (r244175, copy of r242960, head/lib/libc/gen/waitid.c) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2012 Jukka A. Ukkonen + * All rights reserved. + * + * This software was developed by Jukka Ukkonen for FreeBSD. + * + * 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 AUTHOR 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 AUTHOR 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 +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +int +__waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags) +{ + int status; + pid_t ret; + + ret = _wait6(idtype, id, &status, flags, NULL, info); + + /* + * According to SUSv4, waitid() shall not return a PID when a + * process is found, but only 0. If a process was actually + * found, siginfo_t fields si_signo and si_pid will be + * non-zero. In case WNOHANG was set in the flags and no + * process was found those fields are set to zero using + * memset() below. + */ + if (ret == 0 && info != NULL) + memset(info, 0, sizeof(*info)); + else if (ret > 0) + ret = 0; + return (ret); +} + +__weak_reference(__waitid, waitid); +__weak_reference(__waitid, _waitid); Modified: stable/9/lib/libc/include/namespace.h ============================================================================== --- stable/9/lib/libc/include/namespace.h Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/include/namespace.h Thu Dec 13 06:24:54 2012 (r244175) @@ -229,6 +229,7 @@ #define socketpair _socketpair #define usleep _usleep #define wait4 _wait4 +#define wait6 _wait6 #define waitpid _waitpid #define write _write #define writev _writev Modified: stable/9/lib/libc/include/un-namespace.h ============================================================================== --- stable/9/lib/libc/include/un-namespace.h Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/include/un-namespace.h Thu Dec 13 06:24:54 2012 (r244175) @@ -210,6 +210,7 @@ #undef socketpair #undef usleep #undef wait4 +#undef wait6 #undef waitpid #undef write #undef writev Modified: stable/9/lib/libc/sys/Symbol.map ============================================================================== --- stable/9/lib/libc/sys/Symbol.map Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/sys/Symbol.map Thu Dec 13 06:24:54 2012 (r244175) @@ -380,6 +380,7 @@ FBSD_1.2 { FBSD_1.3 { posix_fadvise; + wait6; }; FBSDprivate_1.0 { @@ -1013,6 +1014,8 @@ FBSDprivate_1.0 { __sys_vadvise; _wait4; __sys_wait4; + _wait6; + __sys_wait6; _write; __sys_write; _writev; From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 13 06:27:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D441A9F; Thu, 13 Dec 2012 06:27:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77E238FC0C; Thu, 13 Dec 2012 06:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6RxXv063094; Thu, 13 Dec 2012 06:27:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6RxvA063091; Thu, 13 Dec 2012 06:27:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130627.qBD6RxvA063091@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244176 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:27:59 -0000 Author: kib Date: Thu Dec 13 06:27:58 2012 New Revision: 244176 URL: http://svnweb.freebsd.org/changeset/base/244176 Log: MFC r242961: Document wait6() and waitid(). PR: standards/170346 Modified: stable/9/lib/libc/sys/Makefile.inc stable/9/lib/libc/sys/wait.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/sys/Makefile.inc Thu Dec 13 06:24:54 2012 (r244175) +++ stable/9/lib/libc/sys/Makefile.inc Thu Dec 13 06:27:58 2012 (r244176) @@ -214,5 +214,6 @@ MLINKS+=timer_settime.2 timer_getoverrun MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 MLINKS+=utimes.2 futimes.2 utimes.2 futimesat.2 utimes.2 lutimes.2 -MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 +MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 \ + wait.2 waitid.2 wait.2 wait6.2 MLINKS+=write.2 pwrite.2 write.2 pwritev.2 write.2 writev.2 Modified: stable/9/lib/libc/sys/wait.2 ============================================================================== --- stable/9/lib/libc/sys/wait.2 Thu Dec 13 06:24:54 2012 (r244175) +++ stable/9/lib/libc/sys/wait.2 Thu Dec 13 06:27:58 2012 (r244176) @@ -28,15 +28,17 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd November 12, 2005 +.Dd November 10, 2012 .Dt WAIT 2 .Os .Sh NAME .Nm wait , +.Nm waitid , .Nm waitpid , +.Nm wait3 , .Nm wait4 , -.Nm wait3 -.Nd wait for process termination +.Nm wait6 +.Nd wait for processes to change status .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,12 +48,17 @@ .Fn wait "int *status" .Ft pid_t .Fn waitpid "pid_t wpid" "int *status" "int options" +.In sys/signal.h +.Ft int +.Fn waitid "idtype_t idtype" "id_t id" "siginfo_t *info" "int options" .In sys/time.h .In sys/resource.h .Ft pid_t .Fn wait3 "int *status" "int options" "struct rusage *rusage" .Ft pid_t .Fn wait4 "pid_t wpid" "int *status" "int options" "struct rusage *rusage" +.Ft pid_t +.Fn wait6 "idtype_t idtype" "id_t id" "int *status" "int options" "struct __wrusage *wrusage" "siginfo_t *infop" .Sh DESCRIPTION The .Fn wait @@ -86,28 +93,172 @@ system call provides a more general inte that need to wait for certain child processes, that need resource utilization statistics accumulated by child processes, or that require options. -The other wait functions are implemented using -.Fn wait4 . .Pp -The +The broadest interface of all functions in this family is +.Fn wait6 +which is otherwise very much like +.Fn wait4 +but with a few very important distinctions. +To wait for exited processes, the option flag +.Dv WEXITED +need to be explicitly specified. +This allows for waiting for processes which have experienced other +status changes without having to handle also the exit status from +the terminated processes. +Instead of the traditional +.Dv rusage +argument, a pointer to a new structure +.Bd -literal +struct __wrusage { + struct rusage wru_self; + struct rusage wru_children; +}; +.Ed +can be passed. +This allows the calling process to collect resource usage statistics +from both its own child process as well as from its grand children. +When no resource usage statistics are needed this pointer can be +.Dv NULL . +The last argument +.Fa infop +must be either +.Dv NULL +or a pointer to a +.Fa siginfo_t +structure. +When specified, the structure is filled the same as for +.Dv SIGNCHLD +signal, delivered at the process state change. +.br +The process, which state is queried, is specified by two arguments +.Fa idtype +and +.Fa id . +The separate +.Fa idtype +and +.Fa id +arguments allows to support many other types of +IDs as well in addition to PID and PGID. +.Bl -bullet -offset indent +.It +If +.Fa idtype +is +.Dv P_PID , +.Fn waitid +and +.Fn wait6 +wait for the child process with a process ID equal to +.Dv (pid_t)id . +.It +If +.Fa idtype +is +.Dv P_PGID , +.Fn waitid +and +.Fn wait6 +wait for the child process with a process group ID equal to +.Dv (pid_t)id . +.It +If +.Fa idtype +is +.Dv P_ALL , +.Fn waitid +and +.Fn wait6 +wait for any child process and the +.Dv id +is ignored. +.It +If +.Fa idtype +is +.Dv P_PID +or +.Dv P_PGID +and the +.Dv id +is zero, +.Fn waitid +and +.Fn wait6 +wait for any child process in the same process group as the caller. +.El +.Pp +Non-standard specifiers for the process to wait for, supported by this +implementation of +.Fn waitid +and +.Fn wait6 , +are: +.Bl -bullet -offset indent +.It +The +.Fa idtype +value +.Dv P_UID +waits for processes which effective UID is equal to +.Dv (uid_t)id . +.It +The +.Fa idtype +value +.Dv P_GID +waits for processes which effective GID is equal to +.Dv (gid_t)id . +.It +The +.Fa idtype +value +.Dv P_SID +waits for processes which session ID is equal to +.Dv id . +In case the child process started its own new session, +SID will be the same as its own PID. +Otherwise the SID of a child process will match the caller's SID. +.It +The +.Fa idtype +value +.Dv P_JAILID +waits for processes within a jail which jail identifier is equal +to +.Dv id . +.El +.Pp +For +.Fn wait , +.Fn wait3 , +and +.Fn wait4 +functions, the single .Fa wpid argument specifies the set of child processes for which to wait. +.Bl -bullet -offset indent +.It If .Fa wpid is -1, the call waits for any child process. +.It If .Fa wpid is 0, the call waits for any child process in the process group of the caller. +.It If .Fa wpid is greater than zero, the call waits for the process with process id .Fa wpid . +.It If .Fa wpid is less than -1, the call waits for any process whose process group id equals the absolute value of .Fa wpid . +.El .Pp The .Fa status @@ -116,41 +267,102 @@ argument is defined below. The .Fa options argument contains the bitwise OR of any of the following options. -The -.Dv WCONTINUED -option indicates that children of the current process that +.Bl -tag -width Ds +.It Dv WCONTINUED +indicates that children of the current process that have continued from a job control stop, by receiving a .Dv SIGCONT signal, should also have their status reported. -The -.Dv WNOHANG -option -is used to indicate that the call should not block if -there are no processes that wish to report status. -If the -.Dv WUNTRACED -option is set, -children of the current process that are stopped +.It Dv WNOHANG +is used to indicate that the call should not block when +there are no processes wishing to report status. +.It Dv WUNTRACED +indicates that children of the current process which are stopped due to a .Dv SIGTTIN , SIGTTOU , SIGTSTP , or .Dv SIGSTOP -signal also have their status reported. -The -.Dv WSTOPPED -option is an alias for +signal shall have their status reported. +.It Dv WSTOPPED +is an alias for .Dv WUNTRACED . -The -.Dv WNOWAIT -option keeps the process whose status is returned in a waitable state. +.It Dv WTRAPPED +allows waiting for processes which have trapped or reached a breakpoint. +.It Dv WEXITED +indicates that the caller is wants to receive status reports from +terminated processes. +This flag is implicitly set for the functions +.Fn wait , +.Fn waitpid , +.Fn wait3 , +and +.Fn wait4 . +.br +For the +.Fn waitid +and +.Fn wait6 +functions, the flag has to be explicitly included in the +.Fa options , +if status reports from terminated processes are expected. +.It Dv WNOWAIT +keeps the process whose status is returned in a waitable state. The process may be waited for again after this call completes. +.El +.sp +For the +.Fn waitid +and +.Fn wait6 +functions, at least one of the options +.Dv WEXITED , +.Dv WUNTRACED , +.Dv WSTOPPED , +.Dv WTRAPPED , +or +.Dv WCONTINUED +must be specified. +Otherwise there will be no events for the call to report. +To avoid hanging indefinitely in such a case these functions +return -1 with +.Dv errno +set to +.Dv EINVAL . .Pp If .Fa rusage -is non-zero, a summary of the resources used by the terminated -process and all its -children is returned (this information is currently not available -for stopped or continued processes). +is non-NULL, a summary of the resources used by the terminated +process and all its children is returned. +.Pp +If +.Fa wrusage +argument is non-NULL, a resource usage statistics +from both its own child process as well as from its grand children +is returned. +.Pp +If +.Fa infop +is non-NULL, it must point to a +.Dv siginfo_t +structure which is filled on return such that the +.Dv si_signo +field is always +.Dv SIGCHLD +and the field +.Dv si_pid +if be non-zero, if there is a status change to report. +If there are no status changes to report and WNOHANG is applied, +both of these fields are returned zero. +When using the +.Fn waitid +function with the +.Dv WNOHANG +option set, checking these fields is the only way to know whether +there were any status changes to report, because the return value +from +.Fn waitid +is be zero as it is for any successful return from +.Fn waitid . .Pp When the .Dv WNOHANG @@ -175,6 +387,20 @@ call is the same as with a .Fa wpid value of -1. +The +.Fn wait6 +call, with the bits +.Dv WEXITED +and +.Dv WTRAPPED +set in the +.Fa options +and with +.Fa infop +set to +.Dv NULL , +is similar to +.Fn wait4 . .Pp The following macros may be used to test the manner of exit of the process. One of the first four macros will evaluate to a non-zero (true) value: @@ -284,6 +510,7 @@ is returned and is set to indicate the error. .Pp If +.Fn wait6 , .Fn wait4 , .Fn wait3 , or @@ -306,6 +533,18 @@ a value of -1 is returned and .Va errno is set to indicate the error. +.Pp +If +.Fn waitid +returns because one or more processes have a state change to report, +0 is returned. +To indicate an error, -1 will be returned and +.Dv errno +set to an appropriate value. +If +.Dv WNOHANG +was used, 0 can be returned indicating no error, but no processes +may have changed state either, if si_signo and/or si_pid are zero. .Sh ERRORS The .Fn wait @@ -335,6 +574,14 @@ The call was interrupted by a caught sig or the signal did not have the .Dv SA_RESTART flag set. +.It Bq Er EINVAL +An invalid value was specified for +.Fa options , +or +.Fa idtype +and +.Fa id +do not specify a valid set of processes. .El .Sh SEE ALSO .Xr _exit 2 , @@ -344,11 +591,13 @@ flag set. .Xr siginfo 3 .Sh STANDARDS The -.Fn wait +.Fn wait , +.Fn waitpid , and -.Fn waitpid +.Fn waitid functions are defined by POSIX; -.Fn wait4 +.Fn wait6 , +.Fn wait4 , and .Fn wait3 are not specified by POSIX. From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 14 08:52:09 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B8C9FD; Fri, 14 Dec 2012 08:52:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F28148FC0A; Fri, 14 Dec 2012 08:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE8q8xn026818; Fri, 14 Dec 2012 08:52:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE8q837026817; Fri, 14 Dec 2012 08:52:08 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140852.qBE8q837026817@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 08:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244204 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:52:09 -0000 Author: bapt Date: Fri Dec 14 08:52:08 2012 New Revision: 244204 URL: http://svnweb.freebsd.org/changeset/base/244204 Log: MFC r243021: return ERANGE if the buffer is too small to contain the login as documented in the manpage Reviewed by: cognet, kib Modified: stable/9/sys/kern/kern_prot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_prot.c ============================================================================== --- stable/9/sys/kern/kern_prot.c Fri Dec 14 08:07:37 2012 (r244203) +++ stable/9/sys/kern/kern_prot.c Fri Dec 14 08:52:08 2012 (r244204) @@ -2084,6 +2084,8 @@ sys_getlogin(struct thread *td, struct g bcopy(p->p_session->s_login, login, uap->namelen); SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); + if (strlen(login) + 1 > uap->namelen) + return (ERANGE); error = copyout(login, uap->namebuf, uap->namelen); return (error); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 14 09:00:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6780C735; Fri, 14 Dec 2012 09:00:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3378FC0A; Fri, 14 Dec 2012 09:00:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE90Jap028534; Fri, 14 Dec 2012 09:00:19 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE90JQj028533; Fri, 14 Dec 2012 09:00:19 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140900.qBE90JQj028533@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 09:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244207 - stable/9/sys/dev/agp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 09:00:19 -0000 Author: bapt Date: Fri Dec 14 09:00:18 2012 New Revision: 244207 URL: http://svnweb.freebsd.org/changeset/base/244207 Log: Add pci id for the xeon hd4000 (IvyBridge server GT2) Submitted by: François Tigeot Obtained from: dragonfly Modified: stable/9/sys/dev/agp/agp_i810.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/agp/agp_i810.c ============================================================================== --- stable/9/sys/dev/agp/agp_i810.c Fri Dec 14 08:54:52 2012 (r244206) +++ stable/9/sys/dev/agp/agp_i810.c Fri Dec 14 09:00:18 2012 (r244207) @@ -731,6 +731,11 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x016a8086, + .name = "IvyBridge server GT2 IG", + .driver = &agp_i810_sb_driver + }, + { .devid = 0, } }; From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 14 11:38:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AE23BD8; Fri, 14 Dec 2012 11:38:16 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D23F8FC0A; Fri, 14 Dec 2012 11:38:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEBcFem051539; Fri, 14 Dec 2012 11:38:15 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEBcFTJ051537; Fri, 14 Dec 2012 11:38:15 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201212141138.qBEBcFTJ051537@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 14 Dec 2012 11:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244208 - stable/9/lib/libgeom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 11:38:16 -0000 Author: jh Date: Fri Dec 14 11:38:15 2012 New Revision: 244208 URL: http://svnweb.freebsd.org/changeset/base/244208 Log: MFC r242130: Improve libgeom XML parsing error handling. - Abort parsing and return an error if we run out of memory. - Return EILSEQ from geom_xml2tree() for XML syntax errors. Modified: stable/9/lib/libgeom/geom_xml2tree.c Directory Properties: stable/9/lib/libgeom/ (props changed) Modified: stable/9/lib/libgeom/geom_xml2tree.c ============================================================================== --- stable/9/lib/libgeom/geom_xml2tree.c Fri Dec 14 09:00:18 2012 (r244207) +++ stable/9/lib/libgeom/geom_xml2tree.c Fri Dec 14 11:38:15 2012 (r244208) @@ -56,6 +56,8 @@ struct mystate { struct sbuf *sbuf[20]; struct gconf *config; int nident; + XML_Parser parser; + int error; }; static void @@ -85,6 +87,8 @@ StartElement(void *userData, const char if (!strcmp(name, "class") && mt->class == NULL) { mt->class = calloc(1, sizeof *mt->class); if (mt->class == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -98,6 +102,8 @@ StartElement(void *userData, const char if (!strcmp(name, "geom") && mt->geom == NULL) { mt->geom = calloc(1, sizeof *mt->geom); if (mt->geom == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -116,6 +122,8 @@ StartElement(void *userData, const char if (!strcmp(name, "consumer") && mt->consumer == NULL) { mt->consumer = calloc(1, sizeof *mt->consumer); if (mt->consumer == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -137,6 +145,8 @@ StartElement(void *userData, const char if (!strcmp(name, "provider") && mt->provider == NULL) { mt->provider = calloc(1, sizeof *mt->provider); if (mt->provider == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -180,16 +190,19 @@ EndElement(void *userData, const char *n char *p; mt = userData; - sbuf_finish(mt->sbuf[mt->level]); - p = strdup(sbuf_data(mt->sbuf[mt->level])); + p = NULL; + if (sbuf_finish(mt->sbuf[mt->level]) == 0) + p = strdup(sbuf_data(mt->sbuf[mt->level])); + sbuf_delete(mt->sbuf[mt->level]); + mt->sbuf[mt->level] = NULL; + mt->level--; if (p == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; } - sbuf_delete(mt->sbuf[mt->level]); - mt->sbuf[mt->level] = NULL; - mt->level--; if (strlen(p) == 0) { free(p); p = NULL; @@ -249,12 +262,16 @@ EndElement(void *userData, const char *n if (mt->config != NULL) { gc = calloc(1, sizeof *gc); if (gc == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; } gc->lg_name = strdup(name); if (gc->lg_name == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -334,7 +351,7 @@ geom_xml2tree(struct gmesh *gmp, char *p struct ggeom *ge; struct gprovider *pr; struct gconsumer *co; - int i; + int error, i; memset(gmp, 0, sizeof *gmp); LIST_INIT(&gmp->lg_class); @@ -347,14 +364,22 @@ geom_xml2tree(struct gmesh *gmp, char *p return (ENOMEM); } mt->mesh = gmp; + mt->parser = parser; + error = 0; XML_SetUserData(parser, mt); XML_SetElementHandler(parser, StartElement, EndElement); XML_SetCharacterDataHandler(parser, CharData); i = XML_Parse(parser, p, strlen(p), 1); + if (mt->error != 0) + error = mt->error; + else if (i != 1) { + error = XML_GetErrorCode(parser) == XML_ERROR_NO_MEMORY ? + ENOMEM : EILSEQ; + } XML_ParserFree(parser); - if (i != 1) { + if (error != 0) { free(mt); - return (-1); + return (error); } gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1); free(mt); From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 15 08:29:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B86FEE4; Sat, 15 Dec 2012 08:29:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4528FC12; Sat, 15 Dec 2012 08:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF8TNmu005633; Sat, 15 Dec 2012 08:29:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF8TNbs005632; Sat, 15 Dec 2012 08:29:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212150829.qBF8TNbs005632@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 15 Dec 2012 08:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244242 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 08:29:23 -0000 Author: glebius Date: Sat Dec 15 08:29:22 2012 New Revision: 244242 URL: http://svnweb.freebsd.org/changeset/base/244242 Log: Merge from head r244157: Fix a crash in tcp_input(), that happens when mbuf has a fwd_tag on it, but later after processing and freeing the tag, we need to jump back again to the findpcb label. Since the fwd_tag pointer wasn't NULL we tried to process and free the tag for second time. Reported & tested by: Pawel Tyll Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sat Dec 15 07:11:16 2012 (r244241) +++ stable/9/sys/netinet/tcp_input.c Sat Dec 15 08:29:22 2012 (r244242) @@ -822,6 +822,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, @@ -859,6 +860,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 15 10:27:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0B87A29; Sat, 15 Dec 2012 10:27:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3E448FC12; Sat, 15 Dec 2012 10:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFAR7EY034361; Sat, 15 Dec 2012 10:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFAR75k034360; Sat, 15 Dec 2012 10:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212151027.qBFAR75k034360@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Dec 2012 10:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244247 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:27:08 -0000 Author: hselasky Date: Sat Dec 15 10:27:07 2012 New Revision: 244247 URL: http://svnweb.freebsd.org/changeset/base/244247 Log: MFC r244027: Add support for various Yamaha keyboards. MFC after: 1 week PR: usb/174254 Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:02:11 2012 (r244246) +++ stable/9/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:27:07 2012 (r244247) @@ -641,6 +641,115 @@ static driver_t uaudio_driver = { .size = sizeof(struct uaudio_softc), }; +/* The following table is derived from Linux's quirks-table.h */ +static const STRUCT_USB_HOST_ID uaudio_vendor_midi[] = { + { USB_VPI(USB_VENDOR_YAMAHA, 0x1000, 0) }, /* UX256 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1001, 0) }, /* MU1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1002, 0) }, /* MU2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1003, 0) }, /* MU500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1004, 3) }, /* UW500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1005, 0) }, /* MOTIF6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1006, 0) }, /* MOTIF7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1007, 0) }, /* MOTIF8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1008, 0) }, /* UX96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1009, 0) }, /* UX16 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100a, 3) }, /* EOS BX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100c, 0) }, /* UC-MX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100d, 0) }, /* UC-KX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100e, 0) }, /* S08 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100f, 0) }, /* CLP-150 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1010, 0) }, /* CLP-170 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1011, 0) }, /* P-250 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1012, 0) }, /* TYROS */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1013, 0) }, /* PF-500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1014, 0) }, /* S90 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1015, 0) }, /* MOTIF-R */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1016, 0) }, /* MDP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1017, 0) }, /* CVP-204 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1018, 0) }, /* CVP-206 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1019, 0) }, /* CVP-208 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101a, 0) }, /* CVP-210 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101b, 0) }, /* PSR-1100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101c, 0) }, /* PSR-2100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101d, 0) }, /* CLP-175 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101e, 0) }, /* PSR-K1 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101f, 0) }, /* EZ-J24 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1020, 0) }, /* EZ-250i */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1021, 0) }, /* MOTIF ES 6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1022, 0) }, /* MOTIF ES 7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1023, 0) }, /* MOTIF ES 8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1024, 0) }, /* CVP-301 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1025, 0) }, /* CVP-303 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1026, 0) }, /* CVP-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1027, 0) }, /* CVP-307 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1028, 0) }, /* CVP-309 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1029, 0) }, /* CVP-309GP */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102a, 0) }, /* PSR-1500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102b, 0) }, /* PSR-3000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102e, 0) }, /* ELS-01/01C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1030, 0) }, /* PSR-295/293 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1031, 0) }, /* DGX-205/203 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1032, 0) }, /* DGX-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1033, 0) }, /* DGX-505 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1034, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1035, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1036, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1037, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1038, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1039, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1040, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1041, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1042, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1043, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1044, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1045, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1050, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1051, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1052, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1053, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1054, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1055, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1056, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1057, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1058, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1059, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1503, 3) }, /* MOX6/MOX8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2000, 0) }, /* DGP-7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2001, 0) }, /* DGP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2002, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2003, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5000, 0) }, /* CS1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5001, 0) }, /* DSP1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5002, 0) }, /* DME32 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5003, 0) }, /* DM2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5004, 0) }, /* 02R96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5005, 0) }, /* ACU16-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5006, 0) }, /* NHB32-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5007, 0) }, /* DM1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5008, 0) }, /* 01V96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5009, 0) }, /* SPX2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500a, 0) }, /* PM5D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500b, 0) }, /* DME64N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500c, 0) }, /* DME24N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7000, 0) }, /* DTX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7010, 0) }, /* UB99 */ +}; + static const STRUCT_USB_HOST_ID __used uaudio_devs[] = { /* Generic USB audio class match */ {USB_IFACE_CLASS(UICLASS_AUDIO), @@ -658,7 +767,12 @@ uaudio_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - /* lookup non-standard device */ + /* lookup non-standard device(s) */ + + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + return (BUS_PROBE_SPECIFIC); + } if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { if (uaa->info.bInterfaceClass != UICLASS_VENDOR || @@ -763,6 +877,16 @@ uaudio_attach(device_t dev) device_printf(dev, "No recording.\n"); } + if (sc->sc_midi_chan.valid == 0) { + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + sc->sc_midi_chan.iface_index = + (uint8_t)uaa->driver_info; + sc->sc_midi_chan.iface_alt_index = 0; + sc->sc_midi_chan.valid = 1; + } + } + if (sc->sc_midi_chan.valid) { if (umidi_probe(dev)) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 15 14:34:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DED793A; Sat, 15 Dec 2012 14:34:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E74C98FC12; Sat, 15 Dec 2012 14:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEYYBR078135; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEYYks078128; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151434.qBFEYYks078128@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244260 - stable/9/games/fortune/datfiles X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:34:35 -0000 Author: eadler Date: Sat Dec 15 14:34:33 2012 New Revision: 244260 URL: http://svnweb.freebsd.org/changeset/base/244260 Log: MFC r243899: Use Bernard Baruch's full name. The words "old than" seem to be quoted as "older than" by some sources, so use the more likely and grammatically correct text. PR: docs/173868 Approved by: cperciva (implicit) Modified: stable/9/games/fortune/datfiles/fortunes Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/datfiles/fortunes ============================================================================== --- stable/9/games/fortune/datfiles/fortunes Sat Dec 15 14:34:33 2012 (r244259) +++ stable/9/games/fortune/datfiles/fortunes Sat Dec 15 14:34:33 2012 (r244260) @@ -35766,8 +35766,8 @@ the code over again, since I also remove % Old age and treachery will overcome youth and skill. % -Old age is always fifteen years old than I am. - -- B. Baruch +Old age is always fifteen years older than I am. + -- Bernard Baruch % Old age is the harbor of all ills. -- Bion From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 15 14:36:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8396DDE8; Sat, 15 Dec 2012 14:36:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0408FC15; Sat, 15 Dec 2012 14:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEag66078621; Sat, 15 Dec 2012 14:36:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEagIn078619; Sat, 15 Dec 2012 14:36:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151436.qBFEagIn078619@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244263 - stable/9/share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:36:42 -0000 Author: eadler Date: Sat Dec 15 14:36:41 2012 New Revision: 244263 URL: http://svnweb.freebsd.org/changeset/base/244263 Log: MFC r244017: Sync with Library of Congress list. Approved by: cperciva (implicit) Modified: stable/9/share/misc/iso639 Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/iso639 ============================================================================== --- stable/9/share/misc/iso639 Sat Dec 15 14:36:41 2012 (r244262) +++ stable/9/share/misc/iso639 Sat Dec 15 14:36:41 2012 (r244263) @@ -12,11 +12,11 @@ # existing ones according to criteria indicated in the standard. It # maintains an accurate list of information associated with registered # language codes, processes updates of registered language codes, and -# distributes them on a regular basis to subscribers and other parties. +# distributes them on a regular basis to subscribers and other parties. # # This is the official site of the ISO 639-2 Registration Authority and thus # is the only one authorized by ISO. If you have questions concerning ISO -# 639-2 please contact us at: +# 639-2 please contact us at: # # Library of Congress # Network Development and MARC Standards Office @@ -90,7 +90,7 @@ be bel bel Belarusian bn ben ben Bengali ber ber Berber languages bho bho Bhojpuri -bh bih bih Bihari +bh bih bih Bihari languages bik bik Bikol bin bin Bini; Edo bi bis bis Bislama @@ -213,10 +213,10 @@ ha hau hau Hausa he heb heb Hebrew hz her her Herero hil hil Hiligaynon - him him Himachali + him him Himachali languages; Western Pahari languages hi hin hin Hindi hit hit Hittite - hmn hmn Hmong + hmn hmn Hmong; Mong ho hmo hmo Hiri Motu hr hrv hrv Croatian hsb hsb Upper Sorbian @@ -349,11 +349,11 @@ ne nep nep Nepali nia nia Nias nic nic Niger-Kordofanian languages niu niu Niuean +nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian +nb nob nob Bokmål, Norwegian; Norwegian Bokmål nog nog Nogai non non Norse, Old no nor nor Norwegian -nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian -nb nob nob Bokmål, Norwegian; Norwegian Bokmål nqo nqo N'Ko nso nso Pedi; Sepedi; Northern Sotho nub nub Nubian languages @@ -469,8 +469,8 @@ bo tib bod Tibetan ti tir tir Tigrinya tiv tiv Tiv tkl tkl Tokelau - tli tli Tlingit tlh tlh Klingon; tlhIngan-Hol + tli tli Tlingit tmh tmh Tamashek tog tog Tonga (Nyasa) to ton ton Tonga (Tonga Islands) From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 15 21:57:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A620CA16; Sat, 15 Dec 2012 21:57:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9E78FC17; Sat, 15 Dec 2012 21:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLvZ7a044272; Sat, 15 Dec 2012 21:57:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLvZ5j044268; Sat, 15 Dec 2012 21:57:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212152157.qBFLvZ5j044268@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 21:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244279 - stable/9/usr.bin/ministat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:57:35 -0000 Author: eadler Date: Sat Dec 15 21:57:34 2012 New Revision: 244279 URL: http://svnweb.freebsd.org/changeset/base/244279 Log: MFC r243079: Add option to suppress just the plot in ministat while still retaining the relative comparison (i.e., useful part). Approved by: cperciva (implicit) Modified: stable/9/usr.bin/ministat/ministat.1 stable/9/usr.bin/ministat/ministat.c Directory Properties: stable/9/usr.bin/ministat/ (props changed) Modified: stable/9/usr.bin/ministat/ministat.1 ============================================================================== --- stable/9/usr.bin/ministat/ministat.1 Sat Dec 15 21:47:05 2012 (r244278) +++ stable/9/usr.bin/ministat/ministat.1 Sat Dec 15 21:57:34 2012 (r244279) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2010 +.Dd November 10, 2012 .Dt MINISTAT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd statistics utility .Sh SYNOPSIS .Nm -.Op Fl ns +.Op Fl Ans .Op Fl C Ar column .Op Fl c Ar confidence_level .Op Fl d Ar delimiter @@ -47,6 +47,9 @@ in the specified files or, if no file is .Pp The options are as follows: .Bl -tag -width Fl +.It Fl A +Just report the statistics of the input and relative comparisons, +suppress the ASCII-art plot. .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. Modified: stable/9/usr.bin/ministat/ministat.c ============================================================================== --- stable/9/usr.bin/ministat/ministat.c Sat Dec 15 21:47:05 2012 (r244278) +++ stable/9/usr.bin/ministat/ministat.c Sat Dec 15 21:57:34 2012 (r244279) @@ -509,7 +509,7 @@ usage(char const *whine) fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-ns] [-w width] [file [file ...]]\n"); + "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Ans] [-w width] [file [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%", @@ -517,6 +517,7 @@ usage(char const *whine) studentpct[i]); } fprintf(stderr, "}\n"); + fprintf(stderr, "\t-A : print statistics only. suppress the graph.\n"); fprintf(stderr, "\t-C : column number to extract (starts and defaults to 1)\n"); fprintf(stderr, "\t-d : delimiter(s) string, default to \" \\t\"\n"); fprintf(stderr, "\t-n : print summary statistics only, no graph/test\n"); @@ -538,6 +539,7 @@ main(int argc, char **argv) int flag_s = 0; int flag_n = 0; int termwidth = 74; + int suppress_plot = 0; if (isatty(STDOUT_FILENO)) { struct winsize wsz; @@ -550,8 +552,11 @@ main(int argc, char **argv) } ci = -1; - while ((c = getopt(argc, argv, "C:c:d:snw:")) != -1) + while ((c = getopt(argc, argv, "AC:c:d:snw:")) != -1) switch (c) { + case 'A': + suppress_plot = 1; + break; case 'C': column = strtol(optarg, &p, 10); if (p != NULL && *p != '\0') @@ -610,7 +615,7 @@ main(int argc, char **argv) for (i = 0; i < nds; i++) printf("%c %s\n", symbol[i+1], ds[i]->name); - if (!flag_n) { + if (!flag_n && !suppress_plot) { SetupPlot(termwidth, flag_s, nds); for (i = 0; i < nds; i++) DimPlot(ds[i]);