From owner-svn-src-head@FreeBSD.ORG Mon Sep 26 02:27:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E4FE106566B; Mon, 26 Sep 2011 02:27:05 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEB78FC12; Mon, 26 Sep 2011 02:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8Q2R4e0051801; Mon, 26 Sep 2011 02:27:05 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8Q2R4WI051793; Mon, 26 Sep 2011 02:27:04 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109260227.p8Q2R4WI051793@svn.freebsd.org> From: Ken Smith Date: Mon, 26 Sep 2011 02:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225757 - in head: . gnu/usr.bin/groff/tmac release share/examples/cvsup sys/conf sys/sys usr.sbin/pkg_install/add X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 02:27:05 -0000 Author: kensmith Date: Mon Sep 26 02:27:04 2011 New Revision: 225757 URL: http://svn.freebsd.org/changeset/base/225757 Log: Shift head from 9.0-CURRENT to 10.0-CURRENT in preparation for releasing it from the 9.0-RELEASE release cycle code freeze. Approved by: re (implicit) Modified: head/UPDATING head/gnu/usr.bin/groff/tmac/mdoc.local head/release/Makefile.sysinstall head/share/examples/cvsup/stable-supfile head/sys/conf/newvers.sh head/sys/sys/param.h head/usr.sbin/pkg_install/add/main.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Sep 25 15:28:09 2011 (r225756) +++ head/UPDATING Mon Sep 26 02:27:04 2011 (r225757) @@ -9,8 +9,8 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. -NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW: - FreeBSD 9.x has many debugging features turned on, in both the kernel +NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: + FreeBSD 10.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of system primitives, and encourage loud failure through extra sanity checking and fail stop semantics. They also substantially impact @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110923: + The stable/9 branch created in subversion. This corresponds to the + RELENG_9 branch in CVS. + 20110913: This commit modifies vfs_register() so that it uses a hash calculation to set vfc_typenum, which is enabled by default. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Sun Sep 25 15:28:09 2011 (r225756) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Mon Sep 26 02:27:04 2011 (r225757) @@ -71,12 +71,13 @@ .ds doc-volume-as-arm arm . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~9.0 +.ds doc-default-operating-system FreeBSD\~10.0 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.3 8.3 .ds doc-operating-system-FreeBSD-9.0 9.0 +.ds doc-operating-system-FreeBSD-10.0 10.0 . .\" Definitions not (yet) in doc-syms . Modified: head/release/Makefile.sysinstall ============================================================================== --- head/release/Makefile.sysinstall Sun Sep 25 15:28:09 2011 (r225756) +++ head/release/Makefile.sysinstall Mon Sep 26 02:27:04 2011 (r225757) @@ -24,16 +24,16 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=9.0-CURRENT +#BUILDNAME=10.0-CURRENT # # Automatic SNAP versioning: DATE != date +%Y%m%d -BASE = 9.0 +BASE = 10.0 BUILDNAME?=${BASE}-${DATE}-SNAP # #CHROOTDIR=/junk/release # If this is a -stable snapshot, then set -#RELEASETAG=RELENG_8 +#RELEASETAG=RELENG_9 # # To test a release with a source tree containing patches and # other work. This tree will get copied instead of getting the @@ -72,7 +72,7 @@ BUILDNAME?=${BASE}-${DATE}-SNAP # # Subversion branch to build for src. If this is not set then it is # automatically computed from RELEASETAG. -#SVNBRANCH=stable/8 +#SVNBRANCH=stable/9 # # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we # are building an official release. Otherwise, we are building for Modified: head/share/examples/cvsup/stable-supfile ============================================================================== --- head/share/examples/cvsup/stable-supfile Sun Sep 25 15:28:09 2011 (r225756) +++ head/share/examples/cvsup/stable-supfile Mon Sep 26 02:27:04 2011 (r225757) @@ -66,11 +66,11 @@ *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr -# The following line is for 8-stable. If you want 7-stable, 6-stable, -# 5-stable, 4-stable, 3-stable, or 2.2-stable, change to "RELENG_7", -# "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or "RELENG_2_2" -# respectively. -*default release=cvs tag=RELENG_8 +# The following line is for 9-stable. If you want 8-stable, 7-stable, +# 6-stable, 5-stable, 4-stable, 3-stable, or 2.2-stable, change to +# "RELENG_7", "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or +# "RELENG_2_2" respectively. +*default release=cvs tag=RELENG_9 *default delete use-rel-suffix # If you seem to be limited by CPU rather than network or disk bandwidth, try Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Sep 25 15:28:09 2011 (r225756) +++ head/sys/conf/newvers.sh Mon Sep 26 02:27:04 2011 (r225757) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="9.0" -BRANCH="BETA2" +REVISION="10.0" +BRANCH="CURRENT" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Sep 25 15:28:09 2011 (r225756) +++ head/sys/sys/param.h Mon Sep 26 02:27:04 2011 (r225757) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900044 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000000 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Sun Sep 25 15:28:09 2011 (r225756) +++ head/usr.sbin/pkg_install/add/main.c Mon Sep 26 02:27:04 2011 (r225757) @@ -87,6 +87,7 @@ struct { { 800000, 800499, "/packages-8.0-release" }, { 801000, 801499, "/packages-8.1-release" }, { 802000, 802499, "/packages-8.2-release" }, + { 900000, 900499, "/packages-9.0-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, @@ -94,7 +95,8 @@ struct { { 600100, 699000, "/packages-6-stable" }, { 700100, 799000, "/packages-7-stable" }, { 800500, 899000, "/packages-8-stable" }, - { 900000, 999000, "/packages-9-current" }, + { 900500, 999000, "/packages-9-stable" }, + { 1000000, 1099000, "/packages-10-current" }, { 0, 9999999, "/packages-current" }, { 0, 0, NULL } }; From owner-svn-src-head@FreeBSD.ORG Mon Sep 26 11:57:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C281065673; Mon, 26 Sep 2011 11:57:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 488AB8FC12; Mon, 26 Sep 2011 11:57:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8QBvnl1073248; Mon, 26 Sep 2011 11:57:49 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8QBvnUI073246; Mon, 26 Sep 2011 11:57:49 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109261157.p8QBvnUI073246@svn.freebsd.org> From: Ken Smith Date: Mon, 26 Sep 2011 11:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225764 - head/share/examples/cvsup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 11:57:49 -0000 Author: kensmith Date: Mon Sep 26 11:57:48 2011 New Revision: 225764 URL: http://svn.freebsd.org/changeset/base/225764 Log: Forgot to add "RELENG_8" to list of CVS tags. Submitted by: Mamontov Roman Approved by: re (implicit) Modified: head/share/examples/cvsup/stable-supfile Modified: head/share/examples/cvsup/stable-supfile ============================================================================== --- head/share/examples/cvsup/stable-supfile Mon Sep 26 11:40:28 2011 (r225763) +++ head/share/examples/cvsup/stable-supfile Mon Sep 26 11:57:48 2011 (r225764) @@ -67,7 +67,7 @@ *default base=/var/db *default prefix=/usr # The following line is for 9-stable. If you want 8-stable, 7-stable, -# 6-stable, 5-stable, 4-stable, 3-stable, or 2.2-stable, change to +# 6-stable, 5-stable, 4-stable, 3-stable, or 2.2-stable, change to "RELENG_8", # "RELENG_7", "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or # "RELENG_2_2" respectively. *default release=cvs tag=RELENG_9 From owner-svn-src-head@FreeBSD.ORG Mon Sep 26 13:59:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B92EA106564A; Mon, 26 Sep 2011 13:59:18 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id E53F58FC0A; Mon, 26 Sep 2011 13:59:17 +0000 (UTC) Received: by eyg7 with SMTP id 7so4808023eyg.13 for ; Mon, 26 Sep 2011 06:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WU915msPYJUVkrZEUfLf1e3/Dmf4dYkwMaPcg0AmnhM=; b=v/hJHreD0ftsOQKCVbs2zSOC3COjZIq+dvqMTzJFnyuIalG6HtlDmcR8c49RNAB2ND mrG2qxPO2cu77GaMuW5s+tZ8i0rXlTCubl1X0J1Aabtcda3nP49EVJKpD8+pr6rQGtH9 AQwTyWwjWCEYKogP1GzmZyw9aM0f++l/71n+s= MIME-Version: 1.0 Received: by 10.216.138.29 with SMTP id z29mr7517730wei.42.1317045556714; Mon, 26 Sep 2011 06:59:16 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.216.179.78 with HTTP; Mon, 26 Sep 2011 06:59:16 -0700 (PDT) In-Reply-To: <20110905023251.C832@besplex.bde.org> References: <201109041307.p84D72GY092462@svn.freebsd.org> <20110905023251.C832@besplex.bde.org> Date: Mon, 26 Sep 2011 15:59:16 +0200 X-Google-Sender-Auth: YhNFDxMjRghuH6UULO5WE0-lmJs Message-ID: From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225372 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 13:59:18 -0000 2011/9/4 Bruce Evans : > On Sun, 4 Sep 2011, Attilio Rao wrote: > >> Also please notice that intr enable/disable happens in the wrong way >> as it is done via the MD (x86 specific likely) interface. This is >> wrong for 2 reasons: > > No, intr_disable() is MI. =C2=A0It is also used by witness. =C2=A0disable= _intr() > is the corresponding x86 interface that you may be thinking of. =C2=A0The= MI > interface intr_disable() was introduced to avoid the MD'ness of > intr_disable(). I was a bit surprised to verify that you are right but spinlock_enter() has the big difference besides disable_intr() of also explicitly disabling preemption via critical_enter() which some codepath can trigger without even noticing it. This means it is more safer in presence of PREEMPTION option on and thus should be preferred to the normal intr_disable(), in particular for convoluted codepaths. >> 1) There may be some codepaths leading to explicit preemption >> 2) It should =C2=A0really use an MI interface >> >> The right way to do this should be via spinlock_enter(). > > spinlock_enter() is MI, but has wrong semantics. =C2=A0In my version of i= 386, > spinlocks don't disable any h/w interrupt, as is needed for fast interrup= t > handlers to actually work. =C2=A0I believe sparc64 is similar, except its > spinlock_enter() disables most h/w interrupts and this includes fast > interrupt handlers. =C2=A0I don't understand sparc64, but it looks like i= ts > spinlock_enter() disables all interrupts visible in C code, but not > all interrupts: Can you please explain more about the 'h/w interrupts not disabled' in X86? Are you speaking about NMIs? For those the only way to effectively mask them would be to reprogram the LAPIC entry, but I don't really think we may want that. > from cpufunc.h: > % static __inline register_t > % intr_disable(void) > % { > % =C2=A0 =C2=A0 =C2=A0 register_t s; > % % =C2=A0 =C2=A0 s =3D rdpr(pstate); > % =C2=A0 =C2=A0 =C2=A0 wrpr(pstate, s & ~PSTATE_IE, 0); > % =C2=A0 =C2=A0 =C2=A0 return (s); > % } > > This seems to mask all interrupts, as required. > > =C2=A0 =C2=A0(The interface here is slightly broken (non-MI). =C2=A0It re= turns register_t. > =C2=A0 =C2=A0This assumes that the interrupt state can be represented in = a single > =C2=A0 =C2=A0register. =C2=A0The type critical_t exists to avoid the same= bug in an > =C2=A0 =C2=A0old version of critical_enter(). =C2=A0Now this type is just= bogus. > =C2=A0 =C2=A0critical_enter() no longer returns it. =C2=A0Instead, spinlo= ck_enter() uses > =C2=A0 =C2=A0a non-reentrant interface which stores what used to be the r= eturn value > =C2=A0 =C2=A0of critical_enter() in a per-thread MD data structure (md_sa= ved_pil > =C2=A0 =C2=A0in the above). =C2=A0Most or all arches use register_t for t= his. =C2=A0This > =C2=A0 =C2=A0leaves critical_t as pure garbage -- the only remaining refe= rences to > =C2=A0 =C2=A0it are for its definition.) I mostly agree, I think we should have an MD specified type to replace register_t for this (it could alias it, if it is suitable, but this interface smells a lot like x86-centric). Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 05:30:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6372B1065672; Tue, 27 Sep 2011 05:30:53 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 536238FC12; Tue, 27 Sep 2011 05:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R5UrG2006557; Tue, 27 Sep 2011 05:30:53 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R5UrGV006555; Tue, 27 Sep 2011 05:30:53 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201109270530.p8R5UrGV006555@svn.freebsd.org> From: Robert Millan Date: Tue, 27 Sep 2011 05:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225772 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 05:30:53 -0000 Author: rmh Date: Tue Sep 27 05:30:52 2011 New Revision: 225772 URL: http://svn.freebsd.org/changeset/base/225772 Log: Add myself to committers-src.dot. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Sep 27 03:27:54 2011 (r225771) +++ head/share/misc/committers-src.dot Tue Sep 27 05:30:52 2011 (r225772) @@ -70,6 +70,7 @@ onoe [label="Atsushi Onoe\nonoe@FreeBSD. rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] robert [label="Robert Drehmel\nrobert@FreeBSD.org\n2001/08/23\n2006/05/13"] +rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25\n2010/12/03"] sah [label="Sam Hopkins\nsah@FreeBSD.org\n2004/12/15\n2008/11/10"] shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] @@ -270,6 +271,7 @@ day1 -> alm day1 -> dg adrian -> ray +adrian -> rmh andre -> qingli @@ -440,6 +442,7 @@ kib -> pho kib -> pluknet kib -> rdivacky kib -> rmacklem +kib -> rmh kib -> stas kib -> tijl kib -> trociny From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 06:43:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BA791065670; Tue, 27 Sep 2011 06:43:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63D28FC15; Tue, 27 Sep 2011 06:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R6hpxa008829; Tue, 27 Sep 2011 06:43:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R6hpsv008827; Tue, 27 Sep 2011 06:43:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270643.p8R6hpsv008827@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 06:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225773 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 06:43:52 -0000 Author: pjd Date: Tue Sep 27 06:43:51 2011 New Revision: 225773 URL: http://svn.freebsd.org/changeset/base/225773 Log: Ensure that pjdlog functions don't modify errno. MFC after: 3 days Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Tue Sep 27 05:30:52 2011 (r225772) +++ head/sbin/hastd/pjdlog.c Tue Sep 27 06:43:51 2011 (r225773) @@ -148,11 +148,14 @@ pjdlog_printf_render_sockaddr(struct __p void pjdlog_init(int mode) { + int saved_errno; assert(pjdlog_initialized == PJDLOG_NEVER_INITIALIZED || pjdlog_initialized == PJDLOG_NOT_INITIALIZED); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); + saved_errno = errno; + if (pjdlog_initialized == PJDLOG_NEVER_INITIALIZED) { __use_xprintf = 1; register_printf_render_std("T"); @@ -171,18 +174,25 @@ pjdlog_init(int mode) bzero(pjdlog_prefix, sizeof(pjdlog_prefix)); pjdlog_initialized = PJDLOG_INITIALIZED; + + errno = saved_errno; } void pjdlog_fini(void) { + int saved_errno; assert(pjdlog_initialized == PJDLOG_INITIALIZED); + saved_errno = errno; + if (pjdlog_mode == PJDLOG_MODE_SYSLOG) closelog(); pjdlog_initialized = PJDLOG_NOT_INITIALIZED; + + errno = saved_errno; } /* @@ -194,6 +204,7 @@ pjdlog_fini(void) void pjdlog_mode_set(int mode) { + int saved_errno; assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); @@ -201,12 +212,16 @@ pjdlog_mode_set(int mode) if (pjdlog_mode == mode) return; + saved_errno = errno; + if (mode == PJDLOG_MODE_SYSLOG) openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); else /* if (mode == PJDLOG_MODE_STD) */ closelog(); pjdlog_mode = mode; + + errno = saved_errno; } /* @@ -270,11 +285,16 @@ pjdlog_prefix_set(const char *fmt, ...) void pjdlogv_prefix_set(const char *fmt, va_list ap) { + int saved_errno; assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(fmt != NULL); + saved_errno = errno; + vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap); + + errno = saved_errno; } /* @@ -329,6 +349,7 @@ void pjdlogv_common(int loglevel, int debuglevel, int error, const char *fmt, va_list ap) { + int saved_errno; assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || @@ -342,6 +363,8 @@ pjdlogv_common(int loglevel, int debugle if (loglevel == LOG_DEBUG && debuglevel > pjdlog_debug_level) return; + saved_errno = errno; + switch (pjdlog_mode) { case PJDLOG_MODE_STD: { @@ -398,6 +421,8 @@ pjdlogv_common(int loglevel, int debugle default: assert(!"Invalid mode."); } + + errno = saved_errno; } /* From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:00:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AABC106564A; Tue, 27 Sep 2011 07:00:25 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E86D48FC19; Tue, 27 Sep 2011 07:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R70OFp009430; Tue, 27 Sep 2011 07:00:24 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R70OFc009428; Tue, 27 Sep 2011 07:00:24 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201109270700.p8R70OFc009428@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 27 Sep 2011 07:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225775 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:00:25 -0000 Author: gabor Date: Tue Sep 27 07:00:24 2011 New Revision: 225775 URL: http://svn.freebsd.org/changeset/base/225775 Log: - Move misplaced reference [1] - Sort references [1] - s/Since/Because/ [2] Submitted by: arundel [1], Chad Perrin [2] MFC after: 3 days Modified: head/share/man/man4/smp.4 Modified: head/share/man/man4/smp.4 ============================================================================== --- head/share/man/man4/smp.4 Tue Sep 27 06:53:30 2011 (r225774) +++ head/share/man/man4/smp.4 Tue Sep 27 07:00:24 2011 (r225775) @@ -120,25 +120,24 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hyperthreading_allowed tunable to zero. -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , .Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:05:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 226DD106564A; Tue, 27 Sep 2011 07:05:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 123D58FC12; Tue, 27 Sep 2011 07:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R75fr6009664; Tue, 27 Sep 2011 07:05:41 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R75fGj009662; Tue, 27 Sep 2011 07:05:41 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201109270705.p8R75fGj009662@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 27 Sep 2011 07:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225776 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:05:42 -0000 Author: pluknet Date: Tue Sep 27 07:05:41 2011 New Revision: 225776 URL: http://svn.freebsd.org/changeset/base/225776 Log: Fix typo in OSIOCGIFADDR. MFC after: 3 days Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Sep 27 07:00:24 2011 (r225775) +++ head/share/man/man9/ifnet.9 Tue Sep 27 07:05:41 2011 (r225776) @@ -1252,7 +1252,7 @@ function is called to perform the operat The socket's protocol control routine is called to implement the requested action. .Pp -.It Dv OSIOGIFADDR +.It Dv OSIOCGIFADDR .It Dv OSIOCGIFDSTADDR .It Dv OSIOCGIFBRDADDR .It Dv OSIOCGIFNETMASK From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:06:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BD671065672; Tue, 27 Sep 2011 07:06:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D9A8FC14; Tue, 27 Sep 2011 07:06:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R762gR009727; Tue, 27 Sep 2011 07:06:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R762F9009724; Tue, 27 Sep 2011 07:06:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109270706.p8R762F9009724@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 27 Sep 2011 07:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225777 - in head/sys/dev/usb: . quirk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:06:03 -0000 Author: hselasky Date: Tue Sep 27 07:06:02 2011 New Revision: 225777 URL: http://svn.freebsd.org/changeset/base/225777 Log: Add quirks for some USB mass storage devices which doesn't respond after trying to query the synchronize cache support. Submitted by: Keith White PR: usb/160911 Approved by: re (kensmith) MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Sep 27 07:05:41 2011 (r225776) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Sep 27 07:06:02 2011 (r225777) @@ -457,6 +457,13 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MEDELI, DD305, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI, UQ_MATCH_VENDOR_ONLY), + + /* + * Quirks for manufacturers which USB devices does not respond + * after issuing non-supported commands: + */ + USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), }; #undef USB_QUIRK_VP #undef USB_QUIRK Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 27 07:05:41 2011 (r225776) +++ head/sys/dev/usb/usbdevs Tue Sep 27 07:06:02 2011 (r225777) @@ -1569,6 +1569,7 @@ product EXTENDED XTNDACCESS 0x0100 XTNDA product FALCOM TWIST 0x0001 USB GSM/GPRS Modem /* FEIYA products */ +product FEIYA DUMMY 0x0000 Dummy product product FEIYA 5IN1 0x1132 5-in-1 Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader @@ -2780,6 +2781,7 @@ product RATOC REXUSB60F 0xb020 USB seri /* ReakTek products */ /* Green House and CompUSA OEM this part */ +product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:14:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54C9C106566B; Tue, 27 Sep 2011 07:14:13 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 420B88FC1B; Tue, 27 Sep 2011 07:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7EDNk010045; Tue, 27 Sep 2011 07:14:13 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7EDem010030; Tue, 27 Sep 2011 07:14:13 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201109270714.p8R7EDem010030@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 27 Sep 2011 07:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225778 - in head: . kerberos5/lib/libasn1 kerberos5/lib/libgssapi_krb5 kerberos5/lib/libgssapi_ntlm kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libheimntlm kerber... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:14:13 -0000 Author: stas Date: Tue Sep 27 07:14:12 2011 New Revision: 225778 URL: http://svn.freebsd.org/changeset/base/225778 Log: - Add missing interdependencies to kerberos libraries. Some of the kerberos libraries were not linked properly (missing dependencies), which causes 3rd party applications linking to fail when --as-needed ld flag is used. I also added the --no-undefined ld(1) flag to make sure that there're no missing dependencies. MFC after: 3 days Modified: head/Makefile.inc1 head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_krb5/Makefile head/kerberos5/lib/libgssapi_ntlm/Makefile head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libheimntlm/Makefile head/kerberos5/lib/libhx509/Makefile head/kerberos5/lib/libkadm5clnt/Makefile head/kerberos5/lib/libkadm5srv/Makefile head/kerberos5/lib/libkafs5/Makefile head/kerberos5/lib/libkrb5/Makefile head/kerberos5/lib/libroken/Makefile head/tools/make_libdeps.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Sep 27 07:06:02 2011 (r225777) +++ head/Makefile.inc1 Tue Sep 27 07:14:12 2011 (r225778) @@ -1218,7 +1218,8 @@ _startup_libs+= lib/libc gnu/lib/libgcc__L: lib/libc__L -_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \ +_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libhdb} \ + ${_kerberos5_lib_libheimntlm} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ @@ -1268,6 +1269,19 @@ secure/lib/libssh__L: lib/libgssapi__L k _secure_lib= secure/lib .endif +.if ${MK_KERBEROS} != "no" +kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L +kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L +kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L +kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + secure/lib/libcrypto__L kerberos5/lib/libroken__L +kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ + kerberos5/lib/libroken__L +kerberos5/lib/libroken__L: lib/libcrypt__L +.endif + .if ${MK_GSSAPI} != "no" _lib_libgssapi= lib/libgssapi .endif @@ -1279,6 +1293,7 @@ _lib_libipx= lib/libipx .if ${MK_KERBEROS} != "no" _kerberos5_lib= kerberos5/lib _kerberos5_lib_libasn1= kerberos5/lib/libasn1 +_kerberos5_lib_libhdb= kerberos5/lib/libhdb _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 _kerberos5_lib_libhx509= kerberos5/lib/libhx509 _kerberos5_lib_libroken= kerberos5/lib/libroken Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libasn1/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= asn1 +LDFLAGS= -Wl,--no-undefined INCS= asn1_err.h heim_asn1.h +LDADD= -lcom_err -lroken +DPADD= ${LIBCOM_ERR} ${LIBROKEN} SRCS= asn1_err.c \ asn1_err.h \ Modified: head/kerberos5/lib/libgssapi_krb5/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libgssapi_krb5/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= gssapi_krb5 -LDFLAGS= -Wl,-Bsymbolic +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined LDADD= -lgssapi -lkrb5 -lhx509 -lcrypto -lroken -lasn1 -lcom_err -lcrypt DPADD= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBCRYPTO} ${LIBROKEN} ${LIBASN1} \ ${LIBCOM_ERR} ${LIBCRYPT} Modified: head/kerberos5/lib/libgssapi_ntlm/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_ntlm/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libgssapi_ntlm/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= gssapi_ntlm -LDFLAGS= -Wl,-Bsymbolic -LDADD= -lkrb5 -lhx509 -lheimntlm -lroken -DPADD= ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBROKEN} +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined +LDADD= -lcrypto -lgssapi -lkrb5 -lhx509 -lheimntlm -lroken +DPADD= ${LIBCRYPTO} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBROKEN} SRCS= accept_sec_context.c \ acquire_cred.c \ Modified: head/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libgssapi_spnego/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= gssapi_spnego -LDFLAGS= -Wl,-Bsymbolic -LDADD= -lgssapi -lasn1 -DPADD= ${LIBGSSAPI} ${LIBASN1} +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined +LDADD= -lgssapi -lasn1 -lroken +DPADD= ${LIBGSSAPI} ${LIBASN1} ${LIBROKEN} SRCS= accept_sec_context.c \ compat.c \ Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libhdb/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= hdb +LDFLAGS= -Wl,--no-undefined +LDADD= -lasn1 -lcom_err -lkrb5 -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} INCS= hdb-private.h \ hdb-protos.h \ Modified: head/kerberos5/lib/libheimntlm/Makefile ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libheimntlm/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= heimntlm +LDFLAGS= -Wl,--no-undefined +LDADD= -lcrypto -lkrb5 +DPADD= ${LIBCRYPTO} ${LIBKRB5} SRCS= ntlm.c INCS= heimntlm.h heimntlm-protos.h CFLAGS+=-I${KRB5DIR}/lib/ntlm Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libhx509/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= hx509 +LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/hx509/version-script.map +LDADD= -lasn1 -lcom_err -lcrypto -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPTO} ${LIBROKEN} INCS= hx509-private.h \ hx509-protos.h \ Modified: head/kerberos5/lib/libkadm5clnt/Makefile ============================================================================== --- head/kerberos5/lib/libkadm5clnt/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libkadm5clnt/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kadm5clnt +LDFLAGS= -Wl,--no-undefined +LDADD= -lcom_err -lkrb5 -lroken +DPADD= ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} INCS= admin.h \ kadm5-private.h \ Modified: head/kerberos5/lib/libkadm5srv/Makefile ============================================================================== --- head/kerberos5/lib/libkadm5srv/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libkadm5srv/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kadm5srv +LDFLAGS= -Wl,--no-undefined +LDADD= -lcom_err -lhdb -lkrb5 -lroken +DPADD= ${LIBCOM_ERR} ${LIBHDB} ${LIBKRB5} ${LIBROKEN} VERSION_MAP= ${KRB5DIR}/lib/kadm5/version-script.map SRCS= acl.c \ Modified: head/kerberos5/lib/libkafs5/Makefile ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libkafs5/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kafs5 +LDFLAGS= -Wl,--no-undefined +LDADD= -lasn1 -lkrb5 -lroken +DPADD= ${LIBASN1} ${LIBKRB5} ${LIBROKEN} INCS= kafs.h MAN= kafs5.3 Modified: head/kerberos5/lib/libkrb5/Makefile ============================================================================== --- head/kerberos5/lib/libkrb5/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libkrb5/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= krb5 +LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map +LDADD= -lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} ${LIBHX509} ${LIBROKEN} INCS= heim_err.h \ heim_threads.h \ Modified: head/kerberos5/lib/libroken/Makefile ============================================================================== --- head/kerberos5/lib/libroken/Makefile Tue Sep 27 07:06:02 2011 (r225777) +++ head/kerberos5/lib/libroken/Makefile Tue Sep 27 07:14:12 2011 (r225778) @@ -1,6 +1,8 @@ # $FreeBSD$ LIB= roken +LDADD= -lcrypt +DPADD= ${LIBCRYPT} INCS= roken.h roken-common.h SRCS= base64.c \ Modified: head/tools/make_libdeps.sh ============================================================================== --- head/tools/make_libdeps.sh Tue Sep 27 07:06:02 2011 (r225777) +++ head/tools/make_libdeps.sh Tue Sep 27 07:14:12 2011 (r225778) @@ -52,7 +52,7 @@ sed -E -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' -e's;-l(gcc)!;gnu/lib/lib\1;g' -e's;-lssp_nonshared!;gnu/lib/libssp/libssp_nonshared;g' - -e's;-l(asn1|heimntlm|hx509|krb5|roken)!;kerberos5/lib/lib\1;g' + -e's;-l(asn1|hdb|heimntlm|hx509|krb5|roken)!;kerberos5/lib/lib\1;g' -e's;-l(crypto|ssh|ssl)!;secure/lib/lib\1;g' -e's;-l([^!]+)!;lib/lib\1;g' " From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:52:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619A5106566B; Tue, 27 Sep 2011 07:52:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46DFC8FC17; Tue, 27 Sep 2011 07:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7qexj011403; Tue, 27 Sep 2011 07:52:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7qek7011399; Tue, 27 Sep 2011 07:52:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270752.p8R7qek7011399@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 07:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225781 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:52:40 -0000 Author: pjd Date: Tue Sep 27 07:52:39 2011 New Revision: 225781 URL: http://svn.freebsd.org/changeset/base/225781 Log: No need to use KEEP_ERRNO() macro around pjdlog functions, as they don't modify errno. MFC after: 3 days Modified: head/sbin/hastd/proto_tcp.c head/sbin/hastd/subr.c Modified: head/sbin/hastd/proto_tcp.c ============================================================================== --- head/sbin/hastd/proto_tcp.c Tue Sep 27 07:33:04 2011 (r225780) +++ head/sbin/hastd/proto_tcp.c Tue Sep 27 07:52:39 2011 (r225781) @@ -298,8 +298,7 @@ tcp_connect(void *ctx, int timeout) flags = fcntl(tctx->tc_fd, F_GETFL); if (flags == -1) { - KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, - "fcntl(F_GETFL) failed")); + pjdlog_common(LOG_DEBUG, 1, errno, "fcntl(F_GETFL) failed"); return (errno); } /* @@ -308,8 +307,8 @@ tcp_connect(void *ctx, int timeout) */ flags |= O_NONBLOCK; if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { - KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, - "fcntl(F_SETFL, O_NONBLOCK) failed")); + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, O_NONBLOCK) failed"); return (errno); } Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Tue Sep 27 07:33:04 2011 (r225780) +++ head/sbin/hastd/subr.c Tue Sep 27 07:52:39 2011 (r225781) @@ -87,14 +87,13 @@ provinfo(struct hast_resource *res, bool res->hr_localfd = open(res->hr_localpath, dowrite ? O_RDWR : O_RDONLY); if (res->hr_localfd < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to open %s", - res->hr_localpath)); + pjdlog_errno(LOG_ERR, "Unable to open %s", + res->hr_localpath); return (-1); } } if (fstat(res->hr_localfd, &sb) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to stat %s", - res->hr_localpath)); + pjdlog_errno(LOG_ERR, "Unable to stat %s", res->hr_localpath); return (-1); } if (S_ISCHR(sb.st_mode)) { @@ -103,16 +102,16 @@ provinfo(struct hast_resource *res, bool */ if (ioctl(res->hr_localfd, DIOCGMEDIASIZE, &res->hr_local_mediasize) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable obtain provider %s mediasize", - res->hr_localpath)); + res->hr_localpath); return (-1); } if (ioctl(res->hr_localfd, DIOCGSECTORSIZE, &res->hr_local_sectorsize) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable obtain provider %s sectorsize", - res->hr_localpath)); + res->hr_localpath); return (-1); } } else if (S_ISREG(sb.st_mode)) { @@ -169,8 +168,8 @@ drop_privs(struct hast_resource *res) pw = getpwnam(HAST_USER); if (pw == NULL) { if (errno != 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to find info about '%s' user", HAST_USER)); + pjdlog_errno(LOG_ERR, + "Unable to find info about '%s' user", HAST_USER); return (-1); } else { pjdlog_error("'%s' user doesn't exist.", HAST_USER); @@ -201,28 +200,27 @@ drop_privs(struct hast_resource *res) pjdlog_errno(LOG_WARNING, "Unable to jail to directory to %s", pw->pw_dir); if (chroot(pw->pw_dir) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable to change root directory to %s", - pw->pw_dir)); + pw->pw_dir); return (-1); } } PJDLOG_VERIFY(chdir("/") == 0); gidset[0] = pw->pw_gid; if (setgroups(1, gidset) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to set groups to gid %u", - (unsigned int)pw->pw_gid)); + pjdlog_errno(LOG_ERR, "Unable to set groups to gid %u", + (unsigned int)pw->pw_gid); return (-1); } if (setgid(pw->pw_gid) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set gid to %u", - (unsigned int)pw->pw_gid)); + pjdlog_errno(LOG_ERR, "Unable to set gid to %u", + (unsigned int)pw->pw_gid); return (-1); } if (setuid(pw->pw_uid) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set uid to %u", - (unsigned int)pw->pw_uid)); + pjdlog_errno(LOG_ERR, "Unable to set uid to %u", + (unsigned int)pw->pw_uid); return (-1); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:57:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87B39106564A; Tue, 27 Sep 2011 07:57:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 773C88FC20; Tue, 27 Sep 2011 07:57:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7vFmp011584; Tue, 27 Sep 2011 07:57:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7vFfb011581; Tue, 27 Sep 2011 07:57:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270757.p8R7vFfb011581@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 07:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225782 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:57:15 -0000 Author: pjd Date: Tue Sep 27 07:57:15 2011 New Revision: 225782 URL: http://svn.freebsd.org/changeset/base/225782 Log: Prefer PJDLOG_ASSERT() and PJDLOG_ABORT() over assert() and abort(). pjdlog versions will log problem to syslog when application is running in background. MFC after: 3 days Modified: head/sbin/hastd/control.c head/sbin/hastd/parse.y head/sbin/hastd/secondary.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Tue Sep 27 07:52:39 2011 (r225781) +++ head/sbin/hastd/control.c Tue Sep 27 07:57:15 2011 (r225782) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -82,8 +81,8 @@ control_set_role_common(struct hastd_con nv_add_string(nvout, name, "resource%u", no); if (res == NULL) { - assert(cfg != NULL); - assert(name != NULL); + PJDLOG_ASSERT(cfg != NULL); + PJDLOG_ASSERT(name != NULL); TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { if (strcmp(res->hr_name, name) == 0) @@ -94,7 +93,7 @@ control_set_role_common(struct hastd_con return; } } - assert(res != NULL); + PJDLOG_ASSERT(res != NULL); /* Send previous role back. */ nv_add_string(nvout, role2str(res->hr_role), "role%u", no); @@ -222,9 +221,9 @@ control_status(struct hastd_config *cfg, struct hast_resource *res, const char *name, unsigned int no) { - assert(cfg != NULL); - assert(nvout != NULL); - assert(name != NULL); + PJDLOG_ASSERT(cfg != NULL); + PJDLOG_ASSERT(nvout != NULL); + PJDLOG_ASSERT(name != NULL); /* Name is always needed. */ nv_add_string(nvout, name, "resource%u", no); @@ -239,7 +238,7 @@ control_status(struct hastd_config *cfg, return; } } - assert(res != NULL); + PJDLOG_ASSERT(res != NULL); nv_add_string(nvout, res->hr_provname, "provname%u", no); nv_add_string(nvout, res->hr_localpath, "localpath%u", no); nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr%u", no); @@ -267,7 +266,7 @@ control_status(struct hastd_config *cfg, switch (res->hr_role) { case HAST_ROLE_PRIMARY: - assert(res->hr_workerpid != 0); + PJDLOG_ASSERT(res->hr_workerpid != 0); /* FALLTHROUGH */ case HAST_ROLE_SECONDARY: if (res->hr_workerpid != 0) @@ -470,7 +469,7 @@ ctrl_thread(void *arg) * something related to us has changes, it sends reload * message to us. */ - assert(res->hr_role == HAST_ROLE_PRIMARY); + PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); primary_config_reload(res, nvin); nv_add_int16(nvout, 0, "error"); break; Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Tue Sep 27 07:52:39 2011 (r225781) +++ head/sbin/hastd/parse.y Tue Sep 27 07:57:15 2011 (r225782) @@ -38,7 +38,6 @@ #include -#include #include #include #include @@ -282,9 +281,9 @@ yy_config_parse(const char *config, bool } } TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { - assert(curres->hr_provname[0] != '\0'); - assert(curres->hr_localpath[0] != '\0'); - assert(curres->hr_remoteaddr[0] != '\0'); + PJDLOG_ASSERT(curres->hr_provname[0] != '\0'); + PJDLOG_ASSERT(curres->hr_localpath[0] != '\0'); + PJDLOG_ASSERT(curres->hr_remoteaddr[0] != '\0'); if (curres->hr_replication == -1) { /* @@ -426,7 +425,7 @@ control_statement: CONTROL STR } break; default: - assert(!"control at wrong depth level"); + PJDLOG_ABORT("control at wrong depth level"); } free($2); } @@ -460,7 +459,7 @@ listen_statement: LISTEN STR free(lst); break; default: - assert(!"listen at wrong depth level"); + PJDLOG_ABORT("listen at wrong depth level"); } free($2); } @@ -477,7 +476,7 @@ replication_statement: REPLICATION repli curres->hr_replication = $2; break; default: - assert(!"replication at wrong depth level"); + PJDLOG_ABORT("replication at wrong depth level"); } } ; @@ -501,7 +500,7 @@ checksum_statement: CHECKSUM checksum_ty curres->hr_checksum = $2; break; default: - assert(!"checksum at wrong depth level"); + PJDLOG_ABORT("checksum at wrong depth level"); } } ; @@ -525,7 +524,7 @@ compression_statement: COMPRESSION compr curres->hr_compression = $2; break; default: - assert(!"compression at wrong depth level"); + PJDLOG_ABORT("compression at wrong depth level"); } } ; @@ -553,7 +552,7 @@ timeout_statement: TIMEOUT NUM curres->hr_timeout = $2; break; default: - assert(!"timeout at wrong depth level"); + PJDLOG_ABORT("timeout at wrong depth level"); } } ; @@ -581,7 +580,7 @@ exec_statement: EXEC STR } break; default: - assert(!"exec at wrong depth level"); + PJDLOG_ABORT("exec at wrong depth level"); } free($2); } @@ -605,7 +604,7 @@ node_start: STR mynode = true; break; default: - assert(!"invalid isitme() return value"); + PJDLOG_ABORT("invalid isitme() return value"); } free($1); } @@ -785,7 +784,7 @@ name_statement: NAME STR case 2: if (!mynode) break; - assert(curres != NULL); + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_provname, $2, sizeof(curres->hr_provname)) >= sizeof(curres->hr_provname)) { @@ -795,7 +794,7 @@ name_statement: NAME STR } break; default: - assert(!"name at wrong depth level"); + PJDLOG_ABORT("name at wrong depth level"); } free($2); } @@ -816,7 +815,7 @@ local_statement: LOCAL STR case 2: if (!mynode) break; - assert(curres != NULL); + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_localpath, $2, sizeof(curres->hr_localpath)) >= sizeof(curres->hr_localpath)) { @@ -826,7 +825,7 @@ local_statement: LOCAL STR } break; default: - assert(!"local at wrong depth level"); + PJDLOG_ABORT("local at wrong depth level"); } free($2); } @@ -851,7 +850,7 @@ resource_node_start: STR mynode = hadmynode = true; break; default: - assert(!"invalid isitme() return value"); + PJDLOG_ABORT("invalid isitme() return value"); } } free($1); @@ -875,9 +874,9 @@ resource_node_entry: remote_statement: REMOTE remote_str { - assert(depth == 2); + PJDLOG_ASSERT(depth == 2); if (mynode) { - assert(curres != NULL); + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_remoteaddr, $2, sizeof(curres->hr_remoteaddr)) >= sizeof(curres->hr_remoteaddr)) { @@ -898,9 +897,9 @@ remote_str: source_statement: SOURCE STR { - assert(depth == 2); + PJDLOG_ASSERT(depth == 2); if (mynode) { - assert(curres != NULL); + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_sourceaddr, $2, sizeof(curres->hr_sourceaddr)) >= sizeof(curres->hr_sourceaddr)) { Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Tue Sep 27 07:52:39 2011 (r225781) +++ head/sbin/hastd/secondary.c Tue Sep 27 07:57:15 2011 (r225782) @@ -791,8 +791,8 @@ send_thread(void *arg) length = 0; break; default: - abort(); - break; + PJDLOG_ABORT("Unexpected command (cmd=%hhu).", + hio->hio_cmd); } if (hio->hio_error != 0) nv_add_int16(nvout, hio->hio_error, "error"); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 07:59:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D898106564A; Tue, 27 Sep 2011 07:59:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB2D8FC12; Tue, 27 Sep 2011 07:59:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7xBqK011676; Tue, 27 Sep 2011 07:59:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7xBZU011674; Tue, 27 Sep 2011 07:59:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270759.p8R7xBZU011674@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 07:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225783 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:59:11 -0000 Author: pjd Date: Tue Sep 27 07:59:10 2011 New Revision: 225783 URL: http://svn.freebsd.org/changeset/base/225783 Log: Correct two mistakes when converting asserts to PJDLOG_ASSERT()/PJDLOG_ABORT(). MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Sep 27 07:57:15 2011 (r225782) +++ head/sbin/hastd/primary.c Tue Sep 27 07:59:10 2011 (r225783) @@ -1421,8 +1421,7 @@ remote_send_thread(void *arg) length = 0; break; default: - PJDLOG_ASSERT(!"invalid condition"); - abort(); + PJDLOG_ABORT("invalid condition"); } nv = nv_alloc(); nv_add_uint8(nv, cmd, "cmd"); @@ -1621,8 +1620,7 @@ remote_recv_thread(void *arg) case BIO_FLUSH: break; default: - PJDLOG_ASSERT(!"invalid condition"); - abort(); + PJDLOG_ABORT("invalid condition"); } hio->hio_errors[ncomp] = 0; nv_free(nv); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 08:04:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55E05106564A; Tue, 27 Sep 2011 08:04:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C6E78FC16; Tue, 27 Sep 2011 08:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R842Zp011883; Tue, 27 Sep 2011 08:04:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R842W1011881; Tue, 27 Sep 2011 08:04:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270804.p8R842W1011881@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 08:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225784 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 08:04:02 -0000 Author: pjd Date: Tue Sep 27 08:04:01 2011 New Revision: 225784 URL: http://svn.freebsd.org/changeset/base/225784 Log: - Convert some impossible conditions into assertions. - Add missing 'if' in comment. MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Tue Sep 27 07:59:10 2011 (r225783) +++ head/sbin/hastd/parse.y Tue Sep 27 08:04:01 2011 (r225784) @@ -472,8 +472,8 @@ replication_statement: REPLICATION repli depth0_replication = $2; break; case 1: - if (curres != NULL) - curres->hr_replication = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_replication = $2; break; default: PJDLOG_ABORT("replication at wrong depth level"); @@ -496,8 +496,8 @@ checksum_statement: CHECKSUM checksum_ty depth0_checksum = $2; break; case 1: - if (curres != NULL) - curres->hr_checksum = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_checksum = $2; break; default: PJDLOG_ABORT("checksum at wrong depth level"); @@ -520,8 +520,8 @@ compression_statement: COMPRESSION compr depth0_compression = $2; break; case 1: - if (curres != NULL) - curres->hr_compression = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_compression = $2; break; default: PJDLOG_ABORT("compression at wrong depth level"); @@ -548,8 +548,8 @@ timeout_statement: TIMEOUT NUM depth0_timeout = $2; break; case 1: - if (curres != NULL) - curres->hr_timeout = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_timeout = $2; break; default: PJDLOG_ABORT("timeout at wrong depth level"); @@ -569,8 +569,7 @@ exec_statement: EXEC STR } break; case 1: - if (curres == NULL) - break; + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_exec, $2, sizeof(curres->hr_exec)) >= sizeof(curres->hr_exec)) { @@ -639,7 +638,7 @@ resource_statement: RESOURCE resource_st } /* - * Let's see there are some resource-level settings + * Let's see if there are some resource-level settings * that we can use for node-level settings. */ if (curres->hr_provname[0] == '\0' && From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 08:21:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49860106566B; Tue, 27 Sep 2011 08:21:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37DE08FC15; Tue, 27 Sep 2011 08:21:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R8L1E5012418; Tue, 27 Sep 2011 08:21:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R8L1Yd012416; Tue, 27 Sep 2011 08:21:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270821.p8R8L1Yd012416@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 08:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225785 - head/sbin/hastctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 08:21:01 -0000 Author: pjd Date: Tue Sep 27 08:21:00 2011 New Revision: 225785 URL: http://svn.freebsd.org/changeset/base/225785 Log: Prefer PJDLOG_ASSERT()/PJDLOG_ABORT() over assert(). MFC after: 3 days Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Tue Sep 27 08:04:01 2011 (r225784) +++ head/sbin/hastctl/hastctl.c Tue Sep 27 08:21:00 2011 (r225785) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -433,19 +432,19 @@ main(int argc, char *argv[]) pjdlog_debug_set(debug); cfg = yy_config_parse(cfgpath, true); - assert(cfg != NULL); + PJDLOG_ASSERT(cfg != NULL); switch (cmd) { case CMD_CREATE: control_create(argc, argv, mediasize, extentsize, keepdirty); /* NOTREACHED */ - assert(!"What are we doing here?!"); + PJDLOG_ABORT("What are we doing here?!"); break; case CMD_DUMP: /* Dump metadata from local component of the given resource. */ control_dump(argc, argv); /* NOTREACHED */ - assert(!"What are we doing here?!"); + PJDLOG_ABORT("What are we doing here?!"); break; case CMD_ROLE: /* Change role for the given resources. */ @@ -476,7 +475,7 @@ main(int argc, char *argv[]) } break; default: - assert(!"Impossible command!"); + PJDLOG_ABORT("Impossible command!"); } /* Setup control connection... */ @@ -523,7 +522,7 @@ main(int argc, char *argv[]) error = control_status(nv); break; default: - assert(!"Impossible command!"); + PJDLOG_ABORT("Impossible command!"); } exit(error); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 08:26:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54142106564A; Tue, 27 Sep 2011 08:26:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444EE8FC0A; Tue, 27 Sep 2011 08:26:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R8QAfJ012616; Tue, 27 Sep 2011 08:26:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R8QAUG012614; Tue, 27 Sep 2011 08:26:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270826.p8R8QAUG012614@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 08:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225786 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 08:26:10 -0000 Author: pjd Date: Tue Sep 27 08:26:09 2011 New Revision: 225786 URL: http://svn.freebsd.org/changeset/base/225786 Log: No need to wrap pjdlog functions around with KEEP_ERRNO() macro. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Sep 27 08:21:00 2011 (r225785) +++ head/sbin/hastd/primary.c Tue Sep 27 08:26:09 2011 (r225786) @@ -293,8 +293,7 @@ hast_activemap_flush(struct hast_resourc PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0); if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to flush activemap to disk")); + pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); return (-1); } return (0); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 08:50:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBC3C106566B; Tue, 27 Sep 2011 08:50:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAF288FC17; Tue, 27 Sep 2011 08:50:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R8obfS013421; Tue, 27 Sep 2011 08:50:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R8obQB013411; Tue, 27 Sep 2011 08:50:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270850.p8R8obQB013411@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 08:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225787 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 08:50:37 -0000 Author: pjd Date: Tue Sep 27 08:50:37 2011 New Revision: 225787 URL: http://svn.freebsd.org/changeset/base/225787 Log: Use PJDLOG_ASSERT() and PJDLOG_ABORT() everywhere instead of assert(). MFC after: 3 days Modified: head/sbin/hastd/activemap.c head/sbin/hastd/ebuf.c head/sbin/hastd/event.c head/sbin/hastd/hast_proto.c head/sbin/hastd/hooks.c head/sbin/hastd/metadata.c head/sbin/hastd/nv.c head/sbin/hastd/rangelock.c head/sbin/hastd/synch.h Modified: head/sbin/hastd/activemap.c ============================================================================== --- head/sbin/hastd/activemap.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/activemap.c Tue Sep 27 08:50:37 2011 (r225787) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include /* powerof2() */ #include -#include #include #include #include @@ -41,7 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + +#include "activemap.h" + +#ifndef PJDLOG_ASSERT +#include +#define PJDLOG_ASSERT(...) assert(__VA_ARGS__) +#endif #define ACTIVEMAP_MAGIC 0xac71e4 struct activemap { @@ -93,9 +99,9 @@ off2ext(const struct activemap *amp, off { int extent; - assert(offset >= 0 && offset < amp->am_mediasize); + PJDLOG_ASSERT(offset >= 0 && offset < amp->am_mediasize); extent = (offset >> amp->am_extentshift); - assert(extent >= 0 && extent < amp->am_nextents); + PJDLOG_ASSERT(extent >= 0 && extent < amp->am_nextents); return (extent); } @@ -104,9 +110,9 @@ ext2off(const struct activemap *amp, int { off_t offset; - assert(extent >= 0 && extent < amp->am_nextents); + PJDLOG_ASSERT(extent >= 0 && extent < amp->am_nextents); offset = ((off_t)extent << amp->am_extentshift); - assert(offset >= 0 && offset < amp->am_mediasize); + PJDLOG_ASSERT(offset >= 0 && offset < amp->am_mediasize); return (offset); } @@ -122,7 +128,7 @@ ext2reqs(const struct activemap *amp, in if (ext < amp->am_nextents - 1) return (((amp->am_extentsize - 1) / MAXPHYS) + 1); - assert(ext == amp->am_nextents - 1); + PJDLOG_ASSERT(ext == amp->am_nextents - 1); left = amp->am_mediasize % amp->am_extentsize; if (left == 0) left = amp->am_extentsize; @@ -139,13 +145,13 @@ activemap_init(struct activemap **ampp, { struct activemap *amp; - assert(ampp != NULL); - assert(mediasize > 0); - assert(extentsize > 0); - assert(powerof2(extentsize)); - assert(sectorsize > 0); - assert(powerof2(sectorsize)); - assert(keepdirty > 0); + PJDLOG_ASSERT(ampp != NULL); + PJDLOG_ASSERT(mediasize > 0); + PJDLOG_ASSERT(extentsize > 0); + PJDLOG_ASSERT(powerof2(extentsize)); + PJDLOG_ASSERT(sectorsize > 0); + PJDLOG_ASSERT(powerof2(sectorsize)); + PJDLOG_ASSERT(keepdirty > 0); amp = malloc(sizeof(*amp)); if (amp == NULL) @@ -225,10 +231,10 @@ keepdirty_add(struct activemap *amp, int */ if (amp->am_nkeepdirty >= amp->am_nkeepdirty_limit) { kd = TAILQ_LAST(&->am_keepdirty, skeepdirty); - assert(kd != NULL); + PJDLOG_ASSERT(kd != NULL); TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); amp->am_nkeepdirty--; - assert(amp->am_nkeepdirty > 0); + PJDLOG_ASSERT(amp->am_nkeepdirty > 0); } if (kd == NULL) kd = malloc(sizeof(*kd)); @@ -261,7 +267,7 @@ keepdirty_free(struct activemap *amp) amp->am_nkeepdirty--; free(kd); } - assert(amp->am_nkeepdirty == 0); + PJDLOG_ASSERT(amp->am_nkeepdirty == 0); } /* @@ -271,7 +277,7 @@ void activemap_free(struct activemap *amp) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); amp->am_magic = 0; @@ -293,8 +299,8 @@ activemap_write_start(struct activemap * off_t end; int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(length > 0); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(length > 0); modified = false; end = offset + length - 1; @@ -307,7 +313,7 @@ activemap_write_start(struct activemap * * was modified and has to be flushed to disk. */ if (amp->am_memtab[ext]++ == 0) { - assert(!bit_test(amp->am_memmap, ext)); + PJDLOG_ASSERT(!bit_test(amp->am_memmap, ext)); bit_set(amp->am_memmap, ext); amp->am_ndirty++; } @@ -329,8 +335,8 @@ activemap_write_complete(struct activema off_t end; int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(length > 0); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(length > 0); modified = false; end = offset + length - 1; @@ -342,8 +348,8 @@ activemap_write_complete(struct activema * By returning true we inform the caller that on-disk bitmap * was modified and has to be flushed to disk. */ - assert(amp->am_memtab[ext] > 0); - assert(bit_test(amp->am_memmap, ext)); + PJDLOG_ASSERT(amp->am_memtab[ext] > 0); + PJDLOG_ASSERT(bit_test(amp->am_memmap, ext)); if (--amp->am_memtab[ext] == 0) { bit_clear(amp->am_memmap, ext); amp->am_ndirty--; @@ -365,15 +371,15 @@ activemap_extent_complete(struct activem bool modified; int reqs; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(extent >= 0 && extent < amp->am_nextents); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(extent >= 0 && extent < amp->am_nextents); modified = false; reqs = ext2reqs(amp, extent); - assert(amp->am_memtab[extent] >= reqs); + PJDLOG_ASSERT(amp->am_memtab[extent] >= reqs); amp->am_memtab[extent] -= reqs; - assert(bit_test(amp->am_memmap, extent)); + PJDLOG_ASSERT(bit_test(amp->am_memmap, extent)); if (amp->am_memtab[extent] == 0) { bit_clear(amp->am_memmap, extent); amp->am_ndirty--; @@ -390,7 +396,7 @@ uint64_t activemap_ndirty(const struct activemap *amp) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); return (amp->am_ndirty); } @@ -403,7 +409,7 @@ bool activemap_differ(const struct activemap *amp) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); return (memcmp(amp->am_diskmap, amp->am_memmap, amp->am_mapsize) != 0); @@ -416,7 +422,7 @@ size_t activemap_size(const struct activemap *amp) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); return (amp->am_mapsize); } @@ -429,7 +435,7 @@ size_t activemap_ondisk_size(const struct activemap *amp) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); return (amp->am_diskmapsize); } @@ -442,8 +448,8 @@ activemap_copyin(struct activemap *amp, { int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(size >= amp->am_mapsize); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(size >= amp->am_mapsize); memcpy(amp->am_diskmap, buf, amp->am_mapsize); memcpy(amp->am_memmap, buf, amp->am_mapsize); @@ -481,8 +487,8 @@ activemap_merge(struct activemap *amp, c bitstr_t *remmap = __DECONST(bitstr_t *, buf); int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(size >= amp->am_mapsize); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(size >= amp->am_mapsize); bit_ffs(remmap, amp->am_nextents, &ext); if (ext == -1) { @@ -521,7 +527,7 @@ const unsigned char * activemap_bitmap(struct activemap *amp, size_t *sizep) { - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); if (sizep != NULL) *sizep = amp->am_diskmapsize; @@ -539,11 +545,11 @@ activemap_calc_ondisk_size(uint64_t medi { uint64_t nextents, mapsize; - assert(mediasize > 0); - assert(extentsize > 0); - assert(powerof2(extentsize)); - assert(sectorsize > 0); - assert(powerof2(sectorsize)); + PJDLOG_ASSERT(mediasize > 0); + PJDLOG_ASSERT(extentsize > 0); + PJDLOG_ASSERT(powerof2(extentsize)); + PJDLOG_ASSERT(sectorsize > 0); + PJDLOG_ASSERT(powerof2(sectorsize)); nextents = ((mediasize - 1) / extentsize) + 1; mapsize = sizeof(bitstr_t) * bitstr_size(nextents); @@ -558,7 +564,7 @@ activemap_sync_rewind(struct activemap * { int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); bit_ffs(amp->am_syncmap, amp->am_nextents, &ext); if (ext == -1) { @@ -581,9 +587,9 @@ activemap_sync_offset(struct activemap * off_t syncoff, left; int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); - assert(lengthp != NULL); - assert(syncextp != NULL); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(lengthp != NULL); + PJDLOG_ASSERT(syncextp != NULL); *syncextp = -1; @@ -632,9 +638,10 @@ activemap_sync_offset(struct activemap * if (left > MAXPHYS) left = MAXPHYS; - assert(left >= 0 && left <= MAXPHYS); - assert(syncoff >= 0 && syncoff < amp->am_mediasize); - assert(syncoff + left >= 0 && syncoff + left <= amp->am_mediasize); + PJDLOG_ASSERT(left >= 0 && left <= MAXPHYS); + PJDLOG_ASSERT(syncoff >= 0 && syncoff < amp->am_mediasize); + PJDLOG_ASSERT(syncoff + left >= 0 && + syncoff + left <= amp->am_mediasize); *lengthp = left; return (syncoff); @@ -651,7 +658,7 @@ activemap_need_sync(struct activemap *am off_t end; int ext; - assert(amp->am_magic == ACTIVEMAP_MAGIC); + PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC); modified = false; end = offset + length - 1; @@ -659,7 +666,7 @@ activemap_need_sync(struct activemap *am for (ext = off2ext(amp, offset); ext <= off2ext(amp, end); ext++) { if (bit_test(amp->am_syncmap, ext)) { /* Already marked for synchronization. */ - assert(bit_test(amp->am_memmap, ext)); + PJDLOG_ASSERT(bit_test(amp->am_memmap, ext)); continue; } bit_set(amp->am_syncmap, ext); Modified: head/sbin/hastd/ebuf.c ============================================================================== --- head/sbin/hastd/ebuf.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/ebuf.c Tue Sep 27 08:50:37 2011 (r225787) @@ -32,15 +32,21 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include #include #include +#include + #include "ebuf.h" +#ifndef PJDLOG_ASSERT +#include +#define PJDLOG_ASSERT(...) assert(__VA_ARGS__) +#endif + #define EBUF_MAGIC 0xeb0f41c struct ebuf { /* Magic to assert the caller uses valid structure. */ @@ -91,7 +97,7 @@ void ebuf_free(struct ebuf *eb) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); eb->eb_magic = 0; @@ -103,7 +109,7 @@ int ebuf_add_head(struct ebuf *eb, const void *data, size_t size) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); if (size > (size_t)(eb->eb_used - eb->eb_start)) { /* @@ -113,7 +119,7 @@ ebuf_add_head(struct ebuf *eb, const voi if (ebuf_head_extend(eb, size) < 0) return (-1); } - assert(size <= (size_t)(eb->eb_used - eb->eb_start)); + PJDLOG_ASSERT(size <= (size_t)(eb->eb_used - eb->eb_start)); eb->eb_size += size; eb->eb_used -= size; @@ -130,7 +136,7 @@ int ebuf_add_tail(struct ebuf *eb, const void *data, size_t size) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); if (size > (size_t)(eb->eb_end - (eb->eb_used + eb->eb_size))) { /* @@ -140,7 +146,8 @@ ebuf_add_tail(struct ebuf *eb, const voi if (ebuf_tail_extend(eb, size) < 0) return (-1); } - assert(size <= (size_t)(eb->eb_end - (eb->eb_used + eb->eb_size))); + PJDLOG_ASSERT(size <= + (size_t)(eb->eb_end - (eb->eb_used + eb->eb_size))); /* * If data is NULL the caller just wants to reserve space. @@ -156,8 +163,8 @@ void ebuf_del_head(struct ebuf *eb, size_t size) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); - assert(size <= eb->eb_size); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(size <= eb->eb_size); eb->eb_used += size; eb->eb_size -= size; @@ -167,8 +174,8 @@ void ebuf_del_tail(struct ebuf *eb, size_t size) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); - assert(size <= eb->eb_size); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(size <= eb->eb_size); eb->eb_size -= size; } @@ -180,7 +187,7 @@ void * ebuf_data(struct ebuf *eb, size_t *sizep) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); if (sizep != NULL) *sizep = eb->eb_size; @@ -194,7 +201,7 @@ size_t ebuf_size(struct ebuf *eb) { - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); return (eb->eb_size); } @@ -208,7 +215,7 @@ ebuf_head_extend(struct ebuf *eb, size_t unsigned char *newstart, *newused; size_t newsize; - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); newsize = eb->eb_end - eb->eb_start + (PAGE_SIZE / 4) + size; @@ -236,7 +243,7 @@ ebuf_tail_extend(struct ebuf *eb, size_t unsigned char *newstart; size_t newsize; - assert(eb != NULL && eb->eb_magic == EBUF_MAGIC); + PJDLOG_ASSERT(eb != NULL && eb->eb_magic == EBUF_MAGIC); newsize = eb->eb_end - eb->eb_start + size + ((3 * PAGE_SIZE) / 4); Modified: head/sbin/hastd/event.c ============================================================================== --- head/sbin/hastd/event.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/event.c Tue Sep 27 08:50:37 2011 (r225787) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include "hast.h" @@ -46,8 +45,8 @@ event_send(const struct hast_resource *r struct nv *nvin, *nvout; int error; - assert(res != NULL); - assert(event >= EVENT_MIN && event <= EVENT_MAX); + PJDLOG_ASSERT(res != NULL); + PJDLOG_ASSERT(event >= EVENT_MIN && event <= EVENT_MAX); nvin = nvout = NULL; @@ -89,7 +88,7 @@ event_recv(const struct hast_resource *r uint8_t event; int error; - assert(res != NULL); + PJDLOG_ASSERT(res != NULL); nvin = nvout = NULL; Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/hast_proto.c Tue Sep 27 08:50:37 2011 (r225787) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include @@ -158,7 +157,7 @@ hast_proto_recv_hdr(const struct proto_c if (ebuf_add_tail(eb, NULL, hdr.size) < 0) goto fail; hptr = ebuf_data(eb, NULL); - assert(hptr != NULL); + PJDLOG_ASSERT(hptr != NULL); if (proto_recv(conn, hptr, hdr.size) < 0) goto fail; nv = nv_ntoh(eb); @@ -183,8 +182,8 @@ hast_proto_recv_data(const struct hast_r void *dptr; int ret; - assert(data != NULL); - assert(size > 0); + PJDLOG_ASSERT(data != NULL); + PJDLOG_ASSERT(size > 0); ret = -1; freedata = false; Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/hooks.c Tue Sep 27 08:50:37 2011 (r225787) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -138,7 +137,7 @@ void hook_init(void) { - assert(!hooks_initialized); + PJDLOG_ASSERT(!hooks_initialized); mtx_init(&hookprocs_lock); TAILQ_INIT(&hookprocs); @@ -150,12 +149,12 @@ hook_fini(void) { struct hookproc *hp; - assert(hooks_initialized); + PJDLOG_ASSERT(hooks_initialized); mtx_lock(&hookprocs_lock); while ((hp = TAILQ_FIRST(&hookprocs)) != NULL) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); - assert(hp->hp_pid > 0); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + PJDLOG_ASSERT(hp->hp_pid > 0); hook_remove(hp); hook_free(hp); @@ -201,8 +200,8 @@ static void hook_add(struct hookproc *hp, pid_t pid) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); - assert(hp->hp_pid == 0); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); + PJDLOG_ASSERT(hp->hp_pid == 0); hp->hp_pid = pid; mtx_lock(&hookprocs_lock); @@ -215,9 +214,9 @@ static void hook_remove(struct hookproc *hp) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); - assert(hp->hp_pid > 0); - assert(mtx_owned(&hookprocs_lock)); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + PJDLOG_ASSERT(hp->hp_pid > 0); + PJDLOG_ASSERT(mtx_owned(&hookprocs_lock)); TAILQ_REMOVE(&hookprocs, hp, hp_next); hp->hp_magic = HOOKPROC_MAGIC_ALLOCATED; @@ -227,8 +226,8 @@ static void hook_free(struct hookproc *hp) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); - assert(hp->hp_pid > 0); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); + PJDLOG_ASSERT(hp->hp_pid > 0); hp->hp_magic = 0; free(hp); @@ -239,11 +238,11 @@ hook_find(pid_t pid) { struct hookproc *hp; - assert(mtx_owned(&hookprocs_lock)); + PJDLOG_ASSERT(mtx_owned(&hookprocs_lock)); TAILQ_FOREACH(hp, &hookprocs, hp_next) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); - assert(hp->hp_pid > 0); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + PJDLOG_ASSERT(hp->hp_pid > 0); if (hp->hp_pid == pid) break; @@ -286,7 +285,7 @@ hook_check(void) struct hookproc *hp, *hp2; time_t now; - assert(hooks_initialized); + PJDLOG_ASSERT(hooks_initialized); pjdlog_debug(2, "Checking hooks."); @@ -296,8 +295,8 @@ hook_check(void) now = time(NULL); mtx_lock(&hookprocs_lock); TAILQ_FOREACH_SAFE(hp, &hookprocs, hp_next, hp2) { - assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); - assert(hp->hp_pid > 0); + PJDLOG_ASSERT(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + PJDLOG_ASSERT(hp->hp_pid > 0); /* * If process doesn't exists we somehow missed it. @@ -347,7 +346,7 @@ hook_execv(const char *path, va_list ap) sigset_t mask; pid_t pid; - assert(hooks_initialized); + PJDLOG_ASSERT(hooks_initialized); if (path == NULL || path[0] == '\0') return; @@ -359,7 +358,7 @@ hook_execv(const char *path, va_list ap) if (args[ii] == NULL) break; } - assert(ii < sizeof(args) / sizeof(args[0])); + PJDLOG_ASSERT(ii < sizeof(args) / sizeof(args[0])); hp = hook_alloc(path, args); if (hp == NULL) Modified: head/sbin/hastd/metadata.c ============================================================================== --- head/sbin/hastd/metadata.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/metadata.c Tue Sep 27 08:50:37 2011 (r225787) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -100,7 +99,7 @@ metadata_read(struct hast_resource *res, goto fail; } buf = ebuf_data(eb, NULL); - assert(buf != NULL); + PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { rerrno = errno; @@ -197,7 +196,7 @@ metadata_write(struct hast_resource *res nv_add_uint64(nv, res->hr_primary_localcnt, "localcnt"); nv_add_uint64(nv, res->hr_primary_remotecnt, "remotecnt"); } else /* if (res->hr_role == HAST_ROLE_SECONDARY) */ { - assert(res->hr_role == HAST_ROLE_SECONDARY); + PJDLOG_ASSERT(res->hr_role == HAST_ROLE_SECONDARY); nv_add_uint64(nv, res->hr_secondary_localcnt, "localcnt"); nv_add_uint64(nv, res->hr_secondary_remotecnt, "remotecnt"); } @@ -208,10 +207,10 @@ metadata_write(struct hast_resource *res } res->hr_previous_role = res->hr_role; eb = nv_hton(nv); - assert(eb != NULL); + PJDLOG_ASSERT(eb != NULL); ptr = ebuf_data(eb, &size); - assert(ptr != NULL); - assert(size < METADATA_SIZE); + PJDLOG_ASSERT(ptr != NULL); + PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/nv.c Tue Sep 27 08:50:37 2011 (r225787) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -44,7 +43,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + +#include "nv.h" + +#ifndef PJDLOG_ASSERT +#include +#define PJDLOG_ASSERT(...) assert(__VA_ARGS__) +#endif +#ifndef PJDLOG_ABORT +#define PJDLOG_ABORT(...) abort() +#endif #define NV_TYPE_NONE 0 @@ -98,8 +107,8 @@ struct nvhdr { #define NVH_SIZE(nvh) (NVH_HSIZE(nvh) + roundup2(NVH_DSIZE(nvh), 8)) #define NV_CHECK(nv) do { \ - assert((nv) != NULL); \ - assert((nv)->nv_magic == NV_MAGIC); \ + PJDLOG_ASSERT((nv) != NULL); \ + PJDLOG_ASSERT((nv)->nv_magic == NV_MAGIC); \ } while (0) static void nv_add(struct nv *nv, const unsigned char *value, size_t vsize, @@ -200,7 +209,7 @@ nv_validate(struct nv *nv, size_t *extra } NV_CHECK(nv); - assert(nv->nv_error == 0); + PJDLOG_ASSERT(nv->nv_error == 0); /* TODO: Check that names are unique? */ @@ -308,7 +317,7 @@ nv_validate(struct nv *nv, size_t *extra } break; default: - assert(!"invalid condition"); + PJDLOG_ABORT("invalid condition"); } if (error != 0) break; @@ -338,7 +347,7 @@ nv_hton(struct nv *nv) size_t size; NV_CHECK(nv); - assert(nv->nv_error == 0); + PJDLOG_ASSERT(nv->nv_error == 0); ptr = ebuf_data(nv->nv_ebuf, &size); while (size > 0) { @@ -346,9 +355,9 @@ nv_hton(struct nv *nv) * Minimum size at this point is size of nvhdr structure, * one character long name plus terminating '\0'. */ - assert(size >= sizeof(*nvh) + 2); + PJDLOG_ASSERT(size >= sizeof(*nvh) + 2); nvh = (struct nvhdr *)ptr; - assert(NVH_SIZE(nvh) <= size); + PJDLOG_ASSERT(NVH_SIZE(nvh) <= size); nv_swap(nvh, false); ptr += NVH_SIZE(nvh); size -= NVH_SIZE(nvh); @@ -367,7 +376,7 @@ nv_ntoh(struct ebuf *eb) size_t extra; int rerrno; - assert(eb != NULL); + PJDLOG_ASSERT(eb != NULL); nv = malloc(sizeof(*nv)); if (nv == NULL) @@ -494,8 +503,8 @@ nv_get_##type(struct nv *nv, const char va_end(nameap); \ if (nvh == NULL) \ return (0); \ - assert((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); \ - assert(sizeof(value) == nvh->nvh_dsize); \ + PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST);\ + PJDLOG_ASSERT(sizeof(value) == nvh->nvh_dsize); \ bcopy(NVH_DATA(nvh), &value, sizeof(value)); \ \ return (value); \ @@ -525,8 +534,8 @@ nv_get_##type##_array(struct nv *nv, siz va_end(nameap); \ if (nvh == NULL) \ return (NULL); \ - assert((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); \ - assert((nvh->nvh_dsize % sizeof(type##_t)) == 0); \ + PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST);\ + PJDLOG_ASSERT((nvh->nvh_dsize % sizeof(type##_t)) == 0); \ if (sizep != NULL) \ *sizep = nvh->nvh_dsize / sizeof(type##_t); \ return ((type##_t *)(void *)NVH_DATA(nvh)); \ @@ -555,11 +564,11 @@ nv_get_string(struct nv *nv, const char va_end(nameap); if (nvh == NULL) return (NULL); - assert((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); - assert(nvh->nvh_dsize >= 1); + PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); + PJDLOG_ASSERT(nvh->nvh_dsize >= 1); str = NVH_DATA(nvh); - assert(str[nvh->nvh_dsize - 1] == '\0'); - assert(strlen(str) == nvh->nvh_dsize - 1); + PJDLOG_ASSERT(str[nvh->nvh_dsize - 1] == '\0'); + PJDLOG_ASSERT(strlen(str) == nvh->nvh_dsize - 1); return (str); } @@ -602,7 +611,7 @@ nv_assert(struct nv *nv, const char *nam va_list nameap; va_start(nameap, namefmt); - assert(nv_vexists(nv, namefmt, nameap)); + PJDLOG_ASSERT(nv_vexists(nv, namefmt, nameap)); va_end(nameap); } @@ -624,13 +633,13 @@ nv_dump(struct nv *nv) } NV_CHECK(nv); - assert(nv->nv_error == 0); + PJDLOG_ASSERT(nv->nv_error == 0); ptr = ebuf_data(nv->nv_ebuf, &size); while (size > 0) { - assert(size >= sizeof(*nvh) + 2); + PJDLOG_ASSERT(size >= sizeof(*nvh) + 2); nvh = (struct nvhdr *)ptr; - assert(size >= NVH_SIZE(nvh)); + PJDLOG_ASSERT(size >= NVH_SIZE(nvh)); swap = ((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_NETWORK); dsize = NVH_DSIZE(nvh); data = NVH_DATA(nvh); @@ -734,7 +743,7 @@ nv_dump(struct nv *nv) printf("(string): %s", (char *)data); break; default: - assert(!"invalid condition"); + PJDLOG_ABORT("invalid condition"); } printf("\n"); ptr += NVH_SIZE(nvh); @@ -776,7 +785,7 @@ nv_add(struct nv *nv, const unsigned cha /* Add header first. */ if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) < 0) { - assert(errno != 0); + PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; free(nvh); @@ -785,7 +794,7 @@ nv_add(struct nv *nv, const unsigned cha free(nvh); /* Add the actual data. */ if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { - assert(errno != 0); + PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; return; @@ -794,9 +803,9 @@ nv_add(struct nv *nv, const unsigned cha vsize = roundup2(vsize, 8) - vsize; if (vsize == 0) return; - assert(vsize > 0 && vsize <= sizeof(align)); + PJDLOG_ASSERT(vsize > 0 && vsize <= sizeof(align)); if (ebuf_add_tail(nv->nv_ebuf, align, vsize) < 0) { - assert(errno != 0); + PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; return; @@ -811,7 +820,7 @@ nv_addv(struct nv *nv, const unsigned ch size_t namesize; namesize = vsnprintf(name, sizeof(name), namefmt, nameap); - assert(namesize > 0 && namesize < sizeof(name)); + PJDLOG_ASSERT(namesize > 0 && namesize < sizeof(name)); nv_add(nv, value, vsize, type, name); } @@ -832,14 +841,14 @@ nv_find(struct nv *nv, int type, const c NV_CHECK(nv); namesize = vsnprintf(name, sizeof(name), namefmt, nameap); - assert(namesize > 0 && namesize < sizeof(name)); + PJDLOG_ASSERT(namesize > 0 && namesize < sizeof(name)); namesize++; ptr = ebuf_data(nv->nv_ebuf, &size); while (size > 0) { - assert(size >= sizeof(*nvh) + 2); + PJDLOG_ASSERT(size >= sizeof(*nvh) + 2); nvh = (struct nvhdr *)ptr; - assert(size >= NVH_SIZE(nvh)); + PJDLOG_ASSERT(size >= NVH_SIZE(nvh)); nv_swap(nvh, true); if (strcmp(nvh->nvh_name, name) == 0) { if (type != NV_TYPE_NONE && @@ -927,7 +936,7 @@ nv_swap(struct nvhdr *nvh, bool tohost) le64toh(*(uint64_t *)(void *)p); break; default: - assert(!"invalid condition"); + PJDLOG_ABORT("invalid condition"); } } else { switch (vsize) { @@ -944,7 +953,7 @@ nv_swap(struct nvhdr *nvh, bool tohost) htole64(*(uint64_t *)(void *)p); break; default: - assert(!"invalid condition"); + PJDLOG_ABORT("invalid condition"); } } } @@ -952,6 +961,6 @@ nv_swap(struct nvhdr *nvh, bool tohost) case NV_TYPE_STRING: break; default: - assert(!"unrecognized type"); + PJDLOG_ABORT("unrecognized type"); } } Modified: head/sbin/hastd/rangelock.c ============================================================================== --- head/sbin/hastd/rangelock.c Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/rangelock.c Tue Sep 27 08:50:37 2011 (r225787) @@ -32,13 +32,19 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include +#include + #include "rangelock.h" +#ifndef PJDLOG_ASSERT +#include +#define PJDLOG_ASSERT(...) assert(__VA_ARGS__) +#endif + #define RANGELOCKS_MAGIC 0x94310c struct rangelocks { int rls_magic; /* Magic value. */ @@ -56,7 +62,7 @@ rangelock_init(struct rangelocks **rlsp) { struct rangelocks *rls; - assert(rlsp != NULL); + PJDLOG_ASSERT(rlsp != NULL); rls = malloc(sizeof(*rls)); if (rls == NULL) @@ -75,7 +81,7 @@ rangelock_free(struct rangelocks *rls) { struct rlock *rl; - assert(rls->rls_magic == RANGELOCKS_MAGIC); + PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); rls->rls_magic = 0; @@ -91,7 +97,7 @@ rangelock_add(struct rangelocks *rls, of { struct rlock *rl; - assert(rls->rls_magic == RANGELOCKS_MAGIC); + PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); rl = malloc(sizeof(*rl)); if (rl == NULL) @@ -107,13 +113,13 @@ rangelock_del(struct rangelocks *rls, of { struct rlock *rl; - assert(rls->rls_magic == RANGELOCKS_MAGIC); + PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); TAILQ_FOREACH(rl, &rls->rls_locks, rl_next) { if (rl->rl_start == offset && rl->rl_end == offset + length) break; } - assert(rl != NULL); + PJDLOG_ASSERT(rl != NULL); TAILQ_REMOVE(&rls->rls_locks, rl, rl_next); free(rl); } @@ -123,7 +129,7 @@ rangelock_islocked(struct rangelocks *rl { struct rlock *rl; - assert(rls->rls_magic == RANGELOCKS_MAGIC); + PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); TAILQ_FOREACH(rl, &rls->rls_locks, rl_next) { if (rl->rl_start >= offset && rl->rl_start < offset + length) Modified: head/sbin/hastd/synch.h ============================================================================== --- head/sbin/hastd/synch.h Tue Sep 27 08:26:09 2011 (r225786) +++ head/sbin/hastd/synch.h Tue Sep 27 08:50:37 2011 (r225787) @@ -32,20 +32,26 @@ #ifndef _SYNCH_H_ #define _SYNCH_H_ -#include #include #include #include #include #include +#include + +#ifndef PJDLOG_ASSERT *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 09:30:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10C69106566B; Tue, 27 Sep 2011 09:30:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012018FC16; Tue, 27 Sep 2011 09:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R9UKKG014796; Tue, 27 Sep 2011 09:30:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R9UK8C014794; Tue, 27 Sep 2011 09:30:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109270930.p8R9UK8C014794@svn.freebsd.org> From: Alexander Motin Date: Tue, 27 Sep 2011 09:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225788 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 09:30:21 -0000 Author: mav Date: Tue Sep 27 09:30:20 2011 New Revision: 225788 URL: http://svn.freebsd.org/changeset/base/225788 Log: Fix interrupt counters dumping on SW_WATCHDOG fire. Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Sep 27 08:50:37 2011 (r225787) +++ head/sys/kern/kern_clock.c Tue Sep 27 09:30:20 2011 (r225788) @@ -842,7 +842,7 @@ watchdog_fire(void) curintr = intrcnt; curname = intrnames; inttotal = 0; - nintr = sintrcnt; + nintr = sintrcnt / sizeof(u_long); printf("interrupt total\n"); while (--nintr >= 0) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 09:32:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D24D1065673; Tue, 27 Sep 2011 09:32:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8408FC24; Tue, 27 Sep 2011 09:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R9WYm6014902; Tue, 27 Sep 2011 09:32:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R9WYbe014900; Tue, 27 Sep 2011 09:32:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109270932.p8R9WYbe014900@svn.freebsd.org> From: Alexander Motin Date: Tue, 27 Sep 2011 09:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225789 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 09:32:35 -0000 Author: mav Date: Tue Sep 27 09:32:34 2011 New Revision: 225789 URL: http://svn.freebsd.org/changeset/base/225789 Log: Add one more ID for the Marvell 88SE9128 6Gbps SATA controller. MFC after: 3 days Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Sep 27 09:30:20 2011 (r225788) +++ head/sys/dev/ahci/ahci.c Tue Sep 27 09:32:34 2011 (r225789) @@ -197,6 +197,7 @@ static struct { {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 12:14:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309151065672; Tue, 27 Sep 2011 12:14:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20F598FC15; Tue, 27 Sep 2011 12:14:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RCEim5022295; Tue, 27 Sep 2011 12:14:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RCEh48022292; Tue, 27 Sep 2011 12:14:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109271214.p8RCEh48022292@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Sep 2011 12:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225790 - in head: etc/mtree include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 12:14:44 -0000 Author: kib Date: Tue Sep 27 12:14:43 2011 New Revision: 225790 URL: http://svn.freebsd.org/changeset/base/225790 Log: Install ciss(4) ioctl header (together with other .h files from sys/dev/ciss). PR: kern/109813 Discussued with: Alex Samorukov (smartmontools maintainer) MFC after: 1 week Modified: head/etc/mtree/BSD.include.dist head/include/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Sep 27 09:32:34 2011 (r225789) +++ head/etc/mtree/BSD.include.dist Tue Sep 27 12:14:43 2011 (r225790) @@ -96,6 +96,8 @@ .. bktr .. + ciss + .. firewire .. hwpmc Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Sep 27 09:32:34 2011 (r225789) +++ head/include/Makefile Tue Sep 27 12:14:43 2011 (r225790) @@ -39,7 +39,7 @@ LDIRS= bsm cam geom net net80211 netatal sys vm LSUBDIRS= cam/ata cam/scsi \ - dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ + dev/acpica dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 13:17:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DC4106566C; Tue, 27 Sep 2011 13:17:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E321C8FC0C; Tue, 27 Sep 2011 13:17:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RDH24c024251; Tue, 27 Sep 2011 13:17:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RDH2lY024248; Tue, 27 Sep 2011 13:17:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109271317.p8RDH2lY024248@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Sep 2011 13:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225791 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:17:03 -0000 Author: kib Date: Tue Sep 27 13:17:02 2011 New Revision: 225791 URL: http://svn.freebsd.org/changeset/base/225791 Log: Do not deliver SIGTRAP on exec as the normal signal, use ptracestop() on syscall exit path. Otherwise, if SIGTRAP is ignored, that tdsendsignal() do not want to deliver the signal, and debugger never get a notification of exec. Found and tested by: Anton Yuzhaninov Discussed with: jhb MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/subr_syscall.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Sep 27 12:14:43 2011 (r225790) +++ head/sys/kern/kern_exec.c Tue Sep 27 13:17:02 2011 (r225791) @@ -777,16 +777,6 @@ interpret: KNOTE_LOCKED(&p->p_klist, NOTE_EXEC); p->p_flag &= ~P_INEXEC; - /* - * If tracing the process, trap to the debugger so that - * breakpoints can be set before the program executes. We - * have to use tdsignal() to deliver the signal to the current - * thread since any other threads in this process will exit if - * execve() succeeds. - */ - if (p->p_flag & P_TRACED) - tdsignal(td, SIGTRAP); - /* clear "fork but no exec" flag, as we _are_ execing */ p->p_acflag &= ~AFORK; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Tue Sep 27 12:14:43 2011 (r225790) +++ head/sys/kern/subr_syscall.c Tue Sep 27 13:17:02 2011 (r225791) @@ -204,9 +204,17 @@ syscallret(struct thread *td, int error, * is not the case, this code will need to be revisited. */ STOPEVENT(p, S_SCX, sa->code); - PTRACESTOP_SC(p, td, S_PT_SCX); if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { PROC_LOCK(p); + /* + * If tracing the execed process, trap to the debugger + * so that breakpoints can be set before the program + * executes. If debugger requested tracing of syscall + * returns, do it now too. + */ + if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 || + (p->p_stops & S_PT_SCX) != 0)) + ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 13:27:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 938EB106564A; Tue, 27 Sep 2011 13:27:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7A48FC18; Tue, 27 Sep 2011 13:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RDRHSb024692; Tue, 27 Sep 2011 13:27:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RDRHs8024689; Tue, 27 Sep 2011 13:27:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109271327.p8RDRHs8024689@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 27 Sep 2011 13:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:27:17 -0000 Author: bz Date: Tue Sep 27 13:27:17 2011 New Revision: 225793 URL: http://svn.freebsd.org/changeset/base/225793 Log: Unbreak no-ip and no-inet6 module builds with ipfw. For now continue to build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the assumption that the private L2 hook (which hopefully eventually will be a pfil hook as well) can still be useful. Allow building the module without inet as well. Glanced at by: jhb MFC after: 3 days Modified: head/sys/modules/ipfw/Makefile head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Tue Sep 27 13:20:41 2011 (r225792) +++ head/sys/modules/ipfw/Makefile Tue Sep 27 13:27:17 2011 (r225793) @@ -8,7 +8,7 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c SRCS+= ip_fw_dynamic.c ip_fw_log.c SRCS+= ip_fw_sockopt.c ip_fw_table.c -SRCS+= opt_inet6.h opt_ipfw.h opt_ipsec.h +SRCS+= opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h CFLAGS+= -DIPFIREWALL CFLAGS+= -I${.CURDIR}/../../contrib/pf @@ -22,6 +22,10 @@ CFLAGS+= -I${.CURDIR}/../../contrib/pf # .if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif .if ${MK_INET6_SUPPORT} != "no" opt_inet6.h: echo "#define INET6 1" > ${.TARGET} Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Tue Sep 27 13:20:41 2011 (r225792) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Tue Sep 27 13:27:17 2011 (r225793) @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$"); #if !defined(KLD_MODULE) #include "opt_ipdn.h" #include "opt_inet.h" +#include "opt_inet6.h" #ifndef INET #error IPFIREWALL requires INET. #endif /* INET */ #endif /* KLD_MODULE */ -#include "opt_inet6.h" #include #include @@ -154,7 +154,7 @@ again: /* next_hop may be set by ipfw_chk */ if (args.next_hop == NULL && args.next_hop6 == NULL) break; /* pass */ -#ifndef IPFIREWALL_FORWARD +#if !defined(IPFIREWALL_FORWARD) || (!defined(INET6) && !defined(INET)) ret = EACCES; #else { @@ -205,7 +205,7 @@ again: #endif m_tag_prepend(*m0, fwd_tag); } -#endif +#endif /* IPFIREWALL_FORWARD */ break; case IP_FW_DENY: From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 13:34:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 217331065672; Tue, 27 Sep 2011 13:34:00 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3994C8FC1C; Tue, 27 Sep 2011 13:33:58 +0000 (UTC) Received: by eyg7 with SMTP id 7so6389764eyg.13 for ; Tue, 27 Sep 2011 06:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fvc0hVbC143Qi4Tkgio8oFUrEH4+Mnp8HS3Fu4UbWYc=; b=B6pgpgrM1hGdXfyRAGOmS29Jzo8+UtrqS7rkl7ladkRCe/mQP0xDL7VLO58l6c1kQv V49Z7jPO1nT/BlSXtmlWZy3sC+xpq+/e7dABuwzJdQCxXLrjoT1QUYb18U550GIzlyaH mR63msv3uA9TYz9xErwK+yKpTCv2yv7fKuQH8= MIME-Version: 1.0 Received: by 10.216.80.24 with SMTP id j24mr9104674wee.12.1317130437931; Tue, 27 Sep 2011 06:33:57 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.216.179.78 with HTTP; Tue, 27 Sep 2011 06:33:57 -0700 (PDT) In-Reply-To: <201109270930.p8R9UK8C014794@svn.freebsd.org> References: <201109270930.p8R9UK8C014794@svn.freebsd.org> Date: Tue, 27 Sep 2011 15:33:57 +0200 X-Google-Sender-Auth: zdh6iZB084n7yRAaxGx3_jhwG_4 Message-ID: From: Attilio Rao To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225788 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:34:00 -0000 2011/9/27 Alexander Motin : > Author: mav > Date: Tue Sep 27 09:30:20 2011 > New Revision: 225788 > URL: http://svn.freebsd.org/changeset/base/225788 > > Log: > =C2=A0Fix interrupt counters dumping on SW_WATCHDOG fire. Thanks, avg@ just submitted this patch to me too and I was going to commit it. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 13:42:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B69106564A; Tue, 27 Sep 2011 13:42:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12FA08FC19; Tue, 27 Sep 2011 13:42:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RDgBdw025995; Tue, 27 Sep 2011 13:42:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RDgBIx025993; Tue, 27 Sep 2011 13:42:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109271342.p8RDgBIx025993@svn.freebsd.org> From: Attilio Rao Date: Tue, 27 Sep 2011 13:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225794 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:42:12 -0000 Author: attilio Date: Tue Sep 27 13:42:11 2011 New Revision: 225794 URL: http://svn.freebsd.org/changeset/base/225794 Log: Revert r225372: wdog_kern_pat() acquires eventhandler mutex, thus it cannot work in kernel context (from where kdb_trap() runs). The right way to fix this is both offering the cpu-stop-on-panic-and-skip-locking logic and also a context for KDB to officially run. We can re-enable this (or a similar) improvement when these 2 patches hit the tree. Sponsored by: Sandvine Incorporated Discussed with: emaste, rstone MFC after: immediately Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Tue Sep 27 13:27:17 2011 (r225793) +++ head/sys/kern/subr_kdb.c Tue Sep 27 13:42:11 2011 (r225794) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_stack.h" -#include "opt_watchdog.h" #include #include @@ -42,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG -#include -#endif #include #include @@ -591,9 +587,6 @@ kdb_trap(int type, int code, struct trap cpuset_t other_cpus; #endif struct kdb_dbbe *be; -#ifdef SW_WATCHDOG - u_int wdoglvt; -#endif register_t intr; int handled; @@ -607,10 +600,6 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); -#ifdef SW_WATCHDOG - wdoglvt = wdog_kern_last_timeout(); - wdog_kern_pat(WD_TO_NEVER); -#endif #ifdef SMP other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); @@ -642,9 +631,6 @@ kdb_trap(int type, int code, struct trap #ifdef SMP restart_cpus(stopped_cpus); #endif -#ifdef SW_WATCHDOG - wdog_kern_pat(wdoglvt); -#endif intr_restore(intr); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 13:44:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0D78106564A; Tue, 27 Sep 2011 13:44:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3AA1F8FC0C; Tue, 27 Sep 2011 13:44:05 +0000 (UTC) Received: by wyj26 with SMTP id 26so5550221wyj.13 for ; Tue, 27 Sep 2011 06:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=v0PRbDPGE+RtcSCMJWtGgimLMMb8Cr0goiu7RjYPK4s=; b=roUb8UBurz3kMykQNhc2r4JamdwPjJYi0AFq+9Hr2NGRILsWDZyLuJ8GuJjCCf8+6C XpyccCulgyk7/BNKJgWCIG/viEswwIStI5tN9VCRxdGdg/Vs0nv4PnVd7IaUQWz+EzUF itOY91urYYTdHdWyirh+RuDPeNL9FqvFKK9bs= MIME-Version: 1.0 Received: by 10.227.5.193 with SMTP id 1mr7286242wbw.57.1317131045120; Tue, 27 Sep 2011 06:44:05 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.216.179.78 with HTTP; Tue, 27 Sep 2011 06:44:05 -0700 (PDT) In-Reply-To: <201109271342.p8RDgBIx025993@svn.freebsd.org> References: <201109271342.p8RDgBIx025993@svn.freebsd.org> Date: Tue, 27 Sep 2011 15:44:05 +0200 X-Google-Sender-Auth: _O-lPEeSLdeBW7k4HDy5EAox4II Message-ID: From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r225794 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:44:07 -0000 2011/9/27 Attilio Rao : > Author: attilio > Date: Tue Sep 27 13:42:11 2011 > New Revision: 225794 > URL: http://svn.freebsd.org/changeset/base/225794 > > Log: > =C2=A0Revert r225372: > =C2=A0wdog_kern_pat() acquires eventhandler mutex, thus it cannot work in > =C2=A0kernel context (from where kdb_trap() runs). > > =C2=A0The right way to fix this is both offering the > =C2=A0cpu-stop-on-panic-and-skip-locking logic and also a context for KDB > =C2=A0to officially run. We can re-enable this (or a similar) improvement > =C2=A0when these 2 patches hit the tree. > > =C2=A0Sponsored by: Sandvine Incorporated > =C2=A0Discussed with: =C2=A0 =C2=A0 =C2=A0 emaste, rstone > =C2=A0MFC after: =C2=A0 =C2=A0immediately Forgot to mention: Reported by: pho Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 14:28:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49723106567B; Tue, 27 Sep 2011 14:28:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3024F8FC21; Tue, 27 Sep 2011 14:28:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RES8i4027633; Tue, 27 Sep 2011 14:28:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RES840027631; Tue, 27 Sep 2011 14:28:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201109271428.p8RES840027631@svn.freebsd.org> From: Ed Maste Date: Tue, 27 Sep 2011 14:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225798 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 14:28:08 -0000 Author: emaste Date: Tue Sep 27 14:28:07 2011 New Revision: 225798 URL: http://svn.freebsd.org/changeset/base/225798 Log: Improve battery capacity reporting When a status pointer is passed in mfi_dcmd_command does not return an errno (if the ioctl is successful), so move the test for NO_HW_PRESENT outside of the error case. This should fix incorrect reporting for systems with a dead or no battery. Additionally, handle error codes other than NO_HW_PRESENT by omitting the battery capacity display. LSI's supercap-based parts (CV series) report their data using the same interface as battery-based parts, except that they do not include the capacity stats (state of charge, cumulative charge cycles, etc.) Reviewd by: jhb, bz Tested by: pluknet@, Garrett Cooper PR: bin/160581 MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Tue Sep 27 14:00:32 2011 (r225797) +++ head/usr.sbin/mfiutil/mfi_show.c Tue Sep 27 14:28:07 2011 (r225798) @@ -141,7 +141,7 @@ show_battery(int ac, char **av) struct mfi_bbu_design_info design; struct mfi_bbu_status stat; uint8_t status; - int comma, error, fd; + int comma, error, fd, show_capacity; if (ac != 1) { warnx("show battery: extra arguments"); @@ -157,16 +157,17 @@ show_battery(int ac, char **av) if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_CAPACITY_INFO, &cap, sizeof(cap), NULL, 0, &status) < 0) { - if (status == MFI_STAT_NO_HW_PRESENT) { - printf("mfi%d: No battery present\n", mfi_unit); - close(fd); - return (0); - } error = errno; warn("Failed to get capacity info"); close(fd); return (error); } + if (status == MFI_STAT_NO_HW_PRESENT) { + printf("mfi%d: No battery present\n", mfi_unit); + close(fd); + return (0); + } + show_capacity = (status == MFI_STAT_OK); if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_DESIGN_INFO, &design, sizeof(design), NULL, 0, NULL) < 0) { @@ -192,10 +193,14 @@ show_battery(int ac, char **av) printf(" Model: %s\n", design.device_name); printf(" Chemistry: %s\n", design.device_chemistry); printf(" Design Capacity: %d mAh\n", design.design_capacity); - printf(" Full Charge Capacity: %d mAh\n", cap.full_charge_capacity); - printf(" Current Capacity: %d mAh\n", cap.remaining_capacity); - printf(" Charge Cycles: %d\n", cap.cycle_count); - printf(" Current Charge: %d%%\n", cap.relative_charge); + if (show_capacity) { + printf(" Full Charge Capacity: %d mAh\n", + cap.full_charge_capacity); + printf(" Current Capacity: %d mAh\n", + cap.remaining_capacity); + printf(" Charge Cycles: %d\n", cap.cycle_count); + printf(" Current Charge: %d%%\n", cap.relative_charge); + } printf(" Design Voltage: %d mV\n", design.design_voltage); printf(" Current Voltage: %d mV\n", stat.voltage); printf(" Temperature: %d C\n", stat.temperature); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 15:57:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2F291065673; Tue, 27 Sep 2011 15:57:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31FB8FC16; Tue, 27 Sep 2011 15:57:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RFvDDF030467; Tue, 27 Sep 2011 15:57:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RFvDZB030465; Tue, 27 Sep 2011 15:57:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271557.p8RFvDZB030465@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 15:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225800 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 15:57:13 -0000 Author: des Date: Tue Sep 27 15:57:13 2011 New Revision: 225800 URL: http://svn.freebsd.org/changeset/base/225800 Log: Followup to r225599: the fseek() was a no-op since the file was opened in append mode. Open it in read-write mode instead. Also move the fseek up one level to cover the (unlikely but not impossible) case where the server accepts ranges but does not send a Content-Size header. PR: bin/117277 MFC after: 3 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Tue Sep 27 15:08:59 2011 (r225799) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 15:57:13 2011 (r225800) @@ -540,7 +540,7 @@ fetch(char *URL, const char *path) goto failure; } /* we got it, open local file */ - if ((of = fopen(path, "a")) == NULL) { + if ((of = fopen(path, "r+")) == NULL) { warn("%s: fopen()", path); goto failure; } @@ -559,13 +559,13 @@ fetch(char *URL, const char *path) sb = nsb; /* picked up again later */ } - /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); - fclose(of); - of = NULL; - /* picked up again later */ - } + } + /* seek to where we left off */ + if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseek()", path); + fclose(of); + of = NULL; + /* picked up again later */ } } else if (m_flag && sb.st_size != -1) { /* mirror mode, local file exists */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 16:33:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A4C4106566B; Tue, 27 Sep 2011 16:33:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8458FC08; Tue, 27 Sep 2011 16:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RGXIXK031610; Tue, 27 Sep 2011 16:33:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RGXIFr031608; Tue, 27 Sep 2011 16:33:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201109271633.p8RGXIFr031608@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 27 Sep 2011 16:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225801 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 16:33:18 -0000 Author: jkim Date: Tue Sep 27 16:33:17 2011 New Revision: 225801 URL: http://svn.freebsd.org/changeset/base/225801 Log: Avoid accidental conflicts with C++ operator keywords. MFC after: 1 week Modified: head/include/iso646.h Modified: head/include/iso646.h ============================================================================== --- head/include/iso646.h Tue Sep 27 15:57:13 2011 (r225800) +++ head/include/iso646.h Tue Sep 27 16:33:17 2011 (r225801) @@ -29,6 +29,8 @@ #ifndef _ISO646_H_ #define _ISO646_H_ +#ifndef __cplusplus + #define and && #define and_eq &= #define bitand & @@ -41,4 +43,6 @@ #define xor ^ #define xor_eq ^= +#endif /* !__cplusplus */ + #endif /* !_ISO646_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 16:52:20 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD6C106564A; Tue, 27 Sep 2011 16:52:20 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id C5DA98FC14; Tue, 27 Sep 2011 16:52:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id p8RGa7Gp001523; Tue, 27 Sep 2011 20:36:07 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p8RGa6Pr001522; Tue, 27 Sep 2011 20:36:06 +0400 (MSK) (envelope-from ache) Date: Tue, 27 Sep 2011 20:36:06 +0400 From: Andrey Chernov To: Dag-Erling Smorgrav Message-ID: <20110927163606.GA1427@vniz.net> Mail-Followup-To: Andrey Chernov , Dag-Erling Smorgrav , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201109271557.p8RFvDZB030465@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109271557.p8RFvDZB030465@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r225800 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 16:52:20 -0000 On Tue, Sep 27, 2011 at 03:57:13PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Tue Sep 27 15:57:13 2011 > New Revision: 225800 > URL: http://svn.freebsd.org/changeset/base/225800 > > Log: > Followup to r225599: the fseek() was a no-op since the file was opened > in append mode. Open it in read-write mode instead. Also move the fseek() is obsoleted. Consider using fseeko() instead. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 17:08:28 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E887E1065673; Tue, 27 Sep 2011 17:08:28 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A656E8FC14; Tue, 27 Sep 2011 17:08:28 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A7C911FFC35; Tue, 27 Sep 2011 17:08:27 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 8A56F84576; Tue, 27 Sep 2011 19:08:27 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrey Chernov References: <201109271557.p8RFvDZB030465@svn.freebsd.org> <20110927163606.GA1427@vniz.net> Date: Tue, 27 Sep 2011 19:08:27 +0200 In-Reply-To: <20110927163606.GA1427@vniz.net> (Andrey Chernov's message of "Tue, 27 Sep 2011 20:36:06 +0400") Message-ID: <86ipodc3qs.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r225800 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:08:29 -0000 Andrey Chernov writes: > fseek() is obsoleted. Consider using fseeko() instead. Ooh, right, that means fetch(1) can't resume large files if the transfer was interrupted past the 2 GB mark... thanks for the reminder. It's old code... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 17:11:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1809106566C; Tue, 27 Sep 2011 17:11:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15548FC1B; Tue, 27 Sep 2011 17:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RHBVqx032977; Tue, 27 Sep 2011 17:11:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RHBVII032975; Tue, 27 Sep 2011 17:11:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271711.p8RHBVII032975@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 17:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225805 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:11:31 -0000 Author: des Date: Tue Sep 27 17:11:31 2011 New Revision: 225805 URL: http://svn.freebsd.org/changeset/base/225805 Log: Use fseeko() instead of fseek(). The rest of the code is off_t-aware, but the use of fseek() means fetch(1) can't correctly resume a transfer that was interrupted past the 2 GB mark. Pointed out by: ache@ MFC after: 3 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Tue Sep 27 17:11:09 2011 (r225804) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 17:11:31 2011 (r225805) @@ -561,8 +561,8 @@ fetch(char *URL, const char *path) } } /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); + if (of != NULL && fseeko(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseeko()", path); fclose(of); of = NULL; /* picked up again later */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 17:34:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B383106566C; Tue, 27 Sep 2011 17:34:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9588FC14; Tue, 27 Sep 2011 17:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RHY2po033733; Tue, 27 Sep 2011 17:34:02 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RHY2TP033731; Tue, 27 Sep 2011 17:34:02 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201109271734.p8RHY2TP033731@svn.freebsd.org> From: Kirk McKusick Date: Tue, 27 Sep 2011 17:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225806 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:34:02 -0000 Author: mckusick Date: Tue Sep 27 17:34:02 2011 New Revision: 225806 URL: http://svn.freebsd.org/changeset/base/225806 Log: This update eliminates the system hang reported in kern/160662 when taking a snapshot on a filesystem running with journaled soft updates. Reported by: Hans Ottevanger Fix verified by: Hans Ottevanger PR: kern/160662 Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Tue Sep 27 17:11:31 2011 (r225805) +++ head/sys/ufs/ffs/ffs_snapshot.c Tue Sep 27 17:34:02 2011 (r225806) @@ -203,7 +203,7 @@ ffs_snapshot(mp, snapfile) ufs2_daddr_t numblks, blkno, *blkp, *snapblklist; int error, cg, snaploc; int i, size, len, loc; - int flag; + uint64_t flag; struct timespec starttime = {0, 0}, endtime; char saved_nice = 0; long redo = 0, snaplistsize = 0; From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 17:41:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E459D1065686; Tue, 27 Sep 2011 17:41:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9BF78FC14; Tue, 27 Sep 2011 17:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RHfmiB034022; Tue, 27 Sep 2011 17:41:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RHfmwh034020; Tue, 27 Sep 2011 17:41:48 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201109271741.p8RHfmwh034020@svn.freebsd.org> From: Kirk McKusick Date: Tue, 27 Sep 2011 17:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225807 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:41:49 -0000 Author: mckusick Date: Tue Sep 27 17:41:48 2011 New Revision: 225807 URL: http://svn.freebsd.org/changeset/base/225807 Log: This update eliminates a lock-order reversal warning discovered whle tracking down the system hang reported in kern/160662 and corrected in revision 225806. The LOR is not the cause of the system hang and indeed cannot cause an actual deadlock. However, it can be easily eliminated by defering the acquisition of a buflock until after all the vnode locks have been acquired. Reported by: Hans Ottevanger PR: kern/160662 Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Tue Sep 27 17:34:02 2011 (r225806) +++ head/sys/ufs/ffs/ffs_snapshot.c Tue Sep 27 17:41:48 2011 (r225807) @@ -212,7 +212,7 @@ ffs_snapshot(mp, snapfile) struct fs *copy_fs = NULL, *fs; struct thread *td = curthread; struct inode *ip, *xp; - struct buf *bp, *nbp, *ibp, *sbp = NULL; + struct buf *bp, *nbp, *ibp; struct nameidata nd; struct mount *wrtmp; struct vattr vat; @@ -460,21 +460,14 @@ restart: * Grab a copy of the superblock and its summary information. * We delay writing it until the suspension is released below. */ - error = bread(vp, lblkno(fs, fs->fs_sblockloc), fs->fs_bsize, - KERNCRED, &sbp); - if (error) { - brelse(sbp); - sbp = NULL; - goto out1; - } - loc = blkoff(fs, fs->fs_sblockloc); - copy_fs = (struct fs *)(sbp->b_data + loc); + copy_fs = malloc((u_long)fs->fs_bsize, M_UFSMNT, M_WAITOK); bcopy(fs, copy_fs, fs->fs_sbsize); if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) copy_fs->fs_clean = 1; size = fs->fs_bsize < SBLOCKSIZE ? fs->fs_bsize : SBLOCKSIZE; if (fs->fs_sbsize < size) - bzero(&sbp->b_data[loc + fs->fs_sbsize], size - fs->fs_sbsize); + bzero(&((char *)copy_fs)[fs->fs_sbsize], + size - fs->fs_sbsize); size = blkroundup(fs, fs->fs_cssize); if (fs->fs_contigsumsize > 0) size += fs->fs_ncg * sizeof(int32_t); @@ -490,8 +483,8 @@ restart: len, KERNCRED, &bp)) != 0) { brelse(bp); free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; goto out1; } bcopy(bp->b_data, space, (u_int)len); @@ -606,8 +599,8 @@ loop: vdrop(xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; MNT_VNODE_FOREACH_ABORT(mp, mvp); goto out1; } @@ -621,8 +614,8 @@ loop: error = softdep_journal_lookup(mp, &xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; goto out1; } xp = VTOI(xvp); @@ -688,8 +681,8 @@ loop: VI_UNLOCK(devvp); ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp"); out1: - KASSERT((sn != NULL && sbp != NULL && error == 0) || - (sn == NULL && sbp == NULL && error != 0), + KASSERT((sn != NULL && copy_fs != NULL && error == 0) || + (sn == NULL && copy_fs == NULL && error != 0), ("email phk@ and mckusick@")); /* * Resume operation on filesystem. @@ -703,7 +696,7 @@ out1: vp->v_mount->mnt_stat.f_mntonname, (long)endtime.tv_sec, endtime.tv_nsec / 1000000, redo, fs->fs_ncg); } - if (sbp == NULL) + if (copy_fs == NULL) goto out; /* * Copy allocation information from all the snapshots in @@ -793,6 +786,15 @@ out1: space = (char *)space + fs->fs_bsize; bawrite(nbp); } + error = bread(vp, lblkno(fs, fs->fs_sblockloc), fs->fs_bsize, + KERNCRED, &nbp); + if (error) { + brelse(nbp); + } else { + loc = blkoff(fs, fs->fs_sblockloc); + bcopy((char *)copy_fs, &nbp->b_data[loc], fs->fs_bsize); + bawrite(nbp); + } /* * As this is the newest list, it is the most inclusive, so * should replace the previous list. @@ -822,7 +824,8 @@ out1: vrele(vp); /* Drop extra reference */ done: free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); + free(copy_fs, M_UFSMNT); + copy_fs = NULL; out: NDFREE(&nd, NDF_ONLY_PNBUF); if (saved_nice > 0) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 17:54:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1B60106567E; Tue, 27 Sep 2011 17:54:10 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0F9F8FC12; Tue, 27 Sep 2011 17:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RHsA2b034447; Tue, 27 Sep 2011 17:54:10 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RHsA5l034445; Tue, 27 Sep 2011 17:54:10 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201109271754.p8RHsA5l034445@svn.freebsd.org> From: Jens Schweikhardt Date: Tue, 27 Sep 2011 17:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225808 - head/lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:54:10 -0000 Author: schweikh Date: Tue Sep 27 17:54:10 2011 New Revision: 225808 URL: http://svn.freebsd.org/changeset/base/225808 Log: Fix grammar. PR: 140457 Submitted by: jeremyhu AT apple.com MFC after: 2 weeks Modified: head/lib/libc/locale/isspace.3 Modified: head/lib/libc/locale/isspace.3 ============================================================================== --- head/lib/libc/locale/isspace.3 Tue Sep 27 17:41:48 2011 (r225807) +++ head/lib/libc/locale/isspace.3 Tue Sep 27 17:54:10 2011 (r225808) @@ -47,16 +47,16 @@ .Sh DESCRIPTION The .Fn isspace -function tests for the white-space characters. +function tests for white-space characters. For any locale, this includes the following standard characters: .Pp .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, .Fn isspace -successful test is limited to this characters only. +returns non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 18:14:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 056A1106564A; Tue, 27 Sep 2011 18:14:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEFCF8FC08; Tue, 27 Sep 2011 18:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RIE48Y035244; Tue, 27 Sep 2011 18:14:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RIE4qF035241; Tue, 27 Sep 2011 18:14:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201109271814.p8RIE4qF035241@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 27 Sep 2011 18:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225809 - head/usr.bin/script X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:14:05 -0000 Author: trociny Date: Tue Sep 27 18:14:04 2011 New Revision: 225809 URL: http://svn.freebsd.org/changeset/base/225809 Log: When script(1) reads EOF from input it starts spinning on zero-byte reads eating 100% CPU. Fix this by skipping select on STDIN after reading EOF -- permanently if STDIN is not terminal and for one second if it is. Also after reading EOF from STDIN we have to pass it to the program being scripted. The previous approach was to write zero bytes into the pseudo-terminal. This does not work because zero-byte write does not have any effect on read. Fix this by sending VEOF instead. Submitted by: Ronald Klop Discussed with: kib, Chris Torek Approved by: kib MFC after: 1 week Modified: head/usr.bin/script/script.1 head/usr.bin/script/script.c Modified: head/usr.bin/script/script.1 ============================================================================== --- head/usr.bin/script/script.1 Tue Sep 27 17:54:10 2011 (r225808) +++ head/usr.bin/script/script.1 Tue Sep 27 18:14:04 2011 (r225809) @@ -166,3 +166,12 @@ The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when in a raw mode where the program being run is doing manual echo. +.Pp +If the +.Nm +reads zero bytes from the terminal it switches to a mode when it probes read +only once a second until it gets some data. +This prevents the +.Nm +spinning on zero-byte reads, but might cause a 1-second delay in +processing of the user input. Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Tue Sep 27 17:54:10 2011 (r225808) +++ head/usr.bin/script/script.c Tue Sep 27 18:14:04 2011 (r225809) @@ -86,6 +86,7 @@ main(int argc, char *argv[]) char ibuf[BUFSIZ]; fd_set rfd; int flushtime = 30; + int readstdin; aflg = kflg = 0; while ((ch = getopt(argc, argv, "aqkt:")) != -1) @@ -155,19 +156,21 @@ main(int argc, char *argv[]) doshell(argv); close(slave); - if (flushtime > 0) - tvp = &tv; - else - tvp = NULL; - - start = time(0); - FD_ZERO(&rfd); + start = tvec = time(0); + readstdin = 1; for (;;) { + FD_ZERO(&rfd); FD_SET(master, &rfd); - FD_SET(STDIN_FILENO, &rfd); - if (flushtime > 0) { - tv.tv_sec = flushtime; + if (readstdin) + FD_SET(STDIN_FILENO, &rfd); + if ((!readstdin && ttyflg) || flushtime > 0) { + tv.tv_sec = !readstdin && ttyflg ? 1 : + flushtime - (tvec - start); tv.tv_usec = 0; + tvp = &tv; + readstdin = 1; + } else { + tvp = NULL; } n = select(master + 1, &rfd, 0, 0, tvp); if (n < 0 && errno != EINTR) @@ -176,8 +179,13 @@ main(int argc, char *argv[]) cc = read(STDIN_FILENO, ibuf, BUFSIZ); if (cc < 0) break; - if (cc == 0) - (void)write(master, ibuf, 0); + if (cc == 0) { + if (tcgetattr(master, &stt) == 0 && + (stt.c_lflag & ICANON) != 0) { + (void)write(master, &stt.c_cc[VEOF], 1); + } + readstdin = 0; + } if (cc > 0) { (void)write(master, ibuf, cc); if (kflg && tcgetattr(master, &stt) >= 0 && From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 18:23:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E9D1065673; Tue, 27 Sep 2011 18:23:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45318FC0C; Tue, 27 Sep 2011 18:23:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RINwuV035627; Tue, 27 Sep 2011 18:23:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RINwQ3035625; Tue, 27 Sep 2011 18:23:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271823.p8RINwQ3035625@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 18:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225810 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:23:59 -0000 Author: des Date: Tue Sep 27 18:23:58 2011 New Revision: 225810 URL: http://svn.freebsd.org/changeset/base/225810 Log: Long overdue: make passive mode the default for ftp. Modified: head/lib/libfetch/ftp.c Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Tue Sep 27 18:14:04 2011 (r225809) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:23:58 2011 (r225810) @@ -638,8 +638,8 @@ ftp_transfer(conn_t *conn, const char *o /* passive mode */ if (!pasv) - pasv = ((s = getenv("FTP_PASSIVE_MODE")) != NULL && - strncasecmp(s, "no", 2) != 0); + pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL || + strncasecmp(s, "no", 2) == 0); /* isolate filename */ filename = ftp_filename(file, &filenamelen, &type); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 18:42:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9413B106566B; Tue, 27 Sep 2011 18:42:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 691888FC1C; Tue, 27 Sep 2011 18:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RIg9vP036245; Tue, 27 Sep 2011 18:42:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RIg9uL036242; Tue, 27 Sep 2011 18:42:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271842.p8RIg9uL036242@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 18:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225812 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:42:09 -0000 Author: des Date: Tue Sep 27 18:42:09 2011 New Revision: 225812 URL: http://svn.freebsd.org/changeset/base/225812 Log: Think first, commit second. 1. Allow the caller to select active mode. 2. Fix the envar logic so it *always* overrides the caller's flags. 3. Document the change from active to passive. Modified: head/lib/libfetch/fetch.3 head/lib/libfetch/ftp.c Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Tue Sep 27 18:40:13 2011 (r225811) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:42:09 2011 (r225812) @@ -318,9 +318,19 @@ and implement the FTP protocol as described in RFC959. .Pp If the +.Ql P +(not passive) flag is specified, an active (rather than passive) +connection will be attempted. +.Pp +The .Ql p -(passive) flag is specified, a passive (rather than active) connection -will be attempted. +flag is supported for compatibility with earlier versions where active +connections were the default. +It has precedence over the +.Ql P +flag, so if both are specified, +.Nm +will use a passive connection. .Pp If the .Ql l @@ -475,9 +485,11 @@ connections will be bound. .It Ev FTP_LOGIN Default FTP login if none was provided in the URL. .It Ev FTP_PASSIVE_MODE -If set to anything but +If set to .Ql no , -forces the FTP code to use passive mode. +forces the FTP code to use active mode. +If set to any other value, forces passive mode even if the application +requested active mode. .It Ev FTP_PASSWORD Default FTP password if the remote server requests one and none was provided in the URL. Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Tue Sep 27 18:40:13 2011 (r225811) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:42:09 2011 (r225812) @@ -633,13 +633,12 @@ ftp_transfer(conn_t *conn, const char *o /* check flags */ low = CHECK_FLAG('l'); - pasv = CHECK_FLAG('p'); + pasv = CHECK_FLAG('p') || !CHECK_FLAG('P'); verbose = CHECK_FLAG('v'); /* passive mode */ - if (!pasv) - pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL || - strncasecmp(s, "no", 2) == 0); + if ((s = getenv("FTP_PASSIVE_MODE")) != NULL) + pasv = (strncasecmp(s, "no", 2) != 0); /* isolate filename */ filename = ftp_filename(file, &filenamelen, &type); From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 18:53:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EEA81065679; Tue, 27 Sep 2011 18:53:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA1F58FC1A; Tue, 27 Sep 2011 18:53:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RIrZYh036625; Tue, 27 Sep 2011 18:53:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RIrZm3036623; Tue, 27 Sep 2011 18:53:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271853.p8RIrZm3036623@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 18:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225813 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:53:36 -0000 Author: des Date: Tue Sep 27 18:53:35 2011 New Revision: 225813 URL: http://svn.freebsd.org/changeset/base/225813 Log: Bump date. Modified: head/lib/libfetch/fetch.3 Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Tue Sep 27 18:42:09 2011 (r225812) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:53:35 2011 (r225813) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd September 27, 2011 .Dt FETCH 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 18:57:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B301065672; Tue, 27 Sep 2011 18:57:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D82F78FC13; Tue, 27 Sep 2011 18:57:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RIvQ9w036812; Tue, 27 Sep 2011 18:57:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RIvQDV036803; Tue, 27 Sep 2011 18:57:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271857.p8RIvQDV036803@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 18:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225814 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:57:27 -0000 Author: des Date: Tue Sep 27 18:57:26 2011 New Revision: 225814 URL: http://svn.freebsd.org/changeset/base/225814 Log: Update copyright dates and strip my middle name. Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/fetch.3 head/lib/libfetch/fetch.c head/lib/libfetch/fetch.h head/lib/libfetch/file.c head/lib/libfetch/ftp.c head/lib/libfetch/http.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/common.c Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/common.h ============================================================================== --- head/lib/libfetch/common.h Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/common.h Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.c ============================================================================== --- head/lib/libfetch/fetch.c Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/fetch.c Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.h ============================================================================== --- head/lib/libfetch/fetch.h Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/fetch.h Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/file.c ============================================================================== --- head/lib/libfetch/file.c Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/file.c Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue Sep 27 18:53:35 2011 (r225813) +++ head/lib/libfetch/http.c Tue Sep 27 18:57:26 2011 (r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 19:02:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20688106564A; Tue, 27 Sep 2011 19:02:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9B28FC16; Tue, 27 Sep 2011 19:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RJ2iBV037037; Tue, 27 Sep 2011 19:02:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RJ2isK037034; Tue, 27 Sep 2011 19:02:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271902.p8RJ2isK037034@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 19:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225815 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 19:02:45 -0000 Author: des Date: Tue Sep 27 19:02:44 2011 New Revision: 225815 URL: http://svn.freebsd.org/changeset/base/225815 Log: Document the fact that passive mode is now the default. Update copyright dates and strip my middle name. Modified: head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Tue Sep 27 18:57:26 2011 (r225814) +++ head/usr.bin/fetch/fetch.1 Tue Sep 27 19:02:44 2011 (r225815) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2008 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -165,11 +165,13 @@ directory, with name(s) selected as in t .It Fl P .It Fl p Use passive FTP. -This is useful if you are behind a firewall which blocks incoming -connections. -Try this flag if -.Nm -seems to hang when retrieving FTP URLs. +These flags have no effect, since passive FTP is the default, but are +provided for compatibility with earlier versions where active FTP was +the default. +To force active mode, set the +.Ev FTP_PASSIVE_MODE +environment variable to +.Ql NO . .It Fl q Quiet mode. .It Fl R Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Tue Sep 27 18:57:26 2011 (r225814) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 19:02:44 2011 (r225815) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 19:54:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90E18106564A; Tue, 27 Sep 2011 19:54:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8080D8FC0C; Tue, 27 Sep 2011 19:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RJswpR038743; Tue, 27 Sep 2011 19:54:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RJsw3i038741; Tue, 27 Sep 2011 19:54:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271954.p8RJsw3i038741@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 19:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225817 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 19:54:58 -0000 Author: des Date: Tue Sep 27 19:54:58 2011 New Revision: 225817 URL: http://svn.freebsd.org/changeset/base/225817 Log: Don't force active mode FTP. Modified: head/release/Makefile.sysinstall Modified: head/release/Makefile.sysinstall ============================================================================== --- head/release/Makefile.sysinstall Tue Sep 27 19:08:27 2011 (r225816) +++ head/release/Makefile.sysinstall Tue Sep 27 19:54:58 2011 (r225817) @@ -588,7 +588,7 @@ release rerelease: echo " for i in ${MAKEINDEXPORTS}" >> ${_MK} echo " do" >> ${_MK} echo " cd /usr/ports/\$${i}" >> ${_MK} - echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK} + echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-yes} PATH=$${PATH} \\" >> ${_MK} echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK} echo " done" >> ${_MK} echo " cd /usr/ports" >> ${_MK} From owner-svn-src-head@FreeBSD.ORG Tue Sep 27 23:11:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3A106106566B; Tue, 27 Sep 2011 23:11:04 +0000 (UTC) Date: Tue, 27 Sep 2011 23:11:04 +0000 From: Alexander Best To: Dag-Erling Smorgrav Message-ID: <20110927231104.GA13143@freebsd.org> References: <201109271902.p8RJ2isK037034@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201109271902.p8RJ2isK037034@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225815 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 23:11:04 -0000 On Tue Sep 27 11, Dag-Erling Smorgrav wrote: > Author: des > Date: Tue Sep 27 19:02:44 2011 > New Revision: 225815 > URL: http://svn.freebsd.org/changeset/base/225815 > > Log: > Document the fact that passive mode is now the default. > Update copyright dates and strip my middle name. > > Modified: > head/usr.bin/fetch/fetch.1 > head/usr.bin/fetch/fetch.c > > Modified: head/usr.bin/fetch/fetch.1 > ============================================================================== > --- head/usr.bin/fetch/fetch.1 Tue Sep 27 18:57:26 2011 (r225814) > +++ head/usr.bin/fetch/fetch.1 Tue Sep 27 19:02:44 2011 (r225815) > @@ -1,5 +1,5 @@ > .\"- > -.\" Copyright (c) 2000-2004 Dag-Erling Co?dan Sm?rgrav > +.\" Copyright (c) 2000-2011 Dag-Erling Sm?rgrav your name isn't being displayed correctly here. > .\" All rights reserved. > .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used > .\" by permission. > @@ -29,7 +29,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 14, 2008 > +.Dd September 27, 2011 > .Dt FETCH 1 > .Os > .Sh NAME > @@ -165,11 +165,13 @@ directory, with name(s) selected as in t > .It Fl P > .It Fl p > Use passive FTP. > -This is useful if you are behind a firewall which blocks incoming > -connections. > -Try this flag if > -.Nm > -seems to hang when retrieving FTP URLs. > +These flags have no effect, since passive FTP is the default, but are > +provided for compatibility with earlier versions where active FTP was > +the default. > +To force active mode, set the > +.Ev FTP_PASSIVE_MODE > +environment variable to > +.Ql NO . > .It Fl q > Quiet mode. > .It Fl R > > Modified: head/usr.bin/fetch/fetch.c > ============================================================================== > --- head/usr.bin/fetch/fetch.c Tue Sep 27 18:57:26 2011 (r225814) > +++ head/usr.bin/fetch/fetch.c Tue Sep 27 19:02:44 2011 (r225815) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav > + * Copyright (c) 2000-2011 Dag-Erling Smørgrav here your name gets displayed correctly. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without the output of `locale` on my local machine is: LANG=en_GB.ISO8859-15 LC_CTYPE=de_DE.ISO8859-15 LC_COLLATE="en_GB.ISO8859-15" LC_TIME=de_DE.ISO8859-15 LC_NUMERIC=de_DE.ISO8859-15 LC_MONETARY=de_DE.ISO8859-15 LC_MESSAGES="en_GB.ISO8859-15" LC_ALL= cheers. alex From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 02:54:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4117106566B; Wed, 28 Sep 2011 02:54:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A421F8FC0A; Wed, 28 Sep 2011 02:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S2sgVl051919; Wed, 28 Sep 2011 02:54:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S2sg6c051917; Wed, 28 Sep 2011 02:54:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280254.p8S2sg6c051917@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 02:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225818 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 02:54:42 -0000 Author: adrian Date: Wed Sep 28 02:54:42 2011 New Revision: 225818 URL: http://svn.freebsd.org/changeset/base/225818 Log: Update the default AIFS value for hostap mode. Obtained from: Linux ath9k, Atheros reference Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Sep 27 19:54:58 2011 (r225817) +++ head/sys/dev/ath/if_athvar.h Wed Sep 28 02:54:42 2011 (r225818) @@ -64,7 +64,7 @@ #define ATH_TXMGTTRY 4 /* xmit attempts for mgt/ctl frames */ #define ATH_TXINTR_PERIOD 5 /* max number of batched tx descriptors */ -#define ATH_BEACON_AIFS_DEFAULT 0 /* default aifs for ap beacon q */ +#define ATH_BEACON_AIFS_DEFAULT 1 /* default aifs for ap beacon q */ #define ATH_BEACON_CWMIN_DEFAULT 0 /* default cwmin for ap beacon q */ #define ATH_BEACON_CWMAX_DEFAULT 0 /* default cwmax for ap beacon q */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 03:03:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC4F11065673; Wed, 28 Sep 2011 03:03:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81DB08FC19; Wed, 28 Sep 2011 03:03:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S33NZr052388; Wed, 28 Sep 2011 03:03:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S33NHS052385; Wed, 28 Sep 2011 03:03:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280303.p8S33NHS052385@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 03:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225819 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 03:03:23 -0000 Author: adrian Date: Wed Sep 28 03:03:23 2011 New Revision: 225819 URL: http://svn.freebsd.org/changeset/base/225819 Log: The AR5212 setup path (also used by the AR5416 code) configures a local variable with a beacon interval of 100 TU. This never gets modified if the beacon interval configuration changes. This may have been correct in earlier times, but with the advent of staggered beacons (which default to 1 / ATH_BCBUF beacon interval, so 25 TU here) this value is incorrect. It is used to configure the default CABQ readytime. So here, the cabq was being configured to be much greater than the target beacon timer (TBTT.) The driver should be configuring a cabq readytime value rather then leaving it to the HAL to choose sensible defaults. This should be done in the future - I'm simply trying to ensure sensible defaults are chosen. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Wed Sep 28 02:54:42 2011 (r225818) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Wed Sep 28 03:03:23 2011 (r225819) @@ -44,6 +44,7 @@ ar5212GetNextTBTT(struct ath_hal *ah) void ar5212SetBeaconTimers(struct ath_hal *ah, const HAL_BEACON_TIMERS *bt) { + struct ath_hal_5212 *ahp = AH5212(ah); OS_REG_WRITE(ah, AR_TIMER0, bt->bt_nexttbtt); OS_REG_WRITE(ah, AR_TIMER1, bt->bt_nextdba); @@ -65,6 +66,7 @@ ar5212SetBeaconTimers(struct ath_hal *ah OS_REG_WRITE(ah, AR_BEACON, AR_BEACON_RESET_TSF); } OS_REG_WRITE(ah, AR_BEACON, bt->bt_intval); + ahp->ah_beaconInterval = (bt->bt_intval & HAL_BEACON_PERIOD); } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Wed Sep 28 02:54:42 2011 (r225818) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Wed Sep 28 03:03:23 2011 (r225819) @@ -46,6 +46,7 @@ void ar5416SetBeaconTimers(struct ath_hal *ah, const HAL_BEACON_TIMERS *bt) { uint32_t bperiod; + struct ath_hal_5212 *ahp = AH5212(ah); OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bt->bt_nexttbtt)); OS_REG_WRITE(ah, AR_NEXT_DBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba)); @@ -53,6 +54,7 @@ ar5416SetBeaconTimers(struct ath_hal *ah OS_REG_WRITE(ah, AR_NEXT_NDP, TU_TO_USEC(bt->bt_nextatim)); bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD); + ahp->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD; OS_REG_WRITE(ah, AR5416_BEACON_PERIOD, bperiod); OS_REG_WRITE(ah, AR_DBA_PERIOD, bperiod); OS_REG_WRITE(ah, AR_SWBA_PERIOD, bperiod); From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 03:05:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 235D7106566B; Wed, 28 Sep 2011 03:05:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 125CD8FC12; Wed, 28 Sep 2011 03:05:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S354fo052481; Wed, 28 Sep 2011 03:05:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S354YT052478; Wed, 28 Sep 2011 03:05:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280305.p8S354YT052478@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 03:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225820 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 03:05:05 -0000 Author: adrian Date: Wed Sep 28 03:05:04 2011 New Revision: 225820 URL: http://svn.freebsd.org/changeset/base/225820 Log: Change the default CABQ time to be 70% of the beacon interval, rather than the whole beacon interval. The reference driver and Linux ath9k both choose 80% of the beacon interval and they do it in the driver rather than the HAL (Ath reference) or ath9k_hw (ath9k.) This quietens stuck beacon conditions on my AR9220/AR9280 based NICs when a lot of burst broadcast/multicast traffic is going on. It doesn't seem to annoy the earlier MACs as much as the AR9280 and later one. Obtained from: Linux ath9k, Atheros Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Wed Sep 28 03:03:23 2011 (r225819) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Wed Sep 28 03:05:04 2011 (r225820) @@ -263,6 +263,7 @@ ar5212ReleaseTxQueue(struct ath_hal *ah, * Assumes: * phwChannel has been set to point to the current channel */ +#define TU_TO_USEC(_tu) ((_tu) << 10) HAL_BOOL ar5212ResetTxQueue(struct ath_hal *ah, u_int q) { @@ -270,7 +271,7 @@ ar5212ResetTxQueue(struct ath_hal *ah, u HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; HAL_TX_QUEUE_INFO *qi; - uint32_t cwMin, chanCwMin, value, qmisc, dmisc; + uint32_t cwMin, chanCwMin, qmisc, dmisc; if (q >= pCap->halTotalQueues) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n", @@ -409,17 +410,40 @@ ar5212ResetTxQueue(struct ath_hal *ah, u | AR_Q_MISC_CBR_INCR_DIS1 | AR_Q_MISC_CBR_INCR_DIS0; - if (!qi->tqi_readyTime) { + if (qi->tqi_readyTime) { + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: using tqi_readyTime\n", __func__); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(qi->tqi_readyTime, AR_Q_RDYTIMECFG_INT) | + AR_Q_RDYTIMECFG_ENA); + } else { + int value; /* * NB: don't set default ready time if driver * has explicitly specified something. This is * here solely for backwards compatibility. */ - value = (ahp->ah_beaconInterval + /* + * XXX for now, hard-code a CAB interval of 70% + * XXX of the total beacon interval. + */ + + value = (ahp->ah_beaconInterval * 70 / 100) - (ah->ah_config.ah_sw_beacon_response_time - - ah->ah_config.ah_dma_beacon_response_time) - - ah->ah_config.ah_additional_swba_backoff) * 1024; - OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); + + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff; + /* + * XXX Ensure it isn't too low - nothing lower + * XXX than 10 TU + */ + if (value < 10) + value = 10; + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: defaulting to rdytime = %d uS\n", + __func__, value); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(TU_TO_USEC(value), AR_Q_RDYTIMECFG_INT) | + AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, AR_D_MISC_ARB_LOCKOUT_CNTRL); @@ -481,6 +505,7 @@ ar5212ResetTxQueue(struct ath_hal *ah, u return AH_TRUE; } +#undef TU_TO_USEC /* * Get the TXDP for the specified queue Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Sep 28 03:03:23 2011 (r225819) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Sep 28 03:05:04 2011 (r225820) @@ -879,6 +879,7 @@ setTxQInterrupts(struct ath_hal *ah, HAL * Assumes: * phwChannel has been set to point to the current channel */ +#define TU_TO_USEC(_tu) ((_tu) << 10) HAL_BOOL ar5416ResetTxQueue(struct ath_hal *ah, u_int q) { @@ -886,7 +887,7 @@ ar5416ResetTxQueue(struct ath_hal *ah, u HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; HAL_TX_QUEUE_INFO *qi; - uint32_t cwMin, chanCwMin, value, qmisc, dmisc; + uint32_t cwMin, chanCwMin, qmisc, dmisc; if (q >= pCap->halTotalQueues) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n", @@ -956,7 +957,8 @@ ar5416ResetTxQueue(struct ath_hal *ah, u if (qi->tqi_cbrOverflowLimit) qmisc |= AR_Q_MISC_CBR_EXP_CNTR_LIMIT; } - if (qi->tqi_readyTime) { + + if (qi->tqi_readyTime && (qi->tqi_type != HAL_TX_QUEUE_CAB)) { OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), SM(qi->tqi_readyTime, AR_Q_RDYTIMECFG_INT) | AR_Q_RDYTIMECFG_ENA); @@ -1027,18 +1029,46 @@ ar5416ResetTxQueue(struct ath_hal *ah, u qmisc |= AR_Q_MISC_FSP_DBA_GATED | AR_Q_MISC_CBR_INCR_DIS1 | AR_Q_MISC_CBR_INCR_DIS0; - - if (!qi->tqi_readyTime) { + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: CAB: tqi_readyTime = %d\n", + __func__, qi->tqi_readyTime); + if (qi->tqi_readyTime) { + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: using tqi_readyTime\n", __func__); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(qi->tqi_readyTime, AR_Q_RDYTIMECFG_INT) | + AR_Q_RDYTIMECFG_ENA); + } else { + int value; /* * NB: don't set default ready time if driver * has explicitly specified something. This is * here solely for backwards compatibility. */ - value = (ahp->ah_beaconInterval - - (ah->ah_config.ah_sw_beacon_response_time - - ah->ah_config.ah_dma_beacon_response_time) - - ah->ah_config.ah_additional_swba_backoff) * 1024; - OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); + /* + * XXX for now, hard-code a CAB interval of 70% + * XXX of the total beacon interval. + * + * XXX This keeps Merlin and later based MACs + * XXX quite a bit happier (stops stuck beacons, + * XXX which I gather is because of such a long + * XXX cabq time.) + */ + value = (ahp->ah_beaconInterval * 70 / 100) + - (ah->ah_config.ah_sw_beacon_response_time + + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff; + /* + * XXX Ensure it isn't too low - nothing lower + * XXX than 10 TU + */ + if (value < 10) + value = 10; + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: defaulting to rdytime = %d uS\n", + __func__, value); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(TU_TO_USEC(value), AR_Q_RDYTIMECFG_INT) | + AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, AR_D_MISC_ARB_LOCKOUT_CNTRL); @@ -1106,3 +1136,4 @@ ar5416ResetTxQueue(struct ath_hal *ah, u return AH_TRUE; } +#undef TU_TO_USEC From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 03:07:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70C66106564A; Wed, 28 Sep 2011 03:07:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 610868FC13; Wed, 28 Sep 2011 03:07:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S37q5j052605; Wed, 28 Sep 2011 03:07:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S37qKB052603; Wed, 28 Sep 2011 03:07:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280307.p8S37qKB052603@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 03:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225821 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 03:07:52 -0000 Author: adrian Date: Wed Sep 28 03:07:51 2011 New Revision: 225821 URL: http://svn.freebsd.org/changeset/base/225821 Log: Fix lock order to be correcter. Nothing else locks these two queues (cabq, avp mcastq), but it should be consistent and correct. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Sep 28 03:05:04 2011 (r225820) +++ head/sys/dev/ath/if_ath.c Wed Sep 28 03:07:51 2011 (r225821) @@ -2620,8 +2620,8 @@ ath_beacon_generate(struct ath_softc *sc } /* NB: gated by beacon so safe to start here */ ath_hal_txstart(ah, cabq->axq_qnum); - ATH_TXQ_UNLOCK(cabq); ATH_TXQ_UNLOCK(&avp->av_mcastq); + ATH_TXQ_UNLOCK(cabq); } return bf; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 03:11:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 544881065673; Wed, 28 Sep 2011 03:11:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 445618FC19; Wed, 28 Sep 2011 03:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S3BqYM052929; Wed, 28 Sep 2011 03:11:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S3BqPY052927; Wed, 28 Sep 2011 03:11:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280311.p8S3BqPY052927@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 03:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225822 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 03:11:52 -0000 Author: adrian Date: Wed Sep 28 03:11:51 2011 New Revision: 225822 URL: http://svn.freebsd.org/changeset/base/225822 Log: Don't bother triggering the cabq queue if it's empty. Obtained from: Atheros Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Sep 28 03:07:51 2011 (r225821) +++ head/sys/dev/ath/if_ath.c Wed Sep 28 03:11:51 2011 (r225822) @@ -2619,7 +2619,8 @@ ath_beacon_generate(struct ath_softc *sc sc->sc_stats.ast_cabq_xmit += nmcastq; } /* NB: gated by beacon so safe to start here */ - ath_hal_txstart(ah, cabq->axq_qnum); + if (! STAILQ_EMPTY(&(cabq->axq_q))) + ath_hal_txstart(ah, cabq->axq_qnum); ATH_TXQ_UNLOCK(&avp->av_mcastq); ATH_TXQ_UNLOCK(cabq); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 08:47:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C00E106567A; Wed, 28 Sep 2011 08:47:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED0F28FC16; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S8lI4m063686; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S8lIHV063682; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109280847.p8S8lIHV063682@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 08:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:47:19 -0000 Author: bz Date: Wed Sep 28 08:47:17 2011 New Revision: 225827 URL: http://svn.freebsd.org/changeset/base/225827 Log: Fix handling of corrupt compress(1)ed data. [11:04] Add missing length checks on unix socket addresses. [11:05] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-11:04.compress Security: CVE-2011-2895 [11:04] Security: FreeBSD-SA-11:05.unix Modified: head/sys/kern/uipc_usrreq.c head/usr.bin/compress/zopen.c head/usr.bin/gzip/zuncompress.c Changes in other areas also in this revision: Modified: releng/7.3/UPDATING releng/7.3/sys/conf/newvers.sh releng/7.3/sys/kern/uipc_usrreq.c releng/7.3/usr.bin/compress/zopen.c releng/7.3/usr.bin/gzip/zuncompress.c releng/7.4/UPDATING releng/7.4/sys/conf/newvers.sh releng/7.4/sys/kern/uipc_usrreq.c releng/7.4/usr.bin/compress/zopen.c releng/7.4/usr.bin/gzip/zuncompress.c releng/8.1/UPDATING releng/8.1/sys/conf/newvers.sh releng/8.1/sys/kern/uipc_usrreq.c releng/8.1/usr.bin/compress/zopen.c releng/8.1/usr.bin/gzip/zuncompress.c releng/8.2/UPDATING releng/8.2/sys/conf/newvers.sh releng/8.2/sys/kern/uipc_usrreq.c releng/8.2/usr.bin/compress/zopen.c releng/8.2/usr.bin/gzip/zuncompress.c stable/7/sys/kern/uipc_usrreq.c stable/7/usr.bin/compress/zopen.c stable/7/usr.bin/gzip/zuncompress.c stable/8/sys/kern/uipc_usrreq.c stable/8/usr.bin/compress/zopen.c stable/8/usr.bin/gzip/zuncompress.c stable/9/sys/kern/uipc_usrreq.c stable/9/usr.bin/compress/zopen.c stable/9/usr.bin/gzip/zuncompress.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) +++ head/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) @@ -462,6 +462,8 @@ uipc_bind(struct socket *so, struct sock unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + if (soun->sun_len > sizeof(struct sockaddr_un)) + return (EINVAL); namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); if (namelen <= 0) return (EINVAL); @@ -1252,6 +1254,8 @@ unp_connect(struct socket *so, struct so unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + if (nam->sa_len > sizeof(struct sockaddr_un)) + return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) +++ head/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) @@ -486,7 +486,7 @@ zread(void *cookie, char *rbp, int num) block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1L << maxbits; - if (maxbits > BITS) { + if (maxbits > BITS || maxbits < 12) { errno = EFTYPE; return (-1); } @@ -513,17 +513,28 @@ zread(void *cookie, char *rbp, int num) for (code = 255; code >= 0; code--) tab_prefixof(code) = 0; clear_flg = 1; - free_ent = FIRST - 1; - if ((code = getcode(zs)) == -1) /* O, untimely death! */ - break; + free_ent = FIRST; + oldcode = -1; + continue; } incode = code; - /* Special case for KwKwK string. */ + /* Special case for kWkWk string. */ if (code >= free_ent) { + if (code > free_ent || oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *stackp++ = finchar; code = oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (code >= 256) { @@ -540,7 +551,7 @@ middle: do { } while (stackp > de_stack); /* Generate the new entry. */ - if ((code = free_ent) < maxmaxcode) { + if ((code = free_ent) < maxmaxcode && oldcode != -1) { tab_prefixof(code) = (u_short) oldcode; tab_suffixof(code) = finchar; free_ent = code + 1; Modified: head/usr.bin/gzip/zuncompress.c ============================================================================== --- head/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) +++ head/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; zs->zs_maxbits &= BIT_MASK; zs->zs_maxmaxcode = 1L << zs->zs_maxbits; - if (zs->zs_maxbits > BITS) { + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { errno = EFTYPE; return (-1); } @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) } zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ - return (0); /* Get out of here */ - - /* First code must be 8 bits = char. */ - *bp++ = (u_char)zs->u.r.zs_finchar; - count--; + zs->u.r.zs_oldcode = -1; zs->u.r.zs_stackp = de_stack; while ((zs->u.r.zs_code = getcode(zs)) > -1) { @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) zs->u.r.zs_code--) tab_prefixof(zs->u.r.zs_code) = 0; zs->zs_clear_flg = 1; - zs->zs_free_ent = FIRST - 1; - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ - break; + zs->zs_free_ent = FIRST; + zs->u.r.zs_oldcode = -1; + continue; } zs->u.r.zs_incode = zs->u.r.zs_code; /* Special case for KwKwK string. */ if (zs->u.r.zs_code >= zs->zs_free_ent) { + if (zs->u.r.zs_code > zs->zs_free_ent || + zs->u.r.zs_oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; zs->u.r.zs_code = zs->u.r.zs_oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (zs->u.r.zs_code >= 256) { @@ -302,7 +308,8 @@ middle: do { } while (zs->u.r.zs_stackp > de_stack); /* Generate the new entry. */ - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && + zs->u.r.zs_oldcode != -1) { tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 11:02:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9071065674 for ; Wed, 28 Sep 2011 11:02:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 19F728FC13 for ; Wed, 28 Sep 2011 11:02:24 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p8SAVjc0011025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Sep 2011 13:31:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p8SAVjtW047243; Wed, 28 Sep 2011 13:31:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p8SAVja3047242; Wed, 28 Sep 2011 13:31:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 Sep 2011 13:31:45 +0300 From: Kostik Belousov To: Adrian Chadd Message-ID: <20110928103145.GU1511@deviant.kiev.zoral.com.ua> References: <201109280307.p8S37qKB052603@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hze9XmyoPo8YE0yg" Content-Disposition: inline In-Reply-To: <201109280307.p8S37qKB052603@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225821 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 11:02:25 -0000 --hze9XmyoPo8YE0yg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 28, 2011 at 03:07:52AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Wed Sep 28 03:07:51 2011 > New Revision: 225821 > URL: http://svn.freebsd.org/changeset/base/225821 >=20 > Log: > Fix lock order to be correcter. > =20 > Nothing else locks these two queues (cabq, avp mcastq), but it should > be consistent and correct. >=20 > Modified: > head/sys/dev/ath/if_ath.c >=20 > Modified: head/sys/dev/ath/if_ath.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ath/if_ath.c Wed Sep 28 03:05:04 2011 (r225820) > +++ head/sys/dev/ath/if_ath.c Wed Sep 28 03:07:51 2011 (r225821) > @@ -2620,8 +2620,8 @@ ath_beacon_generate(struct ath_softc *sc > } > /* NB: gated by beacon so safe to start here */ > ath_hal_txstart(ah, cabq->axq_qnum); > - ATH_TXQ_UNLOCK(cabq); > ATH_TXQ_UNLOCK(&avp->av_mcastq); > + ATH_TXQ_UNLOCK(cabq); > } > return bf; > } Does the unlock order matter ? Unlock cannot block. I do not object against the change, rather, I am nit-picking against the commit message. --hze9XmyoPo8YE0yg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6C95EACgkQC3+MBN1Mb4gEXQCg9sTuILdWjTClNXiFH+70Pdk/ 3ToAnR/cHzUQtWvaY89CKJ9DftwVnJCZ =XjQa -----END PGP SIGNATURE----- --hze9XmyoPo8YE0yg-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 11:53:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 586D2106566B; Wed, 28 Sep 2011 11:53:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id E43E88FC16; Wed, 28 Sep 2011 11:53:09 +0000 (UTC) Received: by yia13 with SMTP id 13so7923645yia.13 for ; Wed, 28 Sep 2011 04:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Ujaz/Pom78GrMnzCFu8tPhb7XNWZ8mJU9XbJJz1RqOs=; b=vNbHjokUysvR9EyaYwzTLigATDGqkpaEkH03xkbF4RmO9ECYmJFdLTPn5EHcwE+wh3 VlE9FTEQlATT1Ch/tudVDFUUd62O3C/IP+XAYTozpbIrdaifIRg+cHltTsqyknSNezAq gPwfQhpPSXfKAlZACLnr8IODzxl+Dtm4ahOzA= MIME-Version: 1.0 Received: by 10.236.79.72 with SMTP id h48mr56309654yhe.4.1317209031951; Wed, 28 Sep 2011 04:23:51 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Wed, 28 Sep 2011 04:23:51 -0700 (PDT) In-Reply-To: <20110928103145.GU1511@deviant.kiev.zoral.com.ua> References: <201109280307.p8S37qKB052603@svn.freebsd.org> <20110928103145.GU1511@deviant.kiev.zoral.com.ua> Date: Wed, 28 Sep 2011 19:23:51 +0800 X-Google-Sender-Auth: ri9phJI9sEVlEaWuVChLHtwcl5c Message-ID: From: Adrian Chadd To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225821 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 11:53:10 -0000 On 28 September 2011 18:31, Kostik Belousov wrote: > Does the unlock order matter ? Unlock cannot block. > > I do not object against the change, rather, I am nit-picking against the > commit message. Nope it doesn't. It's just a cosmetic change. Adrian From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 11:57:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85567106564A; Wed, 28 Sep 2011 11:57:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 752978FC14; Wed, 28 Sep 2011 11:57:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SBvASh071984; Wed, 28 Sep 2011 11:57:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SBvAdx071982; Wed, 28 Sep 2011 11:57:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201109281157.p8SBvAdx071982@svn.freebsd.org> From: Martin Matuska Date: Wed, 28 Sep 2011 11:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225828 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 11:57:10 -0000 Author: mm Date: Wed Sep 28 11:57:10 2011 New Revision: 225828 URL: http://svn.freebsd.org/changeset/base/225828 Log: Remove assertion that prevents zfs rename of datasets with mountpoint=none or mountpoint=legacy that have children datasets. This also fixes dataset rename when receiving incremental snapshots as reported on freebsd-fs@ This assertion was made triggerable by opensolaris change #10196. PR: bin/160400 Reviewed by: pjd MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Wed Sep 28 08:47:17 2011 (r225827) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Wed Sep 28 11:57:10 2011 (r225828) @@ -467,7 +467,6 @@ change_one(zfs_handle_t *zhp, void *data * This is necessary when the original mountpoint * is legacy or none. */ - ASSERT(!clp->cl_alldependents); verify(uu_list_insert_before(clp->cl_list, uu_list_first(clp->cl_list), cn) == 0); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 12:04:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 271AA1065670; Wed, 28 Sep 2011 12:04:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id DB02A8FC18; Wed, 28 Sep 2011 12:04:03 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:290b:85d7:b1ec:6922] (unknown [IPv6:2001:7b8:3a7:0:290b:85d7:b1ec:6922]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 86EF15C59; Wed, 28 Sep 2011 14:04:00 +0200 (CEST) Message-ID: <4E830D31.10207@FreeBSD.org> Date: Wed, 28 Sep 2011 14:04:01 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0) Gecko/20110922 Thunderbird/7.0 MIME-Version: 1.0 To: Alexander Best References: <201109271902.p8RJ2isK037034@svn.freebsd.org> <20110927231104.GA13143@freebsd.org> In-Reply-To: <20110927231104.GA13143@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r225815 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 12:04:04 -0000 On 2011-09-28 01:11, Alexander Best wrote: > On Tue Sep 27 11, Dag-Erling Smorgrav wrote: >> Author: des >> Date: Tue Sep 27 19:02:44 2011 >> New Revision: 225815 >> URL: http://svn.freebsd.org/changeset/base/225815 =2E.. >> --- head/usr.bin/fetch/fetch.1 Tue Sep 27 18:57:26 2011 (r225814) >> +++ head/usr.bin/fetch/fetch.1 Tue Sep 27 19:02:44 2011 (r225815) >> @@ -1,5 +1,5 @@ >> .\"- >> -.\" Copyright (c) 2000-2004 Dag-Erling Co?dan Sm?rgrav >> +.\" Copyright (c) 2000-2011 Dag-Erling Sm?rgrav > > your name isn't being displayed correctly here. =2E.. >> Modified: head/usr.bin/fetch/fetch.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr.bin/fetch/fetch.c Tue Sep 27 18:57:26 2011 (r225814) >> +++ head/usr.bin/fetch/fetch.c Tue Sep 27 19:02:44 2011 (r225815) >> @@ -1,5 +1,5 @@ >> /*- >> - * Copyright (c) 2000-2004 Dag-Erling Co=EFdan Sm=F8rgrav >> + * Copyright (c) 2000-2011 Dag-Erling Sm=F8rgrav > > here your name gets displayed correctly. The first file is plain ASCII, and has character 0xf8 for the letter =F8.= The second file is UTF-8 without BOM, and uses 0xc3 0xb8 to represent the same letter. Maybe it would be nice if both files were UTF-8, but I'm not sure if manpages support that. From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 12:47:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3FD1106566B; Wed, 28 Sep 2011 12:47:24 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 794AE8FC0C; Wed, 28 Sep 2011 12:47:24 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0575B1FFC35; Wed, 28 Sep 2011 12:47:23 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B4AFF8455D; Wed, 28 Sep 2011 14:47:22 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric References: <201109271902.p8RJ2isK037034@svn.freebsd.org> <20110927231104.GA13143@freebsd.org> <4E830D31.10207@FreeBSD.org> Date: Wed, 28 Sep 2011 14:47:22 +0200 In-Reply-To: <4E830D31.10207@FreeBSD.org> (Dimitry Andric's message of "Wed, 28 Sep 2011 14:04:01 +0200") Message-ID: <86y5x896lh.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexander Best , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225815 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 12:47:25 -0000 Dimitry Andric writes: > The first file is plain ASCII, and has character 0xf8 for the letter =C3= =B8. Not plain ASCII, but ISO-8859-1. > The second file is UTF-8 without BOM, and uses 0xc3 0xb8 to represent > the same letter. > > Maybe it would be nice if both files were UTF-8, but I'm not sure if > manpages support that. They do. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 13:08:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B358106566B; Wed, 28 Sep 2011 13:08:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A18B8FC19; Wed, 28 Sep 2011 13:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SD8qvB074291; Wed, 28 Sep 2011 13:08:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SD8qGk074284; Wed, 28 Sep 2011 13:08:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109281308.p8SD8qGk074284@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Sep 2011 13:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225830 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 13:08:52 -0000 Author: pjd Date: Wed Sep 28 13:08:51 2011 New Revision: 225830 URL: http://svn.freebsd.org/changeset/base/225830 Log: After every activemap change flush disk's write cache, so that write reordering won't make the actual write to be committed before marking the coresponding extent as dirty. It can be disabled in configuration file. If BIO_FLUSH is not supported by the underlying file system we log a warning and never send BIO_FLUSH again to that GEOM provider. MFC after: 3 days Modified: head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/token.l Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/hast.conf.5 Wed Sep 28 13:08:51 2011 (r225830) @@ -63,6 +63,7 @@ checksum compression timeout exec +metaflush "on" | "off" on { # Node section @@ -85,12 +86,14 @@ resource { local timeout exec + metaflush "on" | "off" on { # Resource-node section name # Required local + metaflush "on" | "off" # Required remote source @@ -100,6 +103,7 @@ resource { name # Required local + metaflush "on" | "off" # Required remote source @@ -318,6 +322,25 @@ It can be one of: .Ar secondary , .Ar primary . .Pp +.It Ic metaflush on | off +.Pp +When set to +.Va on , +flush write cache of the local provider after every metadata (activemap) update. +Flushing write cache ensures that provider will not reorder writes and that +metadata will be properly updated before real data is stored. +If the local provider does not support flushing write cache (it returns +.Er EOPNOTSUPP +on the +.Cm BIO_FLUSH +request), +.Nm hastd +will disable +.Ic metaflush +automatically. +The default value is +.Va on . +.Pp .It Ic name Aq name .Pp GEOM provider name that will appear as Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/hast.h Wed Sep 28 13:08:51 2011 (r225830) @@ -167,6 +167,8 @@ struct hast_resource { off_t hr_local_mediasize; /* Sector size of local provider. */ unsigned int hr_local_sectorsize; + /* Flush write cache on metadata updates? */ + int hr_metaflush; /* Descriptor for /dev/ggctl communication. */ int hr_ggatefd; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/hastd.c Wed Sep 28 13:08:51 2011 (r225830) @@ -386,6 +386,12 @@ resource_needs_restart(const struct hast return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) return (true); + /* + * When metaflush has changed we don't really need restart, + * but it is just easier this way. + */ + if (res0->hr_metaflush != res1->hr_metaflush) + return (true); } return (false); } @@ -416,6 +422,8 @@ resource_needs_reload(const struct hast_ return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) return (true); + if (res0->hr_metaflush != res1->hr_metaflush) + return (true); return (false); } @@ -436,6 +444,7 @@ resource_reload(const struct hast_resour nv_add_int32(nvout, (int32_t)res->hr_compression, "compression"); nv_add_int32(nvout, (int32_t)res->hr_timeout, "timeout"); nv_add_string(nvout, res->hr_exec, "exec"); + nv_add_int32(nvout, (int32_t)res->hr_metaflush, "metaflush"); if (nv_error(nvout) != 0) { nv_free(nvout); pjdlog_error("Unable to allocate header for reload message."); @@ -591,12 +600,13 @@ hastd_reload(void) * recreating it. * * We do just reload (send SIGHUP to worker process) if we act as - * PRIMARY, but only if remote address, replication mode, timeout or - * execution path has changed. For those, there is no need to restart - * worker process. + * PRIMARY, but only if remote address, source address, replication + * mode, timeout, execution path or metaflush has changed. + * For those, there is no need to restart worker process. * If PRIMARY receives SIGHUP, it will reconnect if remote address or - * replication mode has changed or simply set new timeout if only - * timeout has changed. + * source address has changed or it will set new timeout if only timeout + * has changed or it will update metaflush if only metaflush has + * changed. */ TAILQ_FOREACH_SAFE(nres, &newcfg->hc_resources, hr_next, tres) { TAILQ_FOREACH(cres, &cfg->hc_resources, hr_next) { @@ -627,6 +637,7 @@ hastd_reload(void) cres->hr_timeout = nres->hr_timeout; strlcpy(cres->hr_exec, nres->hr_exec, sizeof(cres->hr_exec)); + cres->hr_metaflush = nres->hr_metaflush; if (cres->hr_workerpid != 0) resource_reload(cres); } Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/parse.y Wed Sep 28 13:08:51 2011 (r225830) @@ -68,9 +68,11 @@ static int depth0_checksum; static int depth0_compression; static int depth0_timeout; static char depth0_exec[PATH_MAX]; +static int depth0_metaflush; static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; +static int depth1_metaflush; extern void yyrestart(FILE *); @@ -197,6 +199,7 @@ yy_config_parse(const char *config, bool strlcpy(depth0_listen_tcp6, HASTD_LISTEN_TCP6, sizeof(depth0_listen_tcp6)); depth0_exec[0] = '\0'; + depth0_metaflush = 1; lconfig = calloc(1, sizeof(*lconfig)); if (lconfig == NULL) { @@ -328,6 +331,13 @@ yy_config_parse(const char *config, bool strlcpy(curres->hr_exec, depth0_exec, sizeof(curres->hr_exec)); } + if (curres->hr_metaflush == -1) { + /* + * Metaflush is not set at resource-level. + * Use global or default setting. + */ + curres->hr_metaflush = depth0_metaflush; + } } return (lconfig); @@ -355,8 +365,8 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL LISTEN PORT REPLICATION CHECKSUM COMPRESSION -%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON +%token CONTROL LISTEN PORT REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB @@ -364,6 +374,7 @@ yy_config_free(struct hastd_config *conf %type replication_type %type checksum_type %type compression_type +%type boolean %union { @@ -396,6 +407,8 @@ statement: | exec_statement | + metaflush_statement + | node_statement | resource_statement @@ -585,6 +598,34 @@ exec_statement: EXEC STR } ; +metaflush_statement: METAFLUSH boolean + { + switch (depth) { + case 0: + depth0_metaflush = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + depth1_metaflush = $2; + break; + case 2: + if (!mynode) + break; + PJDLOG_ASSERT(curres != NULL); + curres->hr_metaflush = $2; + break; + default: + PJDLOG_ABORT("metaflush at wrong depth level"); + } + } + ; + +boolean: + ON { $$ = 1; } + | + OFF { $$ = 0; } + ; + node_statement: ON node_start OB node_entries CB { mynode = false; @@ -660,6 +701,13 @@ resource_statement: RESOURCE resource_st strlcpy(curres->hr_localpath, depth1_localpath, sizeof(curres->hr_localpath)); } + if (curres->hr_metaflush == -1 && depth1_metaflush != -1) { + /* + * Metaflush is not set at node-level, + * but is set at resource-level, use it. + */ + curres->hr_metaflush = depth1_metaflush; + } /* * If provider name is not given, use resource name @@ -713,6 +761,7 @@ resource_start: STR */ depth1_provname[0] = '\0'; depth1_localpath[0] = '\0'; + depth1_metaflush = -1; hadmynode = false; curres = calloc(1, sizeof(*curres)); @@ -739,6 +788,7 @@ resource_start: STR curres->hr_provname[0] = '\0'; curres->hr_localpath[0] = '\0'; curres->hr_localfd = -1; + curres->hr_metaflush = -1; curres->hr_remoteaddr[0] = '\0'; curres->hr_sourceaddr[0] = '\0'; curres->hr_ggateunit = -1; @@ -761,6 +811,8 @@ resource_entry: | exec_statement | + metaflush_statement + | name_statement | local_statement @@ -869,6 +921,8 @@ resource_node_entry: remote_statement | source_statement + | + metaflush_statement ; remote_statement: REMOTE remote_str Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/primary.c Wed Sep 28 13:08:51 2011 (r225830) @@ -296,6 +296,17 @@ hast_activemap_flush(struct hast_resourc pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); return (-1); } + if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { + if (errno == EOPNOTSUPP) { + pjdlog_warning("The %s provider doesn't support flushing write cache. Disabling it.", + res->hr_localpath); + res->hr_metaflush = 0; + } else { + pjdlog_errno(LOG_ERR, + "Unable to flush disk cache on activemap update"); + return (-1); + } + } return (0); } @@ -1999,6 +2010,7 @@ primary_config_reload(struct hast_resour nv_assert(nv, "compression"); nv_assert(nv, "timeout"); nv_assert(nv, "exec"); + nv_assert(nv, "metaflush"); ncomps = HAST_NCOMPONENTS; @@ -2009,6 +2021,7 @@ primary_config_reload(struct hast_resour #define MODIFIED_COMPRESSION 0x10 #define MODIFIED_TIMEOUT 0x20 #define MODIFIED_EXEC 0x40 +#define MODIFIED_METAFLUSH 0x80 modified = 0; vstr = nv_get_string(nv, "remoteaddr"); @@ -2050,6 +2063,11 @@ primary_config_reload(struct hast_resour strlcpy(gres->hr_exec, vstr, sizeof(gres->hr_exec)); modified |= MODIFIED_EXEC; } + vint = nv_get_int32(nv, "metaflush"); + if (gres->hr_metaflush != vint) { + gres->hr_metaflush = vint; + modified |= MODIFIED_METAFLUSH; + } /* * Change timeout for connected sockets. @@ -2099,6 +2117,7 @@ primary_config_reload(struct hast_resour #undef MODIFIED_COMPRESSION #undef MODIFIED_TIMEOUT #undef MODIFIED_EXEC +#undef MODIFIED_METAFLUSH pjdlog_info("Configuration reloaded successfully."); } Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Wed Sep 28 12:13:15 2011 (r225829) +++ head/sbin/hastd/token.l Wed Sep 28 13:08:51 2011 (r225830) @@ -53,12 +53,14 @@ checksum { DP; return CHECKSUM; } compression { DP; return COMPRESSION; } timeout { DP; return TIMEOUT; } exec { DP; return EXEC; } +metaflush { DP; return METAFLUSH; } resource { DP; return RESOURCE; } name { DP; return NAME; } local { DP; return LOCAL; } remote { DP; return REMOTE; } source { DP; return SOURCE; } on { DP; return ON; } +off { DP; return OFF; } fullsync { DP; return FULLSYNC; } memsync { DP; return MEMSYNC; } async { DP; return ASYNC; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 13:13:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5653106564A; Wed, 28 Sep 2011 13:13:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C542C8FC0A; Wed, 28 Sep 2011 13:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SDDhCs074482; Wed, 28 Sep 2011 13:13:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SDDh1I074480; Wed, 28 Sep 2011 13:13:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109281313.p8SDDh1I074480@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Sep 2011 13:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225831 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 13:13:43 -0000 Author: pjd Date: Wed Sep 28 13:13:43 2011 New Revision: 225831 URL: http://svn.freebsd.org/changeset/base/225831 Log: Break a bit earlier. MFC after: 3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Wed Sep 28 13:08:51 2011 (r225830) +++ head/sbin/hastd/secondary.c Wed Sep 28 13:13:43 2011 (r225831) @@ -699,6 +699,7 @@ disk_thread(void *arg) free(map); clear_activemap = false; pjdlog_debug(1, "Local activemap cleared."); + break; } reqlog(LOG_DEBUG, 2, -1, hio, "disk: (%p) Got request: ", hio); /* Handle the actual request. */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 13:19:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D35B8106566B; Wed, 28 Sep 2011 13:19:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B886C8FC0C; Wed, 28 Sep 2011 13:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SDJlkG074718; Wed, 28 Sep 2011 13:19:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SDJlv7074713; Wed, 28 Sep 2011 13:19:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109281319.p8SDJlv7074713@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Sep 2011 13:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225832 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 13:19:48 -0000 Author: pjd Date: Wed Sep 28 13:19:47 2011 New Revision: 225832 URL: http://svn.freebsd.org/changeset/base/225832 Log: If the underlying provider doesn't support BIO_FLUSH, log it only once and don't bother trying in the future. MFC after: 3 days Modified: head/sbin/hastd/hast.h head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Wed Sep 28 13:13:43 2011 (r225831) +++ head/sbin/hastd/hast.h Wed Sep 28 13:19:47 2011 (r225832) @@ -167,6 +167,8 @@ struct hast_resource { off_t hr_local_mediasize; /* Sector size of local provider. */ unsigned int hr_local_sectorsize; + /* Is flushing write cache supported by the local provider? */ + bool hr_localflush; /* Flush write cache on metadata updates? */ int hr_metaflush; Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Wed Sep 28 13:13:43 2011 (r225831) +++ head/sbin/hastd/parse.y Wed Sep 28 13:19:47 2011 (r225832) @@ -788,6 +788,7 @@ resource_start: STR curres->hr_provname[0] = '\0'; curres->hr_localpath[0] = '\0'; curres->hr_localfd = -1; + curres->hr_localflush = true; curres->hr_metaflush = -1; curres->hr_remoteaddr[0] = '\0'; curres->hr_sourceaddr[0] = '\0'; Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Sep 28 13:13:43 2011 (r225831) +++ head/sbin/hastd/primary.c Wed Sep 28 13:19:47 2011 (r225832) @@ -1304,8 +1304,15 @@ local_send_thread(void *arg) } break; case BIO_FLUSH: + if (!res->hr_localflush) { + ret = -1; + errno = EOPNOTSUPP; + break; + } ret = g_flush(res->hr_localfd); if (ret < 0) { + if (errno == EOPNOTSUPP) + res->hr_localflush = false; hio->hio_errors[ncomp] = errno; reqlog(LOG_WARNING, 0, ggio, "Local request failed (%s): ", Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Wed Sep 28 13:13:43 2011 (r225831) +++ head/sbin/hastd/secondary.c Wed Sep 28 13:19:47 2011 (r225832) @@ -664,7 +664,7 @@ disk_thread(void *arg) struct hast_resource *res = arg; struct hio *hio; ssize_t ret; - bool clear_activemap; + bool clear_activemap, logerror; clear_activemap = true; @@ -702,6 +702,7 @@ disk_thread(void *arg) break; } reqlog(LOG_DEBUG, 2, -1, hio, "disk: (%p) Got request: ", hio); + logerror = true; /* Handle the actual request. */ switch (hio->hio_cmd) { case HIO_READ: @@ -736,14 +737,23 @@ disk_thread(void *arg) hio->hio_error = 0; break; case HIO_FLUSH: + if (!res->hr_localflush) { + ret = -1; + hio->hio_error = EOPNOTSUPP; + logerror = false; + break; + } ret = g_flush(res->hr_localfd); - if (ret < 0) + if (ret < 0) { + if (errno == EOPNOTSUPP) + res->hr_localflush = false; hio->hio_error = errno; - else + } else { hio->hio_error = 0; + } break; } - if (hio->hio_error != 0) { + if (logerror && hio->hio_error != 0) { reqlog(LOG_ERR, 0, hio->hio_error, hio, "Request failed: "); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 13:25:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04574106566C; Wed, 28 Sep 2011 13:25:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87028FC17; Wed, 28 Sep 2011 13:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SDPRYV075040; Wed, 28 Sep 2011 13:25:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SDPRx0075038; Wed, 28 Sep 2011 13:25:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109281325.p8SDPRx0075038@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Sep 2011 13:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225835 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 13:25:28 -0000 Author: pjd Date: Wed Sep 28 13:25:27 2011 New Revision: 225835 URL: http://svn.freebsd.org/changeset/base/225835 Log: Correct typo. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Sep 28 13:21:53 2011 (r225834) +++ head/sbin/hastd/primary.c Wed Sep 28 13:25:27 2011 (r225835) @@ -1213,7 +1213,7 @@ ggate_recv_thread(void *arg) break; } pjdlog_debug(2, - "ggate_recv: (%p) Moving request to the send queues.", + "ggate_recv: (%p) Moving request to the send queue.", hio); refcount_init(&hio->hio_countdown, ncomps); for (ii = 0; ii < ncomps; ii++) From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 13:48:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2198E106566B; Wed, 28 Sep 2011 13:48:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 100628FC13; Wed, 28 Sep 2011 13:48:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SDmaFq075954; Wed, 28 Sep 2011 13:48:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SDmaC5075948; Wed, 28 Sep 2011 13:48:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109281348.p8SDmaC5075948@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 13:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225837 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 13:48:37 -0000 Author: bz Date: Wed Sep 28 13:48:36 2011 New Revision: 225837 URL: http://svn.freebsd.org/changeset/base/225837 Log: Pass the fibnum where we need filtering of the message on the rtsock allowing routing daemons to filter routing updates on an rtsock per FIB. Adjust raw_input() and split it into wrapper and a new function taking an optional callback argument even though we only have one consumer [1] to keep the hackish flags local to rtsock.c. PR: kern/134931 Submitted by: multiple (see PR) Suggested by: rwatson [1] Reviewed by: rwatson MFC after: 3 days Modified: head/sys/net/raw_cb.h head/sys/net/raw_usrreq.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c Modified: head/sys/net/raw_cb.h ============================================================================== --- head/sys/net/raw_cb.h Wed Sep 28 13:27:31 2011 (r225836) +++ head/sys/net/raw_cb.h Wed Sep 28 13:48:36 2011 (r225837) @@ -70,9 +70,14 @@ pr_init_t raw_init; * Library routines for raw socket usrreq functions; will always be wrapped * so that protocol-specific functions can be handled. */ +typedef int (*raw_input_cb_fn)(struct mbuf *, struct sockproto *, + struct sockaddr *, struct rawcb *); + int raw_attach(struct socket *, int); void raw_detach(struct rawcb *); void raw_input(struct mbuf *, struct sockproto *, struct sockaddr *); +void raw_input_ext(struct mbuf *, struct sockproto *, struct sockaddr *, + raw_input_cb_fn); /* * Generic pr_usrreqs entries for raw socket protocols, usually wrapped so Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Wed Sep 28 13:27:31 2011 (r225836) +++ head/sys/net/raw_usrreq.c Wed Sep 28 13:48:36 2011 (r225837) @@ -71,6 +71,14 @@ raw_init(void) void raw_input(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src) { + + return (raw_input_ext(m0, proto, src, NULL)); +} + +void +raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, + raw_input_cb_fn cb) +{ struct rawcb *rp; struct mbuf *m = m0; struct socket *last; @@ -83,6 +91,8 @@ raw_input(struct mbuf *m0, struct sockpr if (rp->rcb_proto.sp_protocol && rp->rcb_proto.sp_protocol != proto->sp_protocol) continue; + if (cb != NULL && (*cb)(m, proto, src, rp) != 0) + continue; if (last) { struct mbuf *n; n = m_copy(m, 0, (int)M_COPYALL); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Sep 28 13:27:31 2011 (r225836) +++ head/sys/net/route.c Wed Sep 28 13:48:36 2011 (r225837) @@ -384,7 +384,7 @@ miss: */ bzero(&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; - rt_missmsg(msgtype, &info, 0, err); + rt_missmsg_fib(msgtype, &info, 0, err, fibnum); } done: if (newrt) @@ -609,7 +609,7 @@ out: info.rti_info[RTAX_GATEWAY] = gateway; info.rti_info[RTAX_NETMASK] = netmask; info.rti_info[RTAX_AUTHOR] = src; - rt_missmsg(RTM_REDIRECT, &info, flags, error); + rt_missmsg_fib(RTM_REDIRECT, &info, flags, error, fibnum); if (ifa != NULL) ifa_free(ifa); } @@ -1522,7 +1522,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int } RT_ADDREF(rt); RT_UNLOCK(rt); - rt_newaddrmsg(cmd, ifa, error, rt); + rt_newaddrmsg_fib(cmd, ifa, error, rt, fibnum); RT_LOCK(rt); RT_REMREF(rt); if (cmd == RTM_DELETE) { Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Sep 28 13:27:31 2011 (r225836) +++ head/sys/net/route.h Wed Sep 28 13:48:36 2011 (r225837) @@ -369,7 +369,9 @@ void rt_ieee80211msg(struct ifnet *, in void rt_ifannouncemsg(struct ifnet *, int); void rt_ifmsg(struct ifnet *); void rt_missmsg(int, struct rt_addrinfo *, int, int); +void rt_missmsg_fib(int, struct rt_addrinfo *, int, int, int); void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); +void rt_newaddrmsg_fib(int, struct ifaddr *, int, struct rtentry *, int); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Sep 28 13:27:31 2011 (r225836) +++ head/sys/net/rtsock.c Wed Sep 28 13:48:36 2011 (r225837) @@ -122,6 +122,13 @@ MALLOC_DEFINE(M_RTABLE, "routetbl", "rou static struct sockaddr route_src = { 2, PF_ROUTE, }; static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, }; +/* + * Used by rtsock/raw_input callback code to decide whether to filter the update + * notification to a socket bound to a particular FIB. + */ +#define RTS_FILTER_FIB M_PROTO8 +#define RTS_ALLFIBS -1 + static struct { int ip_count; /* attached w/ AF_INET */ int ip6_count; /* attached w/ AF_INET6 */ @@ -196,6 +203,31 @@ rts_init(void) } SYSINIT(rtsock, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, rts_init, 0); +static int +raw_input_rts_cb(struct mbuf *m, struct sockproto *proto, struct sockaddr *src, + struct rawcb *rp) +{ + int fibnum; + + KASSERT(m != NULL, ("%s: m is NULL", __func__)); + KASSERT(proto != NULL, ("%s: proto is NULL", __func__)); + KASSERT(rp != NULL, ("%s: rp is NULL", __func__)); + + /* No filtering requested. */ + if ((m->m_flags & RTS_FILTER_FIB) == 0) + return (0); + + /* Check if it is a rts and the fib matches the one of the socket. */ + fibnum = M_GETFIB(m); + if (proto->sp_family != PF_ROUTE || + rp->rcb_socket == NULL || + rp->rcb_socket->so_fibnum == fibnum) + return (0); + + /* Filtering requested and no match, the socket shall be skipped. */ + return (1); +} + static void rts_input(struct mbuf *m) { @@ -212,7 +244,7 @@ rts_input(struct mbuf *m) } else route_proto.sp_protocol = 0; - raw_input(m, &route_proto, &route_src); + raw_input_ext(m, &route_proto, &route_src, raw_input_rts_cb); } /* @@ -885,6 +917,8 @@ flush: m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); } if (m) { + M_SETFIB(m, so->so_fibnum); + m->m_flags |= RTS_FILTER_FIB; if (rp) { /* * XXX insure we don't get a copy by @@ -1127,7 +1161,8 @@ again: * destination. */ void -rt_missmsg(int type, struct rt_addrinfo *rtinfo, int flags, int error) +rt_missmsg_fib(int type, struct rt_addrinfo *rtinfo, int flags, int error, + int fibnum) { struct rt_msghdr *rtm; struct mbuf *m; @@ -1138,6 +1173,14 @@ rt_missmsg(int type, struct rt_addrinfo m = rt_msg1(type, rtinfo); if (m == NULL) return; + + if (fibnum != RTS_ALLFIBS) { + KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: fibnum out " + "of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); + M_SETFIB(m, fibnum); + m->m_flags |= RTS_FILTER_FIB; + } + rtm = mtod(m, struct rt_msghdr *); rtm->rtm_flags = RTF_DONE | flags; rtm->rtm_errno = error; @@ -1145,6 +1188,13 @@ rt_missmsg(int type, struct rt_addrinfo rt_dispatch(m, sa); } +void +rt_missmsg(int type, struct rt_addrinfo *rtinfo, int flags, int error) +{ + + rt_missmsg_fib(type, rtinfo, flags, error, RTS_ALLFIBS); +} + /* * This routine is called to generate a message from the routing * socket indicating that the status of a network interface has changed. @@ -1179,7 +1229,8 @@ rt_ifmsg(struct ifnet *ifp) * copies of it. */ void -rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) +rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt, + int fibnum) { struct rt_addrinfo info; struct sockaddr *sa = NULL; @@ -1237,10 +1288,24 @@ rt_newaddrmsg(int cmd, struct ifaddr *if rtm->rtm_errno = error; rtm->rtm_addrs = info.rti_addrs; } + if (fibnum != RTS_ALLFIBS) { + KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: " + "fibnum out of range 0 <= %d < %d", __func__, + fibnum, rt_numfibs)); + M_SETFIB(m, fibnum); + m->m_flags |= RTS_FILTER_FIB; + } rt_dispatch(m, sa); } } +void +rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) +{ + + rt_newaddrmsg_fib(cmd, ifa, error, rt, RTS_ALLFIBS); +} + /* * This is the analogue to the rt_newaddrmsg which performs the same * function but for multicast group memberhips. This is easier since From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 14:51:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B9B2106566C; Wed, 28 Sep 2011 14:51:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABF38FC14; Wed, 28 Sep 2011 14:51:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SEpTiU077887; Wed, 28 Sep 2011 14:51:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SEpTgN077885; Wed, 28 Sep 2011 14:51:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109281451.p8SEpTgN077885@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Sep 2011 14:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225838 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 14:51:29 -0000 Author: kib Date: Wed Sep 28 14:51:28 2011 New Revision: 225838 URL: http://svn.freebsd.org/changeset/base/225838 Log: Use the explicitly-sized types for the dirty and valid masks. Requested by: attilio Reviewed by: alc MFC after: 2 weeks Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Sep 28 13:48:36 2011 (r225837) +++ head/sys/vm/vm_page.h Wed Sep 28 14:51:28 2011 (r225838) @@ -139,17 +139,17 @@ struct vm_page { /* so, on normal X86 kernels, they must be at least 8 bits wide */ /* In reality, support for 32KB pages is not fully implemented. */ #if PAGE_SIZE == 4096 - u_char valid; /* map of valid DEV_BSIZE chunks (O) */ - u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */ + uint8_t valid; /* map of valid DEV_BSIZE chunks (O) */ + uint8_t dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 8192 - u_short valid; /* map of valid DEV_BSIZE chunks (O) */ - u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */ + uint16_t valid; /* map of valid DEV_BSIZE chunks (O) */ + uint16_t dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 16384 - u_int valid; /* map of valid DEV_BSIZE chunks (O) */ - u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */ + uint32_t valid; /* map of valid DEV_BSIZE chunks (O) */ + uint32_t dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 32768 - u_long valid; /* map of valid DEV_BSIZE chunks (O) */ - u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */ + uint64_t valid; /* map of valid DEV_BSIZE chunks (O) */ + uint64_t dirty; /* map of dirty DEV_BSIZE chunks (M) */ #endif }; From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 14:52:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15003106566C; Wed, 28 Sep 2011 14:52:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01A848FC15; Wed, 28 Sep 2011 14:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SEqPWI077964; Wed, 28 Sep 2011 14:52:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SEqPGm077954; Wed, 28 Sep 2011 14:52:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109281452.p8SEqPGm077954@svn.freebsd.org> From: Alexander Motin Date: Wed, 28 Sep 2011 14:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225839 - in head: lib/libusbhid sys/dev/usb/input usr.bin/usbhidaction usr.bin/usbhidctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 14:52:26 -0000 Author: mav Date: Wed Sep 28 14:52:25 2011 New Revision: 225839 URL: http://svn.freebsd.org/changeset/base/225839 Log: MFprojects/hid: Import the rest of HID improvements from the branch: - improve report descriptor parser in libusbhid to handle several kinds of reports same time; - add to the libusbhid API two functions wrapping respective kernel IOCTLs for reading and writing reports; - tune uhid IOCTL interface to allow reading and writing arbitrary report, when multiple supported by the device; - teach usbhidctl to set output and feature reports; - make usbhidaction support all the same item names as bhidctl. Sponsored by: iXsystems, inc. Modified: head/lib/libusbhid/data.c head/lib/libusbhid/parse.c head/lib/libusbhid/usbhid.3 head/lib/libusbhid/usbhid.h head/sys/dev/usb/input/uhid.c head/usr.bin/usbhidaction/usbhidaction.1 head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/usbhidctl/usbhid.c head/usr.bin/usbhidctl/usbhidctl.1 Modified: head/lib/libusbhid/data.c ============================================================================== --- head/lib/libusbhid/data.c Wed Sep 28 14:51:28 2011 (r225838) +++ head/lib/libusbhid/data.c Wed Sep 28 14:52:25 2011 (r225839) @@ -32,7 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "usbhid.h" +#include "usbvar.h" int32_t hid_get_data(const void *p, const hid_item_t *h) @@ -114,3 +117,27 @@ hid_set_data(void *p, const hid_item_t * buf[offs + i] = (buf[offs + i] & (mask >> (i*8))) | ((data >> (i*8)) & 0xff); } + +int +hid_get_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size) +{ + struct usb_gen_descriptor ugd; + + memset(&ugd, 0, sizeof(ugd)); + ugd.ugd_data = hid_pass_ptr(data); + ugd.ugd_maxlen = size; + ugd.ugd_report_type = k + 1; + return (ioctl(fd, USB_GET_REPORT, &ugd)); +} + +int +hid_set_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size) +{ + struct usb_gen_descriptor ugd; + + memset(&ugd, 0, sizeof(ugd)); + ugd.ugd_data = hid_pass_ptr(data); + ugd.ugd_maxlen = size; + ugd.ugd_report_type = k + 1; + return (ioctl(fd, USB_SET_REPORT, &ugd)); +} Modified: head/lib/libusbhid/parse.c ============================================================================== --- head/lib/libusbhid/parse.c Wed Sep 28 14:51:28 2011 (r225838) +++ head/lib/libusbhid/parse.c Wed Sep 28 14:52:25 2011 (r225839) @@ -43,10 +43,11 @@ __FBSDID("$FreeBSD$"); #define MAXUSAGE 100 #define MAXPUSH 4 #define MAXID 64 +#define ITEMTYPES 3 struct hid_pos_data { int32_t rid; - uint32_t pos; + uint32_t pos[ITEMTYPES]; }; struct hid_data { @@ -55,6 +56,7 @@ struct hid_data { const uint8_t *p; struct hid_item cur[MAXPUSH]; struct hid_pos_data last_pos[MAXID]; + uint32_t pos[ITEMTYPES]; int32_t usages_min[MAXUSAGE]; int32_t usages_max[MAXUSAGE]; int32_t usage_last; /* last seen usage */ @@ -92,7 +94,7 @@ hid_clear_local(hid_item_t *c) static void hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) { - uint8_t i; + uint8_t i, j; /* check for same report ID - optimise */ @@ -113,7 +115,8 @@ hid_switch_rid(struct hid_data *s, struc } if (i != MAXID) { s->last_pos[i].rid = c->report_ID; - s->last_pos[i].pos = c->pos; + for (j = 0; j < ITEMTYPES; j++) + s->last_pos[i].pos[j] = s->pos[j]; } /* store next report ID */ @@ -134,9 +137,12 @@ hid_switch_rid(struct hid_data *s, struc } if (i != MAXID) { s->last_pos[i].rid = next_rID; - c->pos = s->last_pos[i].pos; - } else - c->pos = 0; /* Out of RID entries. */ + for (j = 0; j < ITEMTYPES; j++) + s->pos[j] = s->last_pos[i].pos[j]; + } else { + for (j = 0; j < ITEMTYPES; j++) + s->pos[j] = 0; /* Out of RID entries. */ + } } /*------------------------------------------------------------------------* @@ -206,7 +212,6 @@ hid_get_item(hid_data_t s, hid_item_t *h { hid_item_t *c; unsigned int bTag, bType, bSize; - uint32_t oldpos; int32_t mask; int32_t dval; @@ -240,7 +245,8 @@ hid_get_item(hid_data_t s, hid_item_t *h */ if (s->kindset & (1 << c->kind)) { *h = *c; - c->pos += c->report_size * c->report_count; + h->pos = s->pos[c->kind]; + s->pos[c->kind] += c->report_size * c->report_count; return (1); } } @@ -406,14 +412,10 @@ hid_get_item(hid_data_t s, hid_item_t *h case 11: /* Pop */ s->pushlevel --; if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->pos; c = &s->cur[s->pushlevel]; /* restore size and count */ s->loc_size = c->report_size; s->loc_count = c->report_count; - /* set default item location */ - c->pos = oldpos; c->report_size = 0; c->report_count = 0; } Modified: head/lib/libusbhid/usbhid.3 ============================================================================== --- head/lib/libusbhid/usbhid.3 Wed Sep 28 14:51:28 2011 (r225838) +++ head/lib/libusbhid/usbhid.3 Wed Sep 28 14:52:25 2011 (r225839) @@ -44,7 +44,9 @@ .Nm hid_usage_in_page , .Nm hid_init , .Nm hid_get_data , -.Nm hid_set_data +.Nm hid_set_data , +.Nm hid_get_report , +.Nm hid_set_report .Nd USB HID access routines .Sh LIBRARY .Lb libusbhid @@ -84,6 +86,10 @@ .Fn hid_get_data "const void *data" "const hid_item_t *h" .Ft void .Fn hid_set_data "void *buf" "const hid_item_t *h" "int data" +.Ft int +.Fn hid_get_report "int fd" "enum hid_kind k" "unsigned char *data" "unsigned int size" +.Ft int +.Fn hid_set_report "int fd" "enum hid_kind k" "unsigned char *data" "unsigned int size" .Sh DESCRIPTION The .Nm @@ -105,6 +111,14 @@ Synchronous HID operation can be enabled If the second argument is zero synchronous HID operation is disabled. Else synchronous HID operation is enabled. The function returns a negative value on failure. +.Pp +.Fn hid_get_report +and +.Fn hid_set_report +functions allow to synchronously get and set specific report if device +supports it. +For devices with multiple report IDs, wanted ID should be provided in the +first byte of the buffer for both get and set. .Ss Descriptor Functions The report descriptor ID can be obtained by calling .Fn hid_get_report_id . Modified: head/lib/libusbhid/usbhid.h ============================================================================== --- head/lib/libusbhid/usbhid.h Wed Sep 28 14:51:28 2011 (r225838) +++ head/lib/libusbhid/usbhid.h Wed Sep 28 14:52:25 2011 (r225839) @@ -76,6 +76,7 @@ typedef struct hid_item { #define HID_PAGE(u) (((u) >> 16) & 0xffff) #define HID_USAGE(u) ((u) & 0xffff) +#define HID_HAS_GET_SET_REPORT 1 __BEGIN_DECLS @@ -104,5 +105,9 @@ int hid_parse_usage_page(const char *nam /* Extracting/insertion of data, data.c: */ int32_t hid_get_data(const void *p, const hid_item_t *h); void hid_set_data(void *p, const hid_item_t *h, int32_t data); +int hid_get_report(int fd, enum hid_kind k, + unsigned char *data, unsigned int size); +int hid_set_report(int fd, enum hid_kind k, + unsigned char *data, unsigned int size); __END_DECLS Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Wed Sep 28 14:51:28 2011 (r225838) +++ head/sys/dev/usb/input/uhid.c Wed Sep 28 14:52:25 2011 (r225839) @@ -566,8 +566,10 @@ uhid_ioctl(struct usb_fifo *fifo, u_long default: return (EINVAL); } + if (id != 0) + copyin(ugd->ugd_data, &id, 1); error = uhid_get_report(sc, ugd->ugd_report_type, id, - NULL, ugd->ugd_data, size); + NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); break; case USB_SET_REPORT: @@ -592,8 +594,10 @@ uhid_ioctl(struct usb_fifo *fifo, u_long default: return (EINVAL); } + if (id != 0) + copyin(ugd->ugd_data, &id, 1); error = uhid_set_report(sc, ugd->ugd_report_type, id, - NULL, ugd->ugd_data, size); + NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); break; case USB_GET_REPORT_ID: Modified: head/usr.bin/usbhidaction/usbhidaction.1 ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.1 Wed Sep 28 14:51:28 2011 (r225838) +++ head/usr.bin/usbhidaction/usbhidaction.1 Wed Sep 28 14:52:25 2011 (r225839) @@ -99,8 +99,7 @@ a debounce value, and an action. There must be whitespace between the parts. .Pp The item names are similar to those used by -.Xr usbhidctl 1 , -but each part must be prefixed by its page name. +.Xr usbhidctl 1 . .Pp The value is simply a numeric value. When the item reports this value, Modified: head/usr.bin/usbhidaction/usbhidaction.c ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.c Wed Sep 28 14:51:28 2011 (r225838) +++ head/usr.bin/usbhidaction/usbhidaction.c Wed Sep 28 14:52:25 2011 (r225839) @@ -280,12 +280,11 @@ parse_conf(const char *conf, report_desc char *p; int line; char buf[SIZE], name[SIZE], value[SIZE], debounce[SIZE], action[SIZE]; - char usbuf[SIZE], coll[SIZE]; + char usbuf[SIZE], coll[SIZE], *tmp; struct command *cmd, *cmds; struct hid_data *d; struct hid_item h; - int u, lo, hi, range; - + int inst, cinst, u, lo, hi, range, t; f = fopen(conf, "r"); if (f == NULL) @@ -317,6 +316,12 @@ parse_conf(const char *conf, report_desc ", syntax error: %s", conf, line, buf); } } + tmp = strchr(name, '#'); + if (tmp != NULL) { + *tmp = 0; + inst = atoi(tmp + 1); + } else + inst = 0; cmd = malloc(sizeof *cmd); if (cmd == NULL) @@ -361,6 +366,7 @@ parse_conf(const char *conf, report_desc } coll[0] = 0; + cinst = 0; for (d = hid_start_parse(repd, 1 << hid_input, reportid); hid_get_item(d, &h); ) { if (verbose > 2) @@ -380,24 +386,29 @@ parse_conf(const char *conf, report_desc range = 0; } for (u = lo; u <= hi; u++) { - snprintf(usbuf, sizeof usbuf, "%s:%s", - hid_usage_page(HID_PAGE(u)), - hid_usage_in_page(u)); - if (verbose > 2) - printf("usage %s\n", usbuf); - if (!strcasecmp(usbuf, name)) - goto foundhid; if (coll[0]) { snprintf(usbuf, sizeof usbuf, "%s.%s:%s", coll+1, - hid_usage_page(HID_PAGE(u)), + hid_usage_page(HID_PAGE(u)), + hid_usage_in_page(u)); + } else { + snprintf(usbuf, sizeof usbuf, + "%s:%s", + hid_usage_page(HID_PAGE(u)), hid_usage_in_page(u)); - if (verbose > 2) - printf("usage %s\n", - usbuf); - if (!strcasecmp(usbuf, name)) - goto foundhid; } + if (verbose > 2) + printf("usage %s\n", usbuf); + t = strlen(usbuf) - strlen(name); + if (t > 0) { + if (strcmp(usbuf + t, name)) + continue; + if (usbuf[t - 1] != '.') + continue; + } else if (strcmp(usbuf, name)) + continue; + if (inst == cinst++) + goto foundhid; } break; case hid_collection: Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Wed Sep 28 14:51:28 2011 (r225838) +++ head/usr.bin/usbhidctl/usbhid.c Wed Sep 28 14:52:25 2011 (r225839) @@ -42,45 +42,141 @@ #include #include +struct variable { + char *name; + int instance; + int val; + struct hid_item h; + struct variable *next; +} *vars; + int verbose = 0; -int all = 0; int noname = 0; int hexdump = 0; +int wflag = 0; +int zflag = 0; -char **names; -int nnames; - -void prbits(int bits, char **strs, int n); -void usage(void); -void dumpitem(const char *label, struct hid_item *h); -void dumpitems(report_desc_t r); -void rev(struct hid_item **p); -void prdata(u_char *buf, struct hid_item *h); -void dumpdata(int f, report_desc_t r, int loop); -int gotname(char *n); +static void usage(void); +static void dumpitem(const char *label, struct hid_item *h); +static void dumpitems(report_desc_t r); +static void prdata(u_char *buf, struct hid_item *h); +static void dumpdata(int f, report_desc_t r, int loop); +static void writedata(int f, report_desc_t r); -int -gotname(char *n) +static void +parceargs(report_desc_t r, int all, int nnames, char **names) { - int i; - - for (i = 0; i < nnames; i++) - if (strcmp(names[i], n) == 0) - return 1; - return 0; -} - -void -prbits(int bits, char **strs, int n) -{ - int i; - - for(i = 0; i < n; i++, bits >>= 1) - if (strs[i*2]) - printf("%s%s", i == 0 ? "" : ", ", strs[i*2 + (bits&1)]); + struct hid_data *d; + struct hid_item h; + char colls[1000]; + char hname[1000], *tmp1, *tmp2; + struct variable *var, **pnext; + int i, instance, cp, t; + + pnext = &vars; + if (all) { + if (wflag) + errx(1, "Must not specify -w to read variables"); + cp = 0; + for (d = hid_start_parse(r, + 1<name, "%s%s%s:%s", + colls, colls[0] != 0 ? "." : "", + hid_usage_page(HID_PAGE(h.usage)), + hid_usage_in_page(h.usage)); + var->h = h; + *pnext = var; + pnext = &var->next; + } + hid_end_parse(d); + return; + } + for (i = 0; i < nnames; i++) { + var = malloc(sizeof(*var)); + memset(var, 0, sizeof(*var)); + tmp1 = tmp2 = strdup(names[i]); + strsep(&tmp2, "="); + var->name = strsep(&tmp1, "#"); + if (tmp1 != NULL) + var->instance = atoi(tmp1); + if (tmp2 != NULL) { + if (!wflag) + errx(1, "Must specify -w to write variables"); + var->val = atoi(tmp2); + } else + if (wflag) + errx(1, "Must not specify -w to read variables"); + *pnext = var; + pnext = &var->next; + + instance = 0; + cp = 0; + for (d = hid_start_parse(r, + 1<name); + if (t > 0) { + if (strcmp(hname + t, var->name) != 0) + continue; + if (hname[t - 1] != '.') + continue; + } else if (strcmp(hname, var->name) != 0) + continue; + if (var->instance != instance++) + continue; + var->h = h; + break; + } + hid_end_parse(d); + if (var->h.usage == 0) + errx(1, "Unknown item '%s'", var->name); + } } -void +static void usage(void) { @@ -92,10 +188,14 @@ usage(void) " %s -f device " "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", getprogname()); + fprintf(stderr, + " %s -f device " + "[-t tablefile] [-v] [-z] -w name=value\n", + getprogname()); exit(1); } -void +static void dumpitem(const char *label, struct hid_item *h) { if ((h->flags & HIO_CONST) && !verbose) @@ -134,7 +234,7 @@ hid_collection_type(int32_t type) return (num); } -void +static void dumpitems(report_desc_t r) { struct hid_data *d; @@ -174,23 +274,7 @@ dumpitems(report_desc_t r) printf("Total feature size %d bytes\n", size); } -void -rev(struct hid_item **p) -{ - struct hid_item *cur, *prev, *next; - - prev = 0; - cur = *p; - while(cur != 0) { - next = cur->next; - cur->next = prev; - prev = cur; - cur = next; - } - *p = prev; -} - -void +static void prdata(u_char *buf, struct hid_item *h) { u_int data; @@ -212,82 +296,162 @@ prdata(u_char *buf, struct hid_item *h) h->pos = pos; } -void +static void dumpdata(int f, report_desc_t rd, int loop) { - struct hid_data *d; - struct hid_item h, *hids, *n; - int r, dlen; + struct variable *var; + int dlen, havedata, i, match, r, rid, use_rid; u_char *dbuf; - u_int32_t colls[100]; - int sp = 0; - char namebuf[10000], *namep; - - hids = 0; - for (d = hid_start_parse(rd, 1<= 256) { + rid = 0; + kind++; + } + if (kind >= 3) + rid = -1; + for (var = vars; var; var = var->next) { + if (rid == var->h.report_ID && + kind == var->h.kind) + break; + } + if (var == NULL) + continue; + } + dlen = hid_report_size(rd, kind < 3 ? kind : hid_input, rid); + if (dlen <= 0) continue; - h.next = hids; - h.collection = colls[sp]; - hids = malloc(sizeof *hids); - *hids = h; - } - hid_end_parse(d); - rev(&hids); - dlen = hid_report_size(rd, hid_input, -1); - dbuf = malloc(dlen); - if (!loop) - if (hid_set_immed(f, 1) < 0) { - if (errno == EOPNOTSUPP) - warnx("device does not support immediate mode, only changes reported."); - else - err(1, "USB_SET_IMMED"); + dbuf = malloc(dlen); + memset(dbuf, 0, dlen); + if (kind < 3) { + dbuf[0] = rid; + r = hid_get_report(f, kind, dbuf, dlen); + if (r < 0) + warn("hid_get_report(rid %d)", rid); + havedata = !r && (rid == 0 || dbuf[0] == rid); + if (rid != 0) + dbuf[0] = rid; + } else { + r = read(f, dbuf, dlen); + if (r < 1) + err(1, "read error"); + havedata = 1; } - do { - r = read(f, dbuf, dlen); - if (r < 1) { - err(1, "read error"); + if (verbose) { + printf("Got %s report %d (%d bytes):", + kind == hid_output ? "output" : + kind == hid_feature ? "feature" : "input", + use_rid ? dbuf[0] : 0, dlen); + if (havedata) { + for (i = 0; i < dlen; i++) + printf(" %02x", dbuf[i]); + } + printf("\n"); } - for (n = hids; n; n = n->next) { - if (n->report_ID != 0 && dbuf[0] != n->report_ID) + match = 0; + for (var = vars; var; var = var->next) { + if ((kind < 3 ? kind : hid_input) != var->h.kind) continue; - namep = namebuf; - namep += sprintf(namep, "%s:%s.", - hid_usage_page(HID_PAGE(n->collection)), - hid_usage_in_page(n->collection)); - namep += sprintf(namep, "%s:%s", - hid_usage_page(HID_PAGE(n->usage)), - hid_usage_in_page(n->usage)); - if (all || gotname(namebuf)) { - if (!noname) - printf("%s=", namebuf); - prdata(dbuf, n); + if (var->h.report_ID != 0 && + dbuf[0] != var->h.report_ID) + continue; + match = 1; + if (!noname) + printf("%s=", var->name); + if (havedata) + prdata(dbuf, &var->h); + printf("\n"); + } + if (match) + printf("\n"); + free(dbuf); + } while (loop || kind < 3); +} + +static void +writedata(int f, report_desc_t rd) +{ + struct variable *var; + int dlen, i, r, rid; + u_char *dbuf; + enum hid_kind kind; + + kind = 0; + rid = 0; + for (kind = 0; kind < 3; kind ++) { + for (rid = 0; rid < 256; rid ++) { + for (var = vars; var; var = var->next) { + if (rid == var->h.report_ID && kind == var->h.kind) + break; + } + if (var == NULL) + continue; + dlen = hid_report_size(rd, kind, rid); + if (dlen <= 0) + continue; + dbuf = malloc(dlen); + memset(dbuf, 0, dlen); + dbuf[0] = rid; + if (!zflag && hid_get_report(f, kind, dbuf, dlen) == 0) { + if (verbose) { + printf("Got %s report %d (%d bytes):", + kind == hid_input ? "input" : + kind == hid_output ? "output" : "feature", + rid, dlen); + for (i = 0; i < dlen; i++) + printf(" %02x", dbuf[i]); printf("\n"); } + } else if (!zflag) { + warn("hid_get_report(rid %d)", rid); + if (verbose) { + printf("Can't get %s report %d (%d bytes). " + "Will be initialized with zeros.\n", + kind == hid_input ? "input" : + kind == hid_output ? "output" : "feature", + rid, dlen); + } } - if (loop) + for (var = vars; var; var = var->next) { + if (rid != var->h.report_ID || kind != var->h.kind) + continue; + hid_set_data(dbuf, &var->h, var->val); + } + if (verbose) { + printf("Setting %s report %d (%d bytes):", + kind == hid_output ? "output" : + kind == hid_feature ? "feature" : "input", + rid, dlen); + for (i = 0; i < dlen; i++) + printf(" %02x", dbuf[i]); printf("\n"); - } while (loop); - free(dbuf); + } + r = hid_set_report(f, kind, dbuf, dlen); + if (r != 0) + warn("hid_set_report(rid %d)", rid); + free(dbuf); + } + } } int main(int argc, char **argv) { - int f; report_desc_t r; - char devnam[100], *dev = 0; + char *table = 0; + char devnam[100], *dev = NULL; + int f; + int all = 0; int ch; int repdump = 0; int loop = 0; - char *table = 0; - while ((ch = getopt(argc, argv, "af:lnrt:vx")) != -1) { + while ((ch = getopt(argc, argv, "af:lnrt:vwxz")) != -1) { switch(ch) { case 'a': all++; @@ -310,9 +474,15 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'w': + wflag = 1; + break; case 'x': hexdump = 1; break; + case 'z': + zflag = 1; + break; case '?': default: usage(); @@ -320,12 +490,10 @@ main(int argc, char **argv) } argc -= optind; argv += optind; - if (dev == 0) + if (dev == NULL) usage(); - names = argv; - nnames = argc; - if (nnames == 0 && !all && !repdump) + if (argc == 0 && !all && !repdump) usage(); if (dev[0] != '/') { @@ -350,8 +518,13 @@ main(int argc, char **argv) printf("Report descriptor:\n"); dumpitems(r); } - if (nnames != 0 || all) - dumpdata(f, r, loop); + if (argc != 0 || all) { + parceargs(r, all, argc, argv); + if (wflag) + writedata(f, r); + else + dumpdata(f, r, loop); + } hid_dispose_report_desc(r); exit(0); Modified: head/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- head/usr.bin/usbhidctl/usbhidctl.1 Wed Sep 28 14:51:28 2011 (r225838) +++ head/usr.bin/usbhidctl/usbhidctl.1 Wed Sep 28 14:52:25 2011 (r225839) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 23, 2006 +.Dd August 01, 2011 .Dt USBHIDCTL 1 .Os .Sh NAME @@ -36,27 +36,51 @@ .Nd manipulate USB HID devices .Sh SYNOPSIS .Nm -.Op Fl a .Fl f Ar device +.Op Fl t Ar table +.Op Fl v +.Op Fl x +.Fl r +.Nm +.Fl f Ar device +.Op Fl t Ar table .Op Fl l -.Op Fl n -.Op Fl r +.Op Fl v +.Op Fl x +.Fl a +.Nm +.Fl f Ar device .Op Fl t Ar table +.Op Fl l +.Op Fl n .Op Fl v .Op Fl x -.Op Ar item ... +.Ar item ... +.Nm +.Fl f Ar device +.Op Fl t Ar table +.Op Fl v +.Op Fl z +.Fl w +.Ar item=value ... .Sh DESCRIPTION The .Nm -utility can be used to dump the state of a USB HID (Human Interface Device). +utility can be used to dump and modify the state of a USB HID (Human +Interface Device). Each named .Ar item is printed. +If the +.Fl w +flag is specified +.Nm +attempts to set the specified items to the given values. .Pp The options are as follows: .Bl -tag -width Ds .It Fl a -Show all items. +Show all items and their current values if device returns. .It Fl f Ar device Specify a path name for the device to operate on. .It Fl l @@ -69,9 +93,47 @@ Dump the report descriptor. Specify a path name for the HID usage table file. .It Fl v Be verbose. +.It Fl w +Change item values. +Only 'output' and 'feature' kinds can be set with this option. .It Fl x Dump data in hexadecimal as well as decimal. +.It Fl z +Reset reports to zero before processing +.Fl w +arguments. If not specified, current values will be requested from device. .El +.Sh SYNTAX +.Nm +compares the names of items specified on the command line against the human +interface items reported by the USB device. +Each human interface item is mapped from its native form to a human readable +name, using the HID usage table file. +Command line items are compared with the generated item names, +and the USB HID device is operated on when a match is found. +.Pp +Each human interface item is named by the +.Qq page +it appears in, the +.Qq usage +within that page, and the list of +.Qq collections +containing the item. +Each collection in turn is also identified by page, and +the usage within that page. +.Pp +On the +.Nm +command line the page name is separated from the usage name with the character +.Sq Cm \&: . +The collections are separated by the character +.Sq Cm \&. . +.Pp +Some devices give the same name to more than one item. +.Nm +supports isolating each item by appending a +.Sq Cm \&# . +character and a decimal item instance number, starting at zero. .Sh FILES .Pa /usr/share/misc/usb_hid_usages The default HID usage table. @@ -84,7 +146,3 @@ The .Nm command appeared in .Nx 1.4 . -.Sh BUGS -The -.Nm -utility cannot show nor set output and feature items. From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 14:57:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2364F106566C; Wed, 28 Sep 2011 14:57:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11DF78FC14; Wed, 28 Sep 2011 14:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SEvoHl078167; Wed, 28 Sep 2011 14:57:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SEvomI078163; Wed, 28 Sep 2011 14:57:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109281457.p8SEvomI078163@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Sep 2011 14:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225840 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 14:57:51 -0000 Author: kib Date: Wed Sep 28 14:57:50 2011 New Revision: 225840 URL: http://svn.freebsd.org/changeset/base/225840 Log: Use the trick of performing the atomic operation on the contained aligned word to handle the dirty mask updates in vm_page_clear_dirty_mask(). Remove the vm page queue lock around vm_page_dirty() call in vm_fault_hold() the sole purpose of which was to protect dirty on architectures which does not provide short or byte-wide atomics. Reviewed by: alc, attilio Tested by: flo (sparc64) MFC after: 2 weeks Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Sep 28 14:52:25 2011 (r225839) +++ head/sys/vm/vm_fault.c Wed Sep 28 14:57:50 2011 (r225840) @@ -1090,18 +1090,10 @@ vm_fault_quick_hold_pages(vm_map_t map, * performed through an unmanaged mapping or by a DMA * operation. * - * The object lock is not held here. Therefore, like - * a pmap operation, the page queues lock may be - * required in order to call vm_page_dirty(). See - * vm_page_clear_dirty_mask(). + * The object lock is not held here. + * See vm_page_clear_dirty_mask(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) vm_page_dirty(*mp); -#else - vm_page_lock_queues(); - vm_page_dirty(*mp); - vm_page_unlock_queues(); -#endif } } if (pmap_failed) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Sep 28 14:52:25 2011 (r225839) +++ head/sys/vm/vm_page.c Wed Sep 28 14:57:50 2011 (r225840) @@ -745,9 +745,9 @@ vm_page_sleep(vm_page_t m, const char *m * * Set all bits in the page's dirty field. * - * The object containing the specified page must be locked if the call is - * made from the machine-independent layer. If, however, the call is - * made from the pmap layer, then the page queues lock may be required. + * The object containing the specified page must be locked if the + * call is made from the machine-independent layer. + * * See vm_page_clear_dirty_mask(). */ void @@ -2339,44 +2339,53 @@ vm_page_set_valid(vm_page_t m, int base, static __inline void vm_page_clear_dirty_mask(vm_page_t m, int pagebits) { + uintptr_t addr; +#if PAGE_SIZE < 16384 + int shift; +#endif /* * If the object is locked and the page is neither VPO_BUSY nor * PGA_WRITEABLE, then the page's dirty field cannot possibly be - * set by a concurrent pmap operation. + * set by a concurrent pmap operation. + * */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) m->dirty &= ~pagebits; else { -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) /* - * On the aforementioned architectures, the page queues lock - * is not required by the following read-modify-write - * operation. The combination of the object's lock and an - * atomic operation suffice. Moreover, the pmap layer on - * these architectures can call vm_page_dirty() without - * holding the page queues lock. + * The pmap layer can call vm_page_dirty() without + * holding a distinguished lock. The combination of + * the object's lock and an atomic operation suffice + * to guarantee consistency of the page dirty field. + * + * For PAGE_SIZE == 32768 case, compiler already + * properly aligns the dirty field, so no forcible + * alignment is needed. Only require existence of + * atomic_clear_64 when page size if 32768. */ -#if PAGE_SIZE == 4096 - atomic_clear_char(&m->dirty, pagebits); -#elif PAGE_SIZE == 8192 - atomic_clear_short(&m->dirty, pagebits); + addr = (uintptr_t)&m->dirty; +#if PAGE_SIZE == 32768 +#error pagebits too short + atomic_clear_64((uint64_t *)addr, pagebits); #elif PAGE_SIZE == 16384 - atomic_clear_int(&m->dirty, pagebits); -#else -#error "PAGE_SIZE is not supported." -#endif -#else + atomic_clear_32((uint32_t *)addr, pagebits); +#else /* PAGE_SIZE <= 8192 */ /* - * Otherwise, the page queues lock is required to ensure that - * a concurrent pmap operation does not set the page's dirty - * field during the following read-modify-write operation. + * Use a trick to perform an 32bit atomic on the + * contained aligned word, to not depend on existence + * of the atomic_clear_{8, 16}. */ - vm_page_lock_queues(); - m->dirty &= ~pagebits; - vm_page_unlock_queues(); + shift = addr & (sizeof(uint32_t) - 1); +#if BYTE_ORDER == BIG_ENDIAN + shift = (sizeof(uint32_t) - sizeof(m->dirty) - shift) * NBBY; +#else + shift *= NBBY; #endif + addr &= ~(sizeof(uint32_t) - 1); + atomic_clear_32((uint32_t *)addr, pagebits << shift); +#endif /* PAGE_SIZE */ } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Sep 28 14:52:25 2011 (r225839) +++ head/sys/vm/vm_page.h Wed Sep 28 14:57:50 2011 (r225840) @@ -94,21 +94,21 @@ * object that the page belongs to (O), the pool lock for the page (P), * or the lock for either the free or paging queues (Q). If a field is * annotated below with two of these locks, then holding either lock is - * sufficient for read access, but both locks are required for write + * sufficient for read access, but both locks are required for write * access. * - * In contrast, the synchronization of accesses to the page's dirty field - * is machine dependent (M). In the machine-independent layer, the lock - * on the object that the page belongs to must be held in order to - * operate on the field. However, the pmap layer is permitted to set - * all bits within the field without holding that lock. Therefore, if - * the underlying architecture does not support atomic read-modify-write - * operations on the field's type, then the machine-independent layer - * must also hold the page queues lock when performing read-modify-write - * operations and the pmap layer must hold the page queues lock when - * setting the field. In the machine-independent layer, the - * implementation of read-modify-write operations on the field is - * encapsulated in vm_page_clear_dirty_mask(). + * In contrast, the synchronization of accesses to the page's + * dirty field is machine dependent (M). In the + * machine-independent layer, the lock on the object that the + * page belongs to must be held in order to operate on the field. + * However, the pmap layer is permitted to set all bits within + * the field without holding that lock. If the underlying + * architecture does not support atomic read-modify-write + * operations on the field's type, then the machine-independent + * layer uses 32bit atomic on the aligned 32bit word that + * contains the dirty field. In the machine-independent layer, + * the implementation of read-modify-write operations on the + * field is encapsulated in vm_page_clear_dirty_mask(). */ TAILQ_HEAD(pglist, vm_page); From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 15:01:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56FCD1065679; Wed, 28 Sep 2011 15:01:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C40C8FC19; Wed, 28 Sep 2011 15:01:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SF1LZv078335; Wed, 28 Sep 2011 15:01:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SF1LEL078331; Wed, 28 Sep 2011 15:01:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109281501.p8SF1LEL078331@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Sep 2011 15:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225841 - in head/sys: ia64/ia64 powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 15:01:21 -0000 Author: kib Date: Wed Sep 28 15:01:20 2011 New Revision: 225841 URL: http://svn.freebsd.org/changeset/base/225841 Log: Remove locking of the vm page queues from several pmaps, which only protected the dirty mask updates. The dirty mask updates are handled by atomics after the r225840. Submitted by: alc Tested by: flo (sparc64) MFC after: 2 weeks Modified: head/sys/ia64/ia64/pmap.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Wed Sep 28 14:57:50 2011 (r225840) +++ head/sys/ia64/ia64/pmap.c Wed Sep 28 15:01:20 2011 (r225841) @@ -1486,7 +1486,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if ((sva & PAGE_MASK) || (eva & PAGE_MASK)) panic("pmap_protect: unaligned addresses"); - vm_page_lock_queues(); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); for ( ; sva < eva; sva += PAGE_SIZE) { @@ -1514,7 +1513,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pmap_pte_prot(pmap, pte, prot); pmap_invalidate_page(sva); } - vm_page_unlock_queues(); pmap_switch(oldpmap); PMAP_UNLOCK(pmap); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Sep 28 14:57:50 2011 (r225840) +++ head/sys/powerpc/booke/pmap.c Wed Sep 28 15:01:20 2011 (r225841) @@ -1918,7 +1918,6 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap if (prot & VM_PROT_WRITE) return; - vm_page_lock_queues(); PMAP_LOCK(pmap); for (va = sva; va < eva; va += PAGE_SIZE) { if ((pte = pte_find(mmu, pmap, va)) != NULL) { @@ -1941,7 +1940,6 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap } } PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); } /* Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Wed Sep 28 14:57:50 2011 (r225840) +++ head/sys/sparc64/sparc64/pmap.c Wed Sep 28 15:01:20 2011 (r225841) @@ -1423,6 +1423,7 @@ pmap_protect_tte(struct pmap *pm, struct u_long data; vm_page_t m; + PMAP_LOCK_ASSERT(pm, MA_OWNED); data = atomic_clear_long(&tp->tte_data, TD_SW | TD_W); if ((data & (TD_PV | TD_W)) == (TD_PV | TD_W)) { m = PHYS_TO_VM_PAGE(TD_PA(data)); @@ -1451,7 +1452,6 @@ pmap_protect(pmap_t pm, vm_offset_t sva, if (prot & VM_PROT_WRITE) return; - vm_page_lock_queues(); PMAP_LOCK(pm); if (eva - sva > PMAP_TSB_THRESH) { tsb_foreach(pm, NULL, sva, eva, pmap_protect_tte); @@ -1463,7 +1463,6 @@ pmap_protect(pmap_t pm, vm_offset_t sva, tlb_range_demap(pm, sva, eva - 1); } PMAP_UNLOCK(pm); - vm_page_unlock_queues(); } /* From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 16:12:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A462D106564A; Wed, 28 Sep 2011 16:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79E958FC0C; Wed, 28 Sep 2011 16:12:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SGCFre080551; Wed, 28 Sep 2011 16:12:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SGCF1f080548; Wed, 28 Sep 2011 16:12:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109281612.p8SGCF1f080548@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Sep 2011 16:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225843 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 16:12:15 -0000 Author: kib Date: Wed Sep 28 16:12:15 2011 New Revision: 225843 URL: http://svn.freebsd.org/changeset/base/225843 Log: Fix grammar. Submitted by: bf MFC after: 2 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Sep 28 15:36:08 2011 (r225842) +++ head/sys/vm/vm_page.c Wed Sep 28 16:12:15 2011 (r225843) @@ -2363,7 +2363,7 @@ vm_page_clear_dirty_mask(vm_page_t m, in * For PAGE_SIZE == 32768 case, compiler already * properly aligns the dirty field, so no forcible * alignment is needed. Only require existence of - * atomic_clear_64 when page size if 32768. + * atomic_clear_64 when page size is 32768. */ addr = (uintptr_t)&m->dirty; #if PAGE_SIZE == 32768 @@ -2373,9 +2373,9 @@ vm_page_clear_dirty_mask(vm_page_t m, in atomic_clear_32((uint32_t *)addr, pagebits); #else /* PAGE_SIZE <= 8192 */ /* - * Use a trick to perform an 32bit atomic on the - * contained aligned word, to not depend on existence - * of the atomic_clear_{8, 16}. + * Use a trick to perform a 32-bit atomic on the + * containing aligned word, to not depend on the existence + * of atomic_clear_{8, 16}. */ shift = addr & (sizeof(uint32_t) - 1); #if BYTE_ORDER == BIG_ENDIAN Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Sep 28 15:36:08 2011 (r225842) +++ head/sys/vm/vm_page.h Wed Sep 28 16:12:15 2011 (r225843) @@ -105,7 +105,7 @@ * the field without holding that lock. If the underlying * architecture does not support atomic read-modify-write * operations on the field's type, then the machine-independent - * layer uses 32bit atomic on the aligned 32bit word that + * layer uses a 32-bit atomic on the aligned 32-bit word that * contains the dirty field. In the machine-independent layer, * the implementation of read-modify-write operations on the * field is encapsulated in vm_page_clear_dirty_mask(). From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 17:03:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC0F410656F0; Wed, 28 Sep 2011 17:03:49 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFADC8FC14; Wed, 28 Sep 2011 17:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SH3n3d082166; Wed, 28 Sep 2011 17:03:49 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SH3n8r082164; Wed, 28 Sep 2011 17:03:49 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201109281703.p8SH3n8r082164@svn.freebsd.org> From: Chris Rees Date: Wed, 28 Sep 2011 17:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225844 - head/usr.bin/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 17:03:50 -0000 Author: crees (ports committer) Date: Wed Sep 28 17:03:49 2011 New Revision: 225844 URL: http://svn.freebsd.org/changeset/base/225844 Log: Include limits.h instead of sys/limits.h to improve portability. PR: bin/150772 Submitted by: Derrick Brashear Reviewed by: Garrett Cooper Approved by: cognet Modified: head/usr.bin/csup/diff.c Modified: head/usr.bin/csup/diff.c ============================================================================== --- head/usr.bin/csup/diff.c Wed Sep 28 16:12:15 2011 (r225843) +++ head/usr.bin/csup/diff.c Wed Sep 28 17:03:49 2011 (r225844) @@ -26,11 +26,10 @@ * $FreeBSD$ */ -#include - #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 18:03:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D81641065673; Wed, 28 Sep 2011 18:03:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79618FC0C; Wed, 28 Sep 2011 18:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SI3rtg084004; Wed, 28 Sep 2011 18:03:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SI3rIe084002; Wed, 28 Sep 2011 18:03:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201109281803.p8SI3rIe084002@svn.freebsd.org> From: Xin LI Date: Wed, 28 Sep 2011 18:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225845 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 18:03:53 -0000 Author: delphij Date: Wed Sep 28 18:03:53 2011 New Revision: 225845 URL: http://svn.freebsd.org/changeset/base/225845 Log: Sync RCS id with NetBSD, this was intentionally omitted from the advisory in order to reduce patchset size. MFC after: 3 days Modified: head/usr.bin/gzip/zuncompress.c Modified: head/usr.bin/gzip/zuncompress.c ============================================================================== --- head/usr.bin/gzip/zuncompress.c Wed Sep 28 17:03:49 2011 (r225844) +++ head/usr.bin/gzip/zuncompress.c Wed Sep 28 18:03:53 2011 (r225845) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */ +/* $NetBSD: zuncompress.c,v 1.11 2011/08/16 13:55:02 joerg Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 18:49:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F6E4106564A; Wed, 28 Sep 2011 18:49:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF298FC22; Wed, 28 Sep 2011 18:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SInbK3085368; Wed, 28 Sep 2011 18:49:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SInbrJ085366; Wed, 28 Sep 2011 18:49:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201109281849.p8SInbrJ085366@svn.freebsd.org> From: Eitan Adler Date: Wed, 28 Sep 2011 18:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225846 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 18:49:37 -0000 Author: eadler (ports committer) Date: Wed Sep 28 18:49:37 2011 New Revision: 225846 URL: http://svn.freebsd.org/changeset/base/225846 Log: - add myself to calendar Approved by: sahil (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 18:03:53 2011 (r225845) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 18:49:37 2011 (r225846) @@ -47,6 +47,7 @@ 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 +02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 18:53:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530FF106566C; Wed, 28 Sep 2011 18:53:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406168FC1E; Wed, 28 Sep 2011 18:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SIrb8j085540; Wed, 28 Sep 2011 18:53:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SIrave085527; Wed, 28 Sep 2011 18:53:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201109281853.p8SIrave085527@svn.freebsd.org> From: Ed Schouten Date: Wed, 28 Sep 2011 18:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225847 - in head: bin/ls bin/ps lib/libc/gen sbin/fsdb usr.bin/find usr.bin/fstat usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 18:53:37 -0000 Author: ed Date: Wed Sep 28 18:53:36 2011 New Revision: 225847 URL: http://svn.freebsd.org/changeset/base/225847 Log: Get rid of major/minor number distinction. As of FreeBSD 6, devices can only be opened through devfs. These device nodes don't have major and minor numbers anymore. The st_rdev field in struct stat is simply based a copy of st_ino. Simply display device numbers as hexadecimal, using "%#jx". This is allowed by POSIX, since it explicitly states things like the following (example taken from ls(1)): "If the file is a character special or block special file, the size of the file may be replaced with implementation-defined information associated with the device in question." This makes the output of these commands more compact. For example, ls(1) now uses approximately four columns less. While there, simplify the column length calculation from ls(1) by calling snprintf() with a NULL buffer. Don't be afraid; if needed one can still obtain individual major/minor numbers using stat(1). Modified: head/bin/ls/ls.1 head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c head/bin/ps/print.c head/lib/libc/gen/devname.c head/sbin/fsdb/fsdbutil.c head/usr.bin/find/find.1 head/usr.bin/find/ls.c head/usr.bin/fstat/fstat.1 head/usr.bin/fstat/fstat.c head/usr.sbin/pstat/pstat.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Sep 28 18:49:37 2011 (r225846) +++ head/bin/ls/ls.1 Wed Sep 28 18:53:36 2011 (r225847) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd September 28, 2011 .Dt LS 1 .Os .Sh NAME @@ -357,8 +357,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 -> . Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/bin/ls/ls.c Wed Sep 28 18:53:36 2011 (r225847) @@ -563,7 +563,7 @@ display(const FTSENT *p, FTSENT *list, i long maxblock; u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; u_long maxlabelstr; - u_int devstrlen; + u_int sizelen; int maxflags; gid_t maxgroup; uid_t maxuser; @@ -572,7 +572,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]; @@ -656,7 +655,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 +796,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,23 +835,16 @@ 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", maxblock); 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, "%lu", 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; } printfcn(&d); Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Wed Sep 28 18:49:37 2011 (r225846) +++ head/bin/ls/ls.h Wed Sep 28 18:53:36 2011 (r225847) @@ -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 */ Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/bin/ls/print.c Wed Sep 28 18:53:36 2011 (r225847) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -351,16 +352,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 Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/bin/ps/print.c Wed Sep 28 18:53:36 2011 (r225847) @@ -392,17 +392,13 @@ tdev(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char buff[16]; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) (void)printf("%*s", v->width, "??"); - else { - (void)snprintf(buff, sizeof(buff), - "%d/%d", major(dev), minor(dev)); - (void)printf("%*s", v->width, buff); - } + else + (void)printf("%#*jx", v->width, (uintmax_t)dev); } void Modified: head/lib/libc/gen/devname.c ============================================================================== --- head/lib/libc/gen/devname.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/lib/libc/gen/devname.c Wed Sep 28 18:53:36 2011 (r225847) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,8 +61,8 @@ devname_r(dev_t dev, mode_t type, char * } /* Finally just format it */ - snprintf(buf, len, "#%c:%d:0x%x", - S_ISCHR(type) ? 'C' : 'B', major(dev), minor(dev)); + snprintf(buf, len, "#%c:%#jx", + S_ISCHR(type) ? 'C' : 'B', (uintmax_t)dev); return (buf); } Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/sbin/fsdb/fsdbutil.c Wed Sep 28 18:53:36 2011 (r225847) @@ -126,12 +126,10 @@ printstat(const char *cp, ino_t inum, un puts("regular file"); break; case IFBLK: - printf("block special (%d,%d)", - major(DIP(dp, di_rdev)), minor(DIP(dp, di_rdev))); + printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev)); break; case IFCHR: - printf("character special (%d,%d)", - major(DIP(dp, di_rdev)), minor(DIP(dp, di_rdev))); + printf("character special (%#jx)", DIP(dp, di_rdev)); break; case IFLNK: fputs("symlink",stdout); Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Wed Sep 28 18:49:37 2011 (r225846) +++ head/usr.bin/find/find.1 Wed Sep 28 18:53:36 2011 (r225847) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd March 17, 2010 +.Dd September 28, 2011 .Dt FIND 1 .Os .Sh NAME @@ -507,7 +507,7 @@ This primary always evaluates to true. The following information for the current file is written to standard output: its inode number, size in 512-byte blocks, file permissions, number of hard links, owner, group, size in bytes, last modification time, and pathname. -If the file is a block or character special file, the major and minor numbers +If the file is a block or character special file, the device number will be displayed instead of the size in bytes. If the file is a symbolic link, the pathname of the linked-to file will be displayed preceded by Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/usr.bin/find/ls.c Wed Sep 28 18:53:36 2011 (r225847) @@ -70,8 +70,7 @@ printlong(char *name, char *accpath, str group_from_gid(sb->st_gid, 0)); if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) - (void)printf("%3d, %3d ", major(sb->st_rdev), - minor(sb->st_rdev)); + (void)printf("%#8jx ", (uintmax_t)sb->st_rdev); else (void)printf("%8"PRId64" ", sb->st_size); printtime(sb->st_mtime); Modified: head/usr.bin/fstat/fstat.1 ============================================================================== --- head/usr.bin/fstat/fstat.1 Wed Sep 28 18:49:37 2011 (r225846) +++ head/usr.bin/fstat/fstat.1 Wed Sep 28 18:53:36 2011 (r225847) @@ -28,7 +28,7 @@ .\" @(#)fstat.1 8.3 (Berkeley) 2/25/94 .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd September 28, 2011 .Dt FSTAT 1 .Os .Sh NAME @@ -142,7 +142,7 @@ pathname that the file system the file r If the .Fl n flag is specified, this header is present and is the -major/minor number of the device that this file resides in. +number of the device that this file resides in. .It Li INUM The inode number of the file. .It Li MODE Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/usr.bin/fstat/fstat.c Wed Sep 28 18:53:36 2011 (r225847) @@ -411,7 +411,7 @@ print_pts_info(struct procstat *procstat } printf("* pseudo-terminal master "); if (nflg || !*pts.devname) { - printf("%10d,%-2d", major(pts.dev), minor(pts.dev)); + printf("%#10jx", (uintmax_t)pts.dev); } else { printf("%10s", pts.devname); } @@ -441,7 +441,7 @@ print_vnode_info(struct procstat *procst } if (nflg) - printf(" %2d,%-2d", major(vn.vn_fsid), minor(vn.vn_fsid)); + printf(" %#8jx", (uintmax_t)vn.vn_fsid); else if (vn.vn_mntdir != NULL) (void)printf(" %-8s", vn.vn_mntdir); @@ -457,7 +457,7 @@ print_vnode_info(struct procstat *procst if (vn.vn_type == PS_FST_VTYPE_VBLK || vn.vn_type == PS_FST_VTYPE_VCHR) { if (nflg || !*vn.vn_devname) - printf(" %2d,%-2d", major(vn.vn_dev), minor(vn.vn_dev)); + printf(" %#6jx", (uintmax_t)vn.vn_dev); else { printf(" %6s", vn.vn_devname); } Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Wed Sep 28 18:49:37 2011 (r225846) +++ head/usr.sbin/pstat/pstat.c Wed Sep 28 18:53:36 2011 (r225847) @@ -345,7 +345,7 @@ ttyprt(struct xtty *xt) errx(1, "struct xtty size mismatch"); if (usenumflag || xt->xt_dev == 0 || (name = devname(xt->xt_dev, S_IFCHR)) == NULL) - printf("%5d,%4d ", major(xt->xt_dev), minor(xt->xt_dev)); + printf("%#10jx ", (uintmax_t)xt->xt_dev); else printf("%10s ", name); printf("%5zu %4zu %4zu %4zu %5zu %4zu %4zu %5u %5d %5d ", From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 18:56:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A841065672; Wed, 28 Sep 2011 18:56:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D893C8FC13; Wed, 28 Sep 2011 18:56:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SIu2U5085651; Wed, 28 Sep 2011 18:56:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SIu2n2085649; Wed, 28 Sep 2011 18:56:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201109281856.p8SIu2n2085649@svn.freebsd.org> From: Eitan Adler Date: Wed, 28 Sep 2011 18:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225848 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 18:56:03 -0000 Author: eadler (ports committer) Date: Wed Sep 28 18:56:02 2011 New Revision: 225848 URL: http://svn.freebsd.org/changeset/base/225848 Log: - add myself to committers-ports.dot Approved by: sahil (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Sep 28 18:53:36 2011 (r225847) +++ head/share/misc/committers-ports.dot Wed Sep 28 18:56:02 2011 (r225848) @@ -78,6 +78,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD. demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] +eadler [label="Eitan Adler\neadler@FreeBSD.org\2011/08/17"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12"] @@ -209,6 +210,7 @@ arved -> stefan asami -> obrien +bapt -> eadler bapt -> jlaffaye beat -> decke @@ -385,6 +387,7 @@ rafan -> chinsan rene -> crees sahil -> culot +sahil -> eadler sat -> beech From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 19:01:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BF97106566C; Wed, 28 Sep 2011 19:01:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0848FC08; Wed, 28 Sep 2011 19:01:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SJ1FCG085848; Wed, 28 Sep 2011 19:01:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SJ1F3D085846; Wed, 28 Sep 2011 19:01:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201109281901.p8SJ1F3D085846@svn.freebsd.org> From: Xin LI Date: Wed, 28 Sep 2011 19:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225849 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 19:01:15 -0000 Author: delphij Date: Wed Sep 28 19:01:15 2011 New Revision: 225849 URL: http://svn.freebsd.org/changeset/base/225849 Log: Test if the interface is afif in dhcpif() and syncdhcpif(), as done in ipv6_autoconfif. Reviewed by: hrs (freebsd-rc@) MFC after: 1 week Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Wed Sep 28 18:56:02 2011 (r225848) +++ head/etc/network.subr Wed Sep 28 19:01:15 2011 (r225849) @@ -297,6 +297,10 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Dd][Hh][Cc][Pp]) @@ -322,6 +326,10 @@ syncdhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 20:42:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C311065673; Wed, 28 Sep 2011 20:42:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62D028FC12; Wed, 28 Sep 2011 20:42:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SKgMXr089116; Wed, 28 Sep 2011 20:42:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SKgMGH089114; Wed, 28 Sep 2011 20:42:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109282042.p8SKgMGH089114@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 28 Sep 2011 20:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225852 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 20:42:22 -0000 Author: des Date: Wed Sep 28 20:42:22 2011 New Revision: 225852 URL: http://svn.freebsd.org/changeset/base/225852 Log: Belatedly regenerate after application of the HPN patch. Modified: head/crypto/openssh/ssh_namespace.h Modified: head/crypto/openssh/ssh_namespace.h ============================================================================== --- head/crypto/openssh/ssh_namespace.h Wed Sep 28 19:38:47 2011 (r225851) +++ head/crypto/openssh/ssh_namespace.h Wed Sep 28 20:42:22 2011 (r225852) @@ -7,7 +7,7 @@ * * A list of symbols which need munging is obtained as follows: * - * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define" $3 "\t\tssh_" $3 }' + * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define " $3 "\t\tssh_" $3 }' * * $FreeBSD$ */ @@ -58,6 +58,7 @@ #define buffer_get_int64 ssh_buffer_get_int64 #define buffer_get_int64_ret ssh_buffer_get_int64_ret #define buffer_get_int_ret ssh_buffer_get_int_ret +#define buffer_get_max_len ssh_buffer_get_max_len #define buffer_get_ret ssh_buffer_get_ret #define buffer_get_short ssh_buffer_get_short #define buffer_get_short_ret ssh_buffer_get_short_ret @@ -139,6 +140,7 @@ #define channel_send_window_changes ssh_channel_send_window_changes #define channel_set_af ssh_channel_set_af #define channel_set_fds ssh_channel_set_fds +#define channel_set_hpn ssh_channel_set_hpn #define channel_setup_local_fwd_listener ssh_channel_setup_local_fwd_listener #define channel_setup_remote_fwd_listener ssh_channel_setup_remote_fwd_listener #define channel_still_open ssh_channel_still_open @@ -438,6 +440,7 @@ #define set_nonblock ssh_set_nonblock #define shadow_pw ssh_shadow_pw #define sigdie ssh_sigdie +#define sock_get_rcvbuf ssh_sock_get_rcvbuf #define sock_set_v6only ssh_sock_set_v6only #define ssh1_3des_iv ssh_ssh1_3des_iv #define start_progress_meter ssh_start_progress_meter From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 20:46:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D86AC1065670; Wed, 28 Sep 2011 20:46:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7928FC1E; Wed, 28 Sep 2011 20:46:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SKkqQ8089296; Wed, 28 Sep 2011 20:46:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SKkqQT089293; Wed, 28 Sep 2011 20:46:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201109282046.p8SKkqQT089293@svn.freebsd.org> From: Eitan Adler Date: Wed, 28 Sep 2011 20:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225853 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 20:46:52 -0000 Author: eadler (ports committer) Date: Wed Sep 28 20:46:52 2011 New Revision: 225853 URL: http://svn.freebsd.org/changeset/base/225853 Log: - fix whitespace issue in calendar - add a n after \ Submitted by: brueffer Approved by: bapt (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Sep 28 20:42:22 2011 (r225852) +++ head/share/misc/committers-ports.dot Wed Sep 28 20:46:52 2011 (r225853) @@ -78,7 +78,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD. demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] -eadler [label="Eitan Adler\neadler@FreeBSD.org\2011/08/17"] +eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12"] Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 20:42:22 2011 (r225852) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 20:46:52 2011 (r225853) @@ -47,7 +47,7 @@ 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 -02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 +02/04 Eitan Adler born in West Hempstead, New York, United States, 199 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 21:01:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 863CC1065675; Wed, 28 Sep 2011 21:01:53 +0000 (UTC) Date: Wed, 28 Sep 2011 21:01:53 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20110928210153.GA86466@freebsd.org> References: <201109281853.p8SIrave085527@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109281853.p8SIrave085527@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225847 - in head: bin/ls bin/ps lib/libc/gen sbin/fsdb usr.bin/find usr.bin/fstat usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 21:01:53 -0000 On Wed Sep 28 11, Ed Schouten wrote: > Author: ed > Date: Wed Sep 28 18:53:36 2011 > New Revision: 225847 > URL: http://svn.freebsd.org/changeset/base/225847 > > Log: > Get rid of major/minor number distinction. > > As of FreeBSD 6, devices can only be opened through devfs. These device > nodes don't have major and minor numbers anymore. The st_rdev field in > struct stat is simply based a copy of st_ino. > > Simply display device numbers as hexadecimal, using "%#jx". This is > allowed by POSIX, since it explicitly states things like the following > (example taken from ls(1)): > > "If the file is a character special or block special file, the > size of the file may be replaced with implementation-defined > information associated with the device in question." > > This makes the output of these commands more compact. For example, ls(1) > now uses approximately four columns less. While there, simplify the > column length calculation from ls(1) by calling snprintf() with a NULL > buffer. very cool. maybe before the release of freebsd 10.0 we could get edward's ps(1) auto-size-column-width patch committed. this shrinks the ps(1) output some more: http://people.freebsd.org/~trasz/ps-9.diff :) cheers. alex > > Don't be afraid; if needed one can still obtain individual major/minor > numbers using stat(1). > > Modified: > head/bin/ls/ls.1 > head/bin/ls/ls.c > head/bin/ls/ls.h > head/bin/ls/print.c > head/bin/ps/print.c > head/lib/libc/gen/devname.c > head/sbin/fsdb/fsdbutil.c > head/usr.bin/find/find.1 > head/usr.bin/find/ls.c > head/usr.bin/fstat/fstat.1 > head/usr.bin/fstat/fstat.c > head/usr.sbin/pstat/pstat.c > > Modified: head/bin/ls/ls.1 > ============================================================================== > --- head/bin/ls/ls.1 Wed Sep 28 18:49:37 2011 (r225846) > +++ head/bin/ls/ls.1 Wed Sep 28 18:53:36 2011 (r225847) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd April 4, 2008 > +.Dd September 28, 2011 > .Dt LS 1 > .Os > .Sh NAME > @@ -357,8 +357,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 -> . > > Modified: head/bin/ls/ls.c > ============================================================================== > --- head/bin/ls/ls.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/bin/ls/ls.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -563,7 +563,7 @@ display(const FTSENT *p, FTSENT *list, i > long maxblock; > u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; > u_long maxlabelstr; > - u_int devstrlen; > + u_int sizelen; > int maxflags; > gid_t maxgroup; > uid_t maxuser; > @@ -572,7 +572,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]; > > @@ -656,7 +655,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 +796,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,23 +835,16 @@ 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", maxblock); > 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, "%lu", 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; > } > printfcn(&d); > > Modified: head/bin/ls/ls.h > ============================================================================== > --- head/bin/ls/ls.h Wed Sep 28 18:49:37 2011 (r225846) > +++ head/bin/ls/ls.h Wed Sep 28 18:53:36 2011 (r225847) > @@ -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 */ > > > Modified: head/bin/ls/print.c > ============================================================================== > --- head/bin/ls/print.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/bin/ls/print.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -351,16 +352,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 > > Modified: head/bin/ps/print.c > ============================================================================== > --- head/bin/ps/print.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/bin/ps/print.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -392,17 +392,13 @@ tdev(KINFO *k, VARENT *ve) > { > VAR *v; > dev_t dev; > - char buff[16]; > > v = ve->var; > dev = k->ki_p->ki_tdev; > if (dev == NODEV) > (void)printf("%*s", v->width, "??"); > - else { > - (void)snprintf(buff, sizeof(buff), > - "%d/%d", major(dev), minor(dev)); > - (void)printf("%*s", v->width, buff); > - } > + else > + (void)printf("%#*jx", v->width, (uintmax_t)dev); > } > > void > > Modified: head/lib/libc/gen/devname.c > ============================================================================== > --- head/lib/libc/gen/devname.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/lib/libc/gen/devname.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > #include > @@ -60,8 +61,8 @@ devname_r(dev_t dev, mode_t type, char * > } > > /* Finally just format it */ > - snprintf(buf, len, "#%c:%d:0x%x", > - S_ISCHR(type) ? 'C' : 'B', major(dev), minor(dev)); > + snprintf(buf, len, "#%c:%#jx", > + S_ISCHR(type) ? 'C' : 'B', (uintmax_t)dev); > return (buf); > } > > > Modified: head/sbin/fsdb/fsdbutil.c > ============================================================================== > --- head/sbin/fsdb/fsdbutil.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/sbin/fsdb/fsdbutil.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -126,12 +126,10 @@ printstat(const char *cp, ino_t inum, un > puts("regular file"); > break; > case IFBLK: > - printf("block special (%d,%d)", > - major(DIP(dp, di_rdev)), minor(DIP(dp, di_rdev))); > + printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev)); > break; > case IFCHR: > - printf("character special (%d,%d)", > - major(DIP(dp, di_rdev)), minor(DIP(dp, di_rdev))); > + printf("character special (%#jx)", DIP(dp, di_rdev)); > break; > case IFLNK: > fputs("symlink",stdout); > > Modified: head/usr.bin/find/find.1 > ============================================================================== > --- head/usr.bin/find/find.1 Wed Sep 28 18:49:37 2011 (r225846) > +++ head/usr.bin/find/find.1 Wed Sep 28 18:53:36 2011 (r225847) > @@ -31,7 +31,7 @@ > .\" @(#)find.1 8.7 (Berkeley) 5/9/95 > .\" $FreeBSD$ > .\" > -.Dd March 17, 2010 > +.Dd September 28, 2011 > .Dt FIND 1 > .Os > .Sh NAME > @@ -507,7 +507,7 @@ This primary always evaluates to true. > The following information for the current file is written to standard output: > its inode number, size in 512-byte blocks, file permissions, number of hard > links, owner, group, size in bytes, last modification time, and pathname. > -If the file is a block or character special file, the major and minor numbers > +If the file is a block or character special file, the device number > will be displayed instead of the size in bytes. > If the file is a symbolic link, the pathname of the linked-to file will be > displayed preceded by > > Modified: head/usr.bin/find/ls.c > ============================================================================== > --- head/usr.bin/find/ls.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/usr.bin/find/ls.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -70,8 +70,7 @@ printlong(char *name, char *accpath, str > group_from_gid(sb->st_gid, 0)); > > if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) > - (void)printf("%3d, %3d ", major(sb->st_rdev), > - minor(sb->st_rdev)); > + (void)printf("%#8jx ", (uintmax_t)sb->st_rdev); > else > (void)printf("%8"PRId64" ", sb->st_size); > printtime(sb->st_mtime); > > Modified: head/usr.bin/fstat/fstat.1 > ============================================================================== > --- head/usr.bin/fstat/fstat.1 Wed Sep 28 18:49:37 2011 (r225846) > +++ head/usr.bin/fstat/fstat.1 Wed Sep 28 18:53:36 2011 (r225847) > @@ -28,7 +28,7 @@ > .\" @(#)fstat.1 8.3 (Berkeley) 2/25/94 > .\" $FreeBSD$ > .\" > -.Dd July 9, 2009 > +.Dd September 28, 2011 > .Dt FSTAT 1 > .Os > .Sh NAME > @@ -142,7 +142,7 @@ pathname that the file system the file r > If the > .Fl n > flag is specified, this header is present and is the > -major/minor number of the device that this file resides in. > +number of the device that this file resides in. > .It Li INUM > The inode number of the file. > .It Li MODE > > Modified: head/usr.bin/fstat/fstat.c > ============================================================================== > --- head/usr.bin/fstat/fstat.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/usr.bin/fstat/fstat.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -411,7 +411,7 @@ print_pts_info(struct procstat *procstat > } > printf("* pseudo-terminal master "); > if (nflg || !*pts.devname) { > - printf("%10d,%-2d", major(pts.dev), minor(pts.dev)); > + printf("%#10jx", (uintmax_t)pts.dev); > } else { > printf("%10s", pts.devname); > } > @@ -441,7 +441,7 @@ print_vnode_info(struct procstat *procst > } > > if (nflg) > - printf(" %2d,%-2d", major(vn.vn_fsid), minor(vn.vn_fsid)); > + printf(" %#8jx", (uintmax_t)vn.vn_fsid); > else if (vn.vn_mntdir != NULL) > (void)printf(" %-8s", vn.vn_mntdir); > > @@ -457,7 +457,7 @@ print_vnode_info(struct procstat *procst > > if (vn.vn_type == PS_FST_VTYPE_VBLK || vn.vn_type == PS_FST_VTYPE_VCHR) { > if (nflg || !*vn.vn_devname) > - printf(" %2d,%-2d", major(vn.vn_dev), minor(vn.vn_dev)); > + printf(" %#6jx", (uintmax_t)vn.vn_dev); > else { > printf(" %6s", vn.vn_devname); > } > > Modified: head/usr.sbin/pstat/pstat.c > ============================================================================== > --- head/usr.sbin/pstat/pstat.c Wed Sep 28 18:49:37 2011 (r225846) > +++ head/usr.sbin/pstat/pstat.c Wed Sep 28 18:53:36 2011 (r225847) > @@ -345,7 +345,7 @@ ttyprt(struct xtty *xt) > errx(1, "struct xtty size mismatch"); > if (usenumflag || xt->xt_dev == 0 || > (name = devname(xt->xt_dev, S_IFCHR)) == NULL) > - printf("%5d,%4d ", major(xt->xt_dev), minor(xt->xt_dev)); > + printf("%#10jx ", (uintmax_t)xt->xt_dev); > else > printf("%10s ", name); > printf("%5zu %4zu %4zu %4zu %5zu %4zu %4zu %5u %5d %5d ", From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 21:42:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A37106566B; Wed, 28 Sep 2011 21:42:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75928FC08; Wed, 28 Sep 2011 21:42:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SLgDoD090943; Wed, 28 Sep 2011 21:42:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SLgDCV090941; Wed, 28 Sep 2011 21:42:13 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201109282142.p8SLgDCV090941@svn.freebsd.org> From: Eitan Adler Date: Wed, 28 Sep 2011 21:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225854 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 21:42:13 -0000 Author: eadler (ports committer) Date: Wed Sep 28 21:42:13 2011 New Revision: 225854 URL: http://svn.freebsd.org/changeset/base/225854 Log: - I am not the oldest committer alive (yet) Approved by: bapt (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 20:46:52 2011 (r225853) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 28 21:42:13 2011 (r225854) @@ -47,7 +47,7 @@ 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 -02/04 Eitan Adler born in West Hempstead, New York, United States, 199 +02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 22:30:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170CE106564A; Wed, 28 Sep 2011 22:30:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C7BD58FC14; Wed, 28 Sep 2011 22:30:10 +0000 (UTC) Received: from 192.168.0.5 (71-213-10-32.slkc.qwest.net [71.213.10.32]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p8SMNkdI006768 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 28 Sep 2011 16:23:48 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 28 Sep 2011 16:23:54 -0600 Message-ID: <1alpfgmia72sqsuh6i7c8its.1317248634803@email.android.com> From: "imp@bsdimp.com" To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 28 Sep 2011 16:23:49 -0600 (MDT) Cc: Subject: Re: svn commit: r225854 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 22:30:11 -0000 U28geW91IGFyZW4ndCBhIHZhbXBpcmU/CgpFaXRhbiBBZGxlciA8ZWFkbGVyQGZyZWVic2Qub3Jn PiB3cm90ZToKCj5BdXRob3I6IGVhZGxlciAocG9ydHMgY29tbWl0dGVyKQo+RGF0ZTogV2VkIFNl cCAyOCAyMTo0MjoxMyAyMDExCj5OZXcgUmV2aXNpb246IDIyNTg1NAo+VVJMOiBodHRwOi8vc3Zu LmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzIyNTg1NAo+Cj5Mb2c6Cj4gIC0gSSBhbSBub3Qg dGhlIG9sZGVzdCBjb21taXR0ZXIgYWxpdmUgKHlldCkKPiAgCj4gIEFwcHJvdmVkIGJ5OgliYXB0 IChtZW50b3IpCj4KPk1vZGlmaWVkOgo+ICBoZWFkL3Vzci5iaW4vY2FsZW5kYXIvY2FsZW5kYXJz L2NhbGVuZGFyLmZyZWVic2QKPgo+TW9kaWZpZWQ6IGhlYWQvdXNyLmJpbi9jYWxlbmRhci9jYWxl bmRhcnMvY2FsZW5kYXIuZnJlZWJzZAo+PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cj4tLS0gaGVhZC91 c3IuYmluL2NhbGVuZGFyL2NhbGVuZGFycy9jYWxlbmRhci5mcmVlYnNkCVdlZCBTZXAgMjggMjA6 NDY6NTIgMjAxMQkocjIyNTg1MykKPisrKyBoZWFkL3Vzci5iaW4vY2FsZW5kYXIvY2FsZW5kYXJz L2NhbGVuZGFyLmZyZWVic2QJV2VkIFNlcCAyOCAyMTo0MjoxMyAyMDExCShyMjI1ODU0KQo+QEAg LTQ3LDcgKzQ3LDcgQEAKPiAwMi8wMglNaWNoYWVsIFcgTHVjYXMgPG13bHVjYXNARnJlZUJTRC5v cmc+IGJvcm4gaW4gRGV0cm9pdCwgTWljaGlnYW4sIFVuaXRlZCBTdGF0ZXMsIDE5NjcKPiAwMi8w MglEbWl0cnkgQ2hhZ2luIDxkY2hhZ2luQEZyZWVCU0Qub3JnPiBib3JuIGluIFN0YWxpbmdyYWQs IFVTU1IsIDE5NzYKPiAwMi8wMglZb2ljaGkgTmFrYXlhbWEgPHlvaWNoaUBGcmVlQlNELm9yZz4g Ym9ybiBpbiBUc3UsIE1pZSwgSmFwYW4sIDE5NzYKPi0wMi8wNAlFaXRhbiBBZGxlciA8ZWFkbGVy QEZyZWVCU0Qub3JnPiBib3JuIGluIFdlc3QgSGVtcHN0ZWFkLCBOZXcgWW9yaywgVW5pdGVkIFN0 YXRlcywgMTk5Cj4rMDIvMDQJRWl0YW4gQWRsZXIgPGVhZGxlckBGcmVlQlNELm9yZz4gYm9ybiBp biBXZXN0IEhlbXBzdGVhZCwgTmV3IFlvcmssIFVuaXRlZCBTdGF0ZXMsIDE5OTEKPiAwMi8wNQlG cmFuayBMYXN6bG8gPGxhc3psb2ZARnJlZUJTRC5vcmc+IGJvcm4gaW4gSG93ZWxsLCBNaWNoaWdh biwgVW5pdGVkIFN0YXRlcywgMTk4Mwo+IDAyLzEwCURhdmlkIEdyZWVubWFuIDxkZ0BGcmVlQlNE Lm9yZz4gYm9ybiBpbiBQb3J0bGFuZCwgT3JlZ29uLCBVbml0ZWQgU3RhdGVzLCAxOTY4Cj4gMDIv MTAJUGF1bCBSaWNoYXJkcyA8cGF1bEBGcmVlQlNELm9yZz4gYm9ybiBpbiBBbW1hbmZvcmQsIENh cm1hcnRoZW5zaGlyZSwgVW5pdGVkIEtpbmdkb20sIDE5NjgKPgo+Cg== From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 00:44:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2F50106566C; Thu, 29 Sep 2011 00:44:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A33CC8FC16; Thu, 29 Sep 2011 00:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T0iYcx096978; Thu, 29 Sep 2011 00:44:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T0iYfr096976; Thu, 29 Sep 2011 00:44:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109290044.p8T0iYfr096976@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Sep 2011 00:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225856 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 00:44:34 -0000 Author: kib Date: Thu Sep 29 00:44:34 2011 New Revision: 225856 URL: http://svn.freebsd.org/changeset/base/225856 Log: Style nit. Submitted by: jhb MFC after: 2 weeks Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Sep 29 00:39:56 2011 (r225855) +++ head/sys/vm/vm_page.c Thu Sep 29 00:44:34 2011 (r225856) @@ -2348,7 +2348,6 @@ vm_page_clear_dirty_mask(vm_page_t m, in * If the object is locked and the page is neither VPO_BUSY nor * PGA_WRITEABLE, then the page's dirty field cannot possibly be * set by a concurrent pmap operation. - * */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 02:29:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 960BC106566B; Thu, 29 Sep 2011 02:29:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7B28FC13; Thu, 29 Sep 2011 02:29:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T2TWer000208; Thu, 29 Sep 2011 02:29:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T2TWYt000206; Thu, 29 Sep 2011 02:29:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201109290229.p8T2TWYt000206@svn.freebsd.org> From: Glen Barber Date: Thu, 29 Sep 2011 02:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225857 - head/usr.bin/script X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 02:29:32 -0000 Author: gjb (doc committer) Date: Thu Sep 29 02:29:32 2011 New Revision: 225857 URL: http://svn.freebsd.org/changeset/base/225857 Log: Fix a few grammar and mdoc nits in script.1 PR: 161088 Submitted by: Ben Kaduk ( kaduk % mit ! edu ) MFC after: 1 week Need-MFC: 225809 Modified: head/usr.bin/script/script.1 Modified: head/usr.bin/script/script.1 ============================================================================== --- head/usr.bin/script/script.1 Thu Sep 29 00:44:34 2011 (r225856) +++ head/usr.bin/script/script.1 Thu Sep 29 02:29:32 2011 (r225857) @@ -28,7 +28,7 @@ .\" @(#)script.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 22, 2004 +.Dd September 28, 2011 .Dt SCRIPT 1 .Os .Sh NAME @@ -73,15 +73,16 @@ or .Pa typescript , retaining the prior contents. .It Fl k -Log keys sent to program as well as output. +Log keys sent to the program as well as output. .It Fl q Run in quiet mode, omit the start and stop status messages. .It Fl t Ar time -Specify time interval between flushing script output file. +Specify the interval at which the script output file will be flushed +to disk, in seconds. A value of 0 causes .Nm -to flush for every character I/O event. +to flush after every character I/O event. The default interval is 30 seconds. .El @@ -136,13 +137,15 @@ If .Ev SHELL is not set, the Bourne shell is assumed. -(Most shells set this variable automatically). +.Pq Most shells set this variable automatically . .El .Sh SEE ALSO .Xr csh 1 -(for the +.Po +for the .Em history -mechanism). +mechanism +.Pc . .Sh HISTORY The .Nm @@ -165,13 +168,15 @@ mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not -work when in a raw mode where the program being run is doing manual echo. +work when the terminal is in a raw mode where +the program being run is doing manual echo. .Pp -If the +If .Nm -reads zero bytes from the terminal it switches to a mode when it probes read -only once a second until it gets some data. -This prevents the +reads zero bytes from the terminal, it switches to a mode when it +only attempts to read +once a second until there is data to read. +This prevents .Nm -spinning on zero-byte reads, but might cause a 1-second delay in -processing of the user input. +from spinning on zero-byte reads, but might cause a 1-second delay in +processing of user input. From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 02:52:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A56106566C; Thu, 29 Sep 2011 02:52:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 034D38FC0A; Thu, 29 Sep 2011 02:52:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T2qXjo000987; Thu, 29 Sep 2011 02:52:33 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T2qXbO000985; Thu, 29 Sep 2011 02:52:33 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201109290252.p8T2qXbO000985@svn.freebsd.org> From: Glen Barber Date: Thu, 29 Sep 2011 02:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225858 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 02:52:34 -0000 Author: gjb (doc committer) Date: Thu Sep 29 02:52:33 2011 New Revision: 225858 URL: http://svn.freebsd.org/changeset/base/225858 Log: Document, and provide an example for, PORTS_MODULES in build(7). PR: 161017 Submitted by: gcooper MFC after: 1 week Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Sep 29 02:29:32 2011 (r225857) +++ head/share/man/man7/build.7 Thu Sep 29 02:52:33 2011 (r225858) @@ -414,6 +414,16 @@ is set to the value of .It Va LOCAL_DIRS If set, this variable supplies a list of additional directories to build, relative to the root of the source tree. +.It Va PORTS_MODULES +A list of ports with kernel modules that should be built and installed +as part of the +.Cm buildkernel +and +.Cm installkernel +process. +.Bd -literal -offset indent +make PORTS_MODULES=emulators/kqemu-kmod kernel +.Ed .It Va SUBDIR_OVERRIDE Override the default list of sub-directories and only build the sub-directory named in this variable. From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 02:57:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94F20106564A; Thu, 29 Sep 2011 02:57:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8467F8FC12; Thu, 29 Sep 2011 02:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T2v8rY001177; Thu, 29 Sep 2011 02:57:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T2v86W001175; Thu, 29 Sep 2011 02:57:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201109290257.p8T2v86W001175@svn.freebsd.org> From: Glen Barber Date: Thu, 29 Sep 2011 02:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225859 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 02:57:08 -0000 Author: gjb (doc committer) Date: Thu Sep 29 02:57:08 2011 New Revision: 225859 URL: http://svn.freebsd.org/changeset/base/225859 Log: Whitespace cleanup in build(7). MFC after: 1 week Need-MFC: 225858 Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Sep 29 02:52:33 2011 (r225858) +++ head/share/man/man7/build.7 Thu Sep 29 02:57:08 2011 (r225859) @@ -238,7 +238,7 @@ This command takes a long time. Get updated sources as configured in .Xr make.conf 5 . .It Cm targets -Print a list of supported +Print a list of supported .Va TARGET / .Va TARGET_ARCH @@ -399,17 +399,17 @@ It defaults to .It Va KERNFAST If set, the build target .Cm buildkernel -defaults to setting +defaults to setting .Va NO_KERNELCLEAN , .Va NO_KERNELCONFIG , -.Va NO_KERNELDEPEND +.Va NO_KERNELDEPEND and .Va NO_KERNELOBJ . When set to a value other than .Cm 1 -then -.Va KERNCONF -is set to the value of +then +.Va KERNCONF +is set to the value of .Va KERNFAST . .It Va LOCAL_DIRS If set, this variable supplies a list of additional directories to @@ -452,11 +452,11 @@ output. Set this to cross-build for a different architecture. If not set, .Va TARGET_ARCH -defaults to the current machine architecture, unless +defaults to the current machine architecture, unless .Va TARGET is also set, in which case it defaults to the appropriate value for that platform. -Typically, one only needs to set +Typically, one only needs to set .Va TARGET . .El .Pp From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 03:37:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2408106564A; Thu, 29 Sep 2011 03:37:42 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87C8D8FC14; Thu, 29 Sep 2011 03:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T3bgAm002751; Thu, 29 Sep 2011 03:37:42 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T3bgwv002749; Thu, 29 Sep 2011 03:37:42 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201109290337.p8T3bgwv002749@svn.freebsd.org> From: Warren Block Date: Thu, 29 Sep 2011 03:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225861 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 03:37:42 -0000 Author: wblock (doc committer) Date: Thu Sep 29 03:37:42 2011 New Revision: 225861 URL: http://svn.freebsd.org/changeset/base/225861 Log: Fix a confusing sentence. [1] Other wording tweaks. Reviewed by: imp [1] Approved by: gjb Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Thu Sep 29 03:10:42 2011 (r225860) +++ head/etc/devd.conf Thu Sep 29 03:37:42 2011 (r225861) @@ -8,10 +8,10 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; pid-file "/var/run/devd.pid"; @@ -32,8 +32,8 @@ options { # script is called pccard_ether. # # NB: DETACH events are ignored; the kernel should handle all cleanup -# (routes, arp cache) if you need to do something beware of races -# against immediate create of a device w/ the same name; e.g. +# (routes, arp cache). Beware of races against immediate create +# of a device with the same name; e.g. # ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { @@ -43,7 +43,7 @@ notify 0 { }; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automatically exits # when the link goes down. @@ -87,7 +87,7 @@ detach 100 { device-name "ed50"; }; -# When a USB Bluetooth dongle appears activate it +# When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; action "/etc/rc.d/bluetooth quietstart $device-name"; @@ -125,7 +125,7 @@ detach 100 { }; # Firmware download into the ActiveWire board. After the firmware download is -# done the device detaches and reappears as something new and shiny +# done, the device detaches and reappears as something new and shiny # automatically. attach 100 { match "vendor" "0x0854"; @@ -265,12 +265,11 @@ notify 10 { /* EXAMPLES TO END OF FILE -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; @@ -288,7 +287,7 @@ detach 10 { # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. @@ -316,7 +315,7 @@ notify 10 { }; # This example works around a memory leak in PostgreSQL, restarting -# it when "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. +# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 06:00:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94ABA1065673; Thu, 29 Sep 2011 06:00:26 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC368FC17; Thu, 29 Sep 2011 06:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T60QFg007363; Thu, 29 Sep 2011 06:00:26 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T60QOe007362; Thu, 29 Sep 2011 06:00:26 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201109290600.p8T60QOe007362@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 29 Sep 2011 06:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225867 - head/crypto/heimdal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 06:00:26 -0000 Author: stas Date: Thu Sep 29 06:00:26 2011 New Revision: 225867 URL: http://svn.freebsd.org/changeset/base/225867 Log: - Bootstrap the heimdal merge history. Modified: Directory Properties: head/crypto/heimdal/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 06:31:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C9981065672; Thu, 29 Sep 2011 06:31:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEA7F8FC08; Thu, 29 Sep 2011 06:31:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T6VgRi008382; Thu, 29 Sep 2011 06:31:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T6VgJ3008377; Thu, 29 Sep 2011 06:31:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201109290631.p8T6VgJ3008377@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 29 Sep 2011 06:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 06:31:43 -0000 Author: trasz Date: Thu Sep 29 06:31:42 2011 New Revision: 225868 URL: http://svn.freebsd.org/changeset/base/225868 Log: Make ps(1) automatically size its column widths. Modified: head/bin/ps/extern.h head/bin/ps/keyword.c head/bin/ps/print.c head/bin/ps/ps.c head/bin/ps/ps.h Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Thu Sep 29 06:00:26 2011 (r225867) +++ head/bin/ps/extern.h Thu Sep 29 06:31:42 2011 (r225868) @@ -39,63 +39,52 @@ extern fixpt_t ccpu; extern int cflag, eval, fscale, nlistread, rawcpu; extern unsigned long mempages; extern time_t now; -extern int showthreads, sumrusage, termwidth, totwidth; +extern int showthreads, sumrusage, termwidth; extern STAILQ_HEAD(velisthead, varent) varlist; __BEGIN_DECLS -void arguments(KINFO *, VARENT *); -void command(KINFO *, VARENT *); -void cputime(KINFO *, VARENT *); +char *arguments(KINFO *, VARENT *); +char *command(KINFO *, VARENT *); +char *cputime(KINFO *, VARENT *); int donlist(void); -void elapsed(KINFO *, VARENT *); -void elapseds(KINFO *, VARENT *); -void emulname(KINFO *, VARENT *); +char *elapsed(KINFO *, VARENT *); +char *elapseds(KINFO *, VARENT *); +char *emulname(KINFO *, VARENT *); VARENT *find_varentry(VAR *); const char *fmt_argv(char **, char *, size_t); double getpcpu(const KINFO *); -void kvar(KINFO *, VARENT *); -void label(KINFO *, VARENT *); -void loginclass(KINFO *, VARENT *); -void logname(KINFO *, VARENT *); -void longtname(KINFO *, VARENT *); -void lstarted(KINFO *, VARENT *); -void maxrss(KINFO *, VARENT *); -void lockname(KINFO *, VARENT *); -void mwchan(KINFO *, VARENT *); -void nwchan(KINFO *, VARENT *); -void pagein(KINFO *, VARENT *); +char *kvar(KINFO *, VARENT *); +char *label(KINFO *, VARENT *); +char *loginclass(KINFO *, VARENT *); +char *logname(KINFO *, VARENT *); +char *longtname(KINFO *, VARENT *); +char *lstarted(KINFO *, VARENT *); +char *maxrss(KINFO *, VARENT *); +char *lockname(KINFO *, VARENT *); +char *mwchan(KINFO *, VARENT *); +char *nwchan(KINFO *, VARENT *); +char *pagein(KINFO *, VARENT *); void parsefmt(const char *, int); -void pcpu(KINFO *, VARENT *); -void pmem(KINFO *, VARENT *); -void pri(KINFO *, VARENT *); +char *pcpu(KINFO *, VARENT *); +char *pmem(KINFO *, VARENT *); +char *pri(KINFO *, VARENT *); void printheader(void); -void priorityr(KINFO *, VARENT *); -void egroupname(KINFO *, VARENT *); -void rgroupname(KINFO *, VARENT *); -void runame(KINFO *, VARENT *); -void rvar(KINFO *, VARENT *); -int s_comm(KINFO *); -int s_cputime(KINFO *); -int s_label(KINFO *); -int s_loginclass(KINFO *); -int s_logname(KINFO *); -int s_egroupname(KINFO *); -int s_rgroupname(KINFO *); -int s_runame(KINFO *); -int s_systime(KINFO *); -int s_uname(KINFO *); -int s_usertime(KINFO *); +char *priorityr(KINFO *, VARENT *); +char *egroupname(KINFO *, VARENT *); +char *rgroupname(KINFO *, VARENT *); +char *runame(KINFO *, VARENT *); +char *rvar(KINFO *, VARENT *); void showkey(void); -void started(KINFO *, VARENT *); -void state(KINFO *, VARENT *); -void systime(KINFO *, VARENT *); -void tdev(KINFO *, VARENT *); -void tdnam(KINFO *, VARENT *); -void tname(KINFO *, VARENT *); -void ucomm(KINFO *, VARENT *); -void uname(KINFO *, VARENT *); -void upr(KINFO *, VARENT *); -void usertime(KINFO *, VARENT *); -void vsize(KINFO *, VARENT *); -void wchan(KINFO *, VARENT *); +char *started(KINFO *, VARENT *); +char *state(KINFO *, VARENT *); +char *systime(KINFO *, VARENT *); +char *tdev(KINFO *, VARENT *); +char *tdnam(KINFO *, VARENT *); +char *tname(KINFO *, VARENT *); +char *ucomm(KINFO *, VARENT *); +char *uname(KINFO *, VARENT *); +char *upr(KINFO *, VARENT *); +char *usertime(KINFO *, VARENT *); +char *vsize(KINFO *, VARENT *); +char *wchan(KINFO *, VARENT *); __END_DECLS Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Thu Sep 29 06:00:26 2011 (r225867) +++ head/bin/ps/keyword.c Thu Sep 29 06:31:42 2011 (r225868) @@ -57,178 +57,116 @@ static int vcmp(const void *, const voi #define KOFF(x) offsetof(struct kinfo_proc, x) #define ROFF(x) offsetof(struct rusage, x) -#define EMULLEN 13 /* enough for "FreeBSD ELF32" */ #define LWPFMT "d" -#define LWPLEN 6 #define NLWPFMT "d" -#define NLWPLEN 4 #define UIDFMT "u" -#define UIDLEN 5 #define PIDFMT "d" -#define PIDLEN 5 -#define USERLEN (MAXLOGNAME - 1) /* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */ static VAR var[] = { - {"%cpu", "%CPU", NULL, 0, pcpu, NULL, 5, 0, CHAR, NULL, 0}, - {"%mem", "%MEM", NULL, 0, pmem, NULL, 4, 0, CHAR, NULL, 0}, - {"acflag", "ACFLG", NULL, 0, kvar, NULL, 3, KOFF(ki_acflag), USHORT, - "x", 0}, - {"acflg", "", "acflag", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, NULL, 16, 0, + {"%cpu", "%CPU", NULL, 0, pcpu, 0, CHAR, NULL, 0}, + {"%mem", "%MEM", NULL, 0, pmem, 0, CHAR, NULL, 0}, + {"acflag", "ACFLG", NULL, 0, kvar, KOFF(ki_acflag), USHORT, "x", 0}, + {"acflg", "", "acflag", 0, NULL, 0, CHAR, NULL, 0}, + {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, 0, CHAR, NULL, 0}, - {"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"class", "CLASS", NULL, LJUST, loginclass, s_loginclass, - MAXLOGNAME-1, 0, CHAR, NULL, 0}, - {"comm", "COMMAND", NULL, LJUST, ucomm, s_comm, - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, - {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, + {"blocked", "", "sigmask", 0, NULL, 0, CHAR, NULL, 0}, + {"caught", "", "sigcatch", 0, NULL, 0, CHAR, NULL, 0}, + {"class", "CLASS", NULL, LJUST, loginclass, 0, CHAR, NULL, 0}, + {"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, + {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0, CHAR, NULL, 0}, - {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", - 0}, - {"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, - NULL, 0}, - {"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0}, - {"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0}, - {"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0}, - {"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups), - UINT, UIDFMT, 0}, - {"group", "GROUP", NULL, LJUST, egroupname, s_egroupname, - USERLEN, 0, CHAR, NULL, 0}, - {"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, - "ld", 0}, - {"inblock", "", "inblk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"jid", "JID", NULL, 0, kvar, NULL, 6, KOFF(ki_jid), INT, "d", 0}, - {"jobc", "JOBC", NULL, 0, kvar, NULL, 4, KOFF(ki_jobc), SHORT, "d", - 0}, - {"ktrace", "KTRACE", NULL, 0, kvar, NULL, 8, KOFF(ki_traceflag), INT, - "x", 0}, - {"label", "LABEL", NULL, LJUST, label, s_label, SHRT_MAX, 0, CHAR, - NULL, 0}, - {"lim", "LIM", NULL, 0, maxrss, NULL, 5, 0, CHAR, NULL, 0}, - {"lockname", "LOCK", NULL, LJUST, lockname, NULL, 6, 0, CHAR, NULL, - 0}, - {"login", "LOGIN", NULL, LJUST, logname, s_logname, MAXLOGNAME-1, - 0, CHAR, NULL, 0}, - {"logname", "", "login", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"lstart", "STARTED", NULL, LJUST|USER, lstarted, NULL, 28, 0, CHAR, - NULL, 0}, - {"lwp", "LWP", NULL, 0, kvar, NULL, LWPLEN, KOFF(ki_tid), UINT, - LWPFMT, 0}, - {"majflt", "MAJFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), - LONG, "ld", 0}, - {"minflt", "MINFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), - LONG, "ld", 0}, - {"msgrcv", "MSGRCV", NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), - LONG, "ld", 0}, - {"msgsnd", "MSGSND", NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd), - LONG, "ld", 0}, - {"mwchan", "MWCHAN", NULL, LJUST, mwchan, NULL, 6, 0, CHAR, NULL, 0}, - {"ni", "", "nice", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"nice", "NI", NULL, 0, kvar, NULL, 2, KOFF(ki_nice), CHAR, "d", - 0}, - {"nivcsw", "NIVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nivcsw), - LONG, "ld", 0}, - {"nlwp", "NLWP", NULL, 0, kvar, NULL, NLWPLEN, KOFF(ki_numthreads), - UINT, NLWPFMT, 0}, - {"nsignals", "", "nsigs", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"nsigs", "NSIGS", NULL, USER, rvar, NULL, 4, ROFF(ru_nsignals), - LONG, "ld", 0}, - {"nswap", "NSWAP", NULL, USER, rvar, NULL, 4, ROFF(ru_nswap), - LONG, "ld", 0}, - {"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), - LONG, "ld", 0}, - {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, sizeof(void *) * 2, 0, - CHAR, NULL, 0}, - {"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), - LONG, "ld", 0}, - {"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"paddr", "PADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_paddr), KPTR, "lx", 0}, - {"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6, 0, CHAR, NULL, 0}, - {"pcpu", "", "%cpu", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"pending", "", "sig", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"pgid", "PGID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pgid), UINT, - PIDFMT, 0}, - {"pid", "PID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pid), UINT, - PIDFMT, 0}, - {"pmem", "", "%mem", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"ppid", "PPID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_ppid), UINT, - PIDFMT, 0}, - {"pri", "PRI", NULL, 0, pri, NULL, 3, 0, CHAR, NULL, 0}, - {"re", "RE", NULL, INF127, kvar, NULL, 3, KOFF(ki_swtime), UINT, "d", - 0}, - {"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid), - UINT, UIDFMT, 0}, - {"rgroup", "RGROUP", NULL, LJUST, rgroupname, s_rgroupname, - USERLEN, 0, CHAR, NULL, 0}, - {"rss", "RSS", NULL, 0, kvar, NULL, 6, KOFF(ki_rssize), PGTOK, "ld", 0}, - {"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR, - NULL, 0}, - {"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid), - UINT, UIDFMT, 0}, - {"ruser", "RUSER", NULL, LJUST, runame, s_runame, USERLEN, - 0, CHAR, NULL, 0}, - {"sid", "SID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_sid), UINT, - PIDFMT, 0}, - {"sig", "PENDING", NULL, 0, kvar, NULL, 8, KOFF(ki_siglist), INT, - "x", 0}, - {"sigcatch", "CAUGHT", NULL, 0, kvar, NULL, 8, KOFF(ki_sigcatch), - UINT, "x", 0}, - {"sigignore", "IGNORED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigignore), + {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, + {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, + {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, + {"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0}, + {"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0}, + {"etime", "ELAPSED", NULL, USER, elapsed, 0, CHAR, NULL, 0}, + {"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0}, + {"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0}, + {"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0}, + {"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0}, + {"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0}, + {"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0}, + {"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0}, + {"inblk", "INBLK", NULL, USER, rvar, ROFF(ru_inblock), LONG, "ld", 0}, + {"inblock", "", "inblk", 0, NULL, 0, CHAR, NULL, 0}, + {"jid", "JID", NULL, 0, kvar, KOFF(ki_jid), INT, "d", 0}, + {"jobc", "JOBC", NULL, 0, kvar, KOFF(ki_jobc), SHORT, "d", 0}, + {"ktrace", "KTRACE", NULL, 0, kvar, KOFF(ki_traceflag), INT, "x", 0}, + {"label", "LABEL", NULL, LJUST, label, 0, CHAR, NULL, 0}, + {"lim", "LIM", NULL, 0, maxrss, 0, CHAR, NULL, 0}, + {"lockname", "LOCK", NULL, LJUST, lockname, 0, CHAR, NULL, 0}, + {"login", "LOGIN", NULL, LJUST, logname, 0, CHAR, NULL, 0}, + {"logname", "", "login", 0, NULL, 0, CHAR, NULL, 0}, + {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 0, CHAR, NULL, 0}, + {"lwp", "LWP", NULL, 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, + {"majflt", "MAJFLT", NULL, USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, + {"minflt", "MINFLT", NULL, USER, rvar, ROFF(ru_minflt), LONG, "ld", 0}, + {"msgrcv", "MSGRCV", NULL, USER, rvar, ROFF(ru_msgrcv), LONG, "ld", 0}, + {"msgsnd", "MSGSND", NULL, USER, rvar, ROFF(ru_msgsnd), LONG, "ld", 0}, + {"mwchan", "MWCHAN", NULL, LJUST, mwchan, 0, CHAR, NULL, 0}, + {"ni", "", "nice", 0, NULL, 0, CHAR, NULL, 0}, + {"nice", "NI", NULL, 0, kvar, KOFF(ki_nice), CHAR, "d", 0}, + {"nivcsw", "NIVCSW", NULL, USER, rvar, ROFF(ru_nivcsw), LONG, "ld", 0}, + {"nlwp", "NLWP", NULL, 0, kvar, KOFF(ki_numthreads), UINT, NLWPFMT, 0}, + {"nsignals", "", "nsigs", 0, NULL, 0, CHAR, NULL, 0}, + {"nsigs", "NSIGS", NULL, USER, rvar, ROFF(ru_nsignals), LONG, "ld", 0}, + {"nswap", "NSWAP", NULL, USER, rvar, ROFF(ru_nswap), LONG, "ld", 0}, + {"nvcsw", "NVCSW", NULL, USER, rvar, ROFF(ru_nvcsw), LONG, "ld", 0}, + {"nwchan", "NWCHAN", NULL, LJUST, nwchan, 0, CHAR, NULL, 0}, + {"oublk", "OUBLK", NULL, USER, rvar, ROFF(ru_oublock), LONG, "ld", 0}, + {"oublock", "", "oublk", 0, NULL, 0, CHAR, NULL, 0}, + {"paddr", "PADDR", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, + {"pagein", "PAGEIN", NULL, USER, pagein, 0, CHAR, NULL, 0}, + {"pcpu", "", "%cpu", 0, NULL, 0, CHAR, NULL, 0}, + {"pending", "", "sig", 0, NULL, 0, CHAR, NULL, 0}, + {"pgid", "PGID", NULL, 0, kvar, KOFF(ki_pgid), UINT, PIDFMT, 0}, + {"pid", "PID", NULL, 0, kvar, KOFF(ki_pid), UINT, PIDFMT, 0}, + {"pmem", "", "%mem", 0, NULL, 0, CHAR, NULL, 0}, + {"ppid", "PPID", NULL, 0, kvar, KOFF(ki_ppid), UINT, PIDFMT, 0}, + {"pri", "PRI", NULL, 0, pri, 0, CHAR, NULL, 0}, + {"re", "RE", NULL, INF127, kvar, KOFF(ki_swtime), UINT, "d", 0}, + {"rgid", "RGID", NULL, 0, kvar, KOFF(ki_rgid), UINT, UIDFMT, 0}, + {"rgroup", "RGROUP", NULL, LJUST, rgroupname, 0, CHAR, NULL, 0}, + {"rss", "RSS", NULL, 0, kvar, KOFF(ki_rssize), PGTOK, "ld", 0}, + {"rtprio", "RTPRIO", NULL, 0, priorityr, KOFF(ki_pri), CHAR, NULL, 0}, + {"ruid", "RUID", NULL, 0, kvar, KOFF(ki_ruid), UINT, UIDFMT, 0}, + {"ruser", "RUSER", NULL, LJUST, runame, 0, CHAR, NULL, 0}, + {"sid", "SID", NULL, 0, kvar, KOFF(ki_sid), UINT, PIDFMT, 0}, + {"sig", "PENDING", NULL, 0, kvar, KOFF(ki_siglist), INT, "x", 0}, + {"sigcatch", "CAUGHT", NULL, 0, kvar, KOFF(ki_sigcatch), UINT, "x", 0}, + {"sigignore", "IGNORED", NULL, 0, kvar, KOFF(ki_sigignore), UINT, "x", 0}, - {"sigmask", "BLOCKED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigmask), - UINT, "x", 0}, - {"sl", "SL", NULL, INF127, kvar, NULL, 3, KOFF(ki_slptime), UINT, "d", - 0}, - {"start", "STARTED", NULL, LJUST|USER, started, NULL, 7, 0, CHAR, NULL, - 0}, - {"stat", "", "state", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"state", "STAT", NULL, 0, state, NULL, 4, 0, CHAR, NULL, 0}, - {"svgid", "SVGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svgid), - UINT, UIDFMT, 0}, - {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), - UINT, UIDFMT, 0}, - {"systime", "SYSTIME", NULL, USER, systime, s_systime, 15, 0, CHAR, - NULL, 0}, - {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_tdaddr), KPTR, "lx", 0}, - {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, - {"time", "TIME", NULL, USER, cputime, s_cputime, 15, 0, CHAR, - NULL, 0}, - {"tpgid", "TPGID", NULL, 0, kvar, NULL, 4, KOFF(ki_tpgid), UINT, - PIDFMT, 0}, - {"tsid", "TSID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_tsid), UINT, - PIDFMT, 0}, - {"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0}, - {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, - {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, - {"ucomm", "UCOMM", NULL, LJUST, ucomm, s_comm, - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, - {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, - UIDFMT, 0}, - {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, - {"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_paddr), KPTR, "lx", 0}, - {"user", "USER", NULL, LJUST, uname, s_uname, USERLEN, 0, CHAR, - NULL, 0}, - {"usertime", "USERTIME", NULL, USER, usertime, s_usertime, 15, 0, - CHAR, NULL, 0}, - {"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"vsz", "VSZ", NULL, 0, vsize, NULL, 6, 0, CHAR, NULL, 0}, - {"wchan", "WCHAN", NULL, LJUST, wchan, NULL, 6, 0, CHAR, NULL, 0}, - {"xstat", "XSTAT", NULL, 0, kvar, NULL, 4, KOFF(ki_xstat), USHORT, - "x", 0}, - {"", NULL, NULL, 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, + {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, + {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, + {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, + {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, + {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, + {"svgid", "SVGID", NULL, 0, kvar, KOFF(ki_svgid), UINT, UIDFMT, 0}, + {"svuid", "SVUID", NULL, 0, kvar, KOFF(ki_svuid), UINT, UIDFMT, 0}, + {"systime", "SYSTIME", NULL, USER, systime, 0, CHAR, NULL, 0}, + {"tdaddr", "TDADDR", NULL, 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, + {"tdev", "TDEV", NULL, 0, tdev, 0, CHAR, NULL, 0}, + {"tdnam", "TDNAM", NULL, LJUST, tdnam, 0, CHAR, NULL, 0}, + {"time", "TIME", NULL, USER, cputime, 0, CHAR, NULL, 0}, + {"tpgid", "TPGID", NULL, 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, + {"tsid", "TSID", NULL, 0, kvar, KOFF(ki_tsid), UINT, PIDFMT, 0}, + {"tsiz", "TSIZ", NULL, 0, kvar, KOFF(ki_tsize), PGTOK, "ld", 0}, + {"tt", "TT ", NULL, 0, tname, 0, CHAR, NULL, 0}, + {"tty", "TTY", NULL, LJUST, longtname, 0, CHAR, NULL, 0}, + {"ucomm", "UCOMM", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, + {"uid", "UID", NULL, 0, kvar, KOFF(ki_uid), UINT, UIDFMT, 0}, + {"upr", "UPR", NULL, 0, upr, 0, CHAR, NULL, 0}, + {"uprocp", "UPROCP", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, + {"user", "USER", NULL, LJUST, uname, 0, CHAR, NULL, 0}, + {"usertime", "USERTIME", NULL, USER, usertime, 0, CHAR, NULL, 0}, + {"usrpri", "", "upr", 0, NULL, 0, CHAR, NULL, 0}, + {"vsize", "", "vsz", 0, NULL, 0, CHAR, NULL, 0}, + {"vsz", "VSZ", NULL, 0, vsize, 0, CHAR, NULL, 0}, + {"wchan", "WCHAN", NULL, LJUST, wchan, 0, CHAR, NULL, 0}, + {"xstat", "XSTAT", NULL, 0, kvar, KOFF(ki_xstat), USHORT, "x", 0}, + {"", NULL, NULL, 0, NULL, 0, CHAR, NULL, 0}, }; void Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Thu Sep 29 06:00:26 2011 (r225867) +++ head/bin/ps/print.c Thu Sep 29 06:31:42 2011 (r225868) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include "ps.h" +#define COMMAND_WIDTH 16 +#define ARGUMENTS_WIDTH 16 + #define ps_pgtok(a) (((a) * getpagesize()) / 1024) void @@ -93,53 +96,42 @@ printheader(void) (void)putchar('\n'); } -void +char * arguments(KINFO *k, VARENT *ve) { VAR *v; - int left; - char *cp, *vis_args; + char *vis_args; v = ve->var; if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); - if (STAILQ_NEXT(ve, next_ve) == NULL) { - /* last field */ - if (termwidth == UNLIMITED) { - (void)printf("%s", vis_args); - } else { - left = termwidth - (totwidth - v->width); - if (left < 1) /* already wrapped, just use std width */ - left = v->width; - for (cp = vis_args; --left >= 0 && *cp != '\0';) - (void)putchar(*cp++); - } - } else { - (void)printf("%-*.*s", v->width, v->width, vis_args); - } - free(vis_args); + + if (STAILQ_NEXT(ve, next_ve) != NULL && strlen(vis_args) > ARGUMENTS_WIDTH) + vis_args[ARGUMENTS_WIDTH] = '\0'; + + return (vis_args); } -void +char * command(KINFO *k, VARENT *ve) { VAR *v; - int left; - char *cp, *vis_env, *vis_args; + char *vis_args, *vis_env, *str; v = ve->var; if (cflag) { /* If it is the last field, then don't pad */ if (STAILQ_NEXT(ve, next_ve) == NULL) { - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - (void)printf("%s", k->ki_p->ki_comm); - if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("/%s", k->ki_p->ki_tdname); + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + k->ki_p->ki_comm, + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); } else - (void)printf("%-*s", v->width, k->ki_p->ki_comm); - return; + str = strdup(k->ki_p->ki_comm); + + return (str); } if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); @@ -157,89 +149,84 @@ command(KINFO *k, VARENT *ve) } else vis_env = NULL; - if (termwidth == UNLIMITED) { - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - if (vis_env) - (void)printf("%s ", vis_env); - (void)printf("%s", vis_args); - } else { - left = termwidth - (totwidth - v->width); - if (left < 1) /* already wrapped, just use std width */ - left = v->width; - if ((cp = k->ki_d.prefix) != NULL) - while (--left >= 0 && *cp) - (void)putchar(*cp++); - if ((cp = vis_env) != NULL) { - while (--left >= 0 && *cp) - (void)putchar(*cp++); - if (--left >= 0) - putchar(' '); - } - for (cp = vis_args; --left >= 0 && *cp != '\0';) - (void)putchar(*cp++); - } + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + vis_env ? vis_env : "", + vis_env ? " " : "", + vis_args); + if (vis_env != NULL) free(vis_env); - } else + free(vis_args); + } else { /* ki_d.prefix & ki_env aren't shown for interim fields */ - (void)printf("%-*.*s", v->width, v->width, vis_args); - free(vis_args); + str = vis_args; + + if (strlen(str) > COMMAND_WIDTH) + str[COMMAND_WIDTH] = '\0'; + } + + return (str); } -void +char * ucomm(KINFO *k, VARENT *ve) { - char tmpbuff[COMMLEN + TDNAMLEN + 2]; VAR *v; + char *str; v = ve->var; if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - (void)printf("%s", k->ki_p->ki_comm); - if (showthreads && k->ki_p->ki_numthreads > 1) - printf("/%s", k->ki_p->ki_tdname); + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + k->ki_p->ki_comm, + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); } else { - bzero(tmpbuff, sizeof(tmpbuff)); if (showthreads && k->ki_p->ki_numthreads > 1) - sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, - k->ki_p->ki_tdname); + asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname); else - sprintf(tmpbuff, "%s", k->ki_p->ki_comm); - (void)printf("%-*s", v->width, tmpbuff); + str = strdup(k->ki_p->ki_comm); } + return (str); } -void +char * tdnam(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("%-*s", v->width, k->ki_p->ki_tdname); + str = strdup(k->ki_p->ki_tdname); else - (void)printf("%-*s", v->width, " "); + str = strdup(" "); + + return (str); } -void +char * logname(KINFO *k, VARENT *ve) { VAR *v; - char *s; v = ve->var; - (void)printf("%-*s", v->width, (s = k->ki_p->ki_login, *s) ? s : "-"); + if (*k->ki_p->ki_login == '\0') + return (NULL); + return (strdup(k->ki_p->ki_login)); } -void +char * state(KINFO *k, VARENT *ve) { int flag, tdflags; - char *cp; + char *cp, *buf; VAR *v; - char buf[16]; + + buf = malloc(16); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; flag = k->ki_p->ki_flag; @@ -301,274 +288,270 @@ state(KINFO *k, VARENT *ve) if (flag & P_JAILED) *cp++ = 'J'; *cp = '\0'; - (void)printf("%-*s", v->width, buf); + return (buf); } #define scalepri(x) ((x) - PZERO) -void +char * pri(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_level)); + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_level)); + return (str); } -void +char * upr(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_user)); + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_user)); + return (str); } #undef scalepri -void +char * uname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_uid, 0)); + return (strdup(user_from_uid(k->ki_p->ki_uid, 0))); } -int -s_uname(KINFO *k) -{ - return (strlen(user_from_uid(k->ki_p->ki_uid, 0))); -} - -void +char * egroupname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, - group_from_gid(k->ki_p->ki_groups[0], 0)); + return (strdup(group_from_gid(k->ki_p->ki_groups[0], 0))); } -int -s_egroupname(KINFO *k) -{ - return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0))); -} - -void +char * rgroupname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, group_from_gid(k->ki_p->ki_rgid, 0)); -} - -int -s_rgroupname(KINFO *k) -{ - return (strlen(group_from_gid(k->ki_p->ki_rgid, 0))); + return (strdup(group_from_gid(k->ki_p->ki_rgid, 0))); } -void +char * runame(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_ruid, 0)); -} - -int -s_runame(KINFO *k) -{ - return (strlen(user_from_uid(k->ki_p->ki_ruid, 0))); + return (strdup(user_from_uid(k->ki_p->ki_ruid, 0))); } - -void +char * tdev(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; + char *str; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) - (void)printf("%*s", v->width, "??"); + str = strdup("??"); else - (void)printf("%#*jx", v->width, (uintmax_t)dev); + asprintf(&str, "%#jx", (uintmax_t)dev); + + return (str); } -void +char * tname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char *ttname; + char *ttname, *str; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - (void)printf("%*s ", v->width - 1, "??"); + str = strdup("?? "); else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) ttname += 3; if (strncmp(ttname, "pts/", 4) == 0) ttname += 4; - (void)printf("%*.*s%c", v->width - 1, v->width - 1, ttname, + asprintf(&str, "%s%c", ttname, k->ki_p->ki_kiflag & KI_CTTY ? ' ' : '-'); } + + return (str); } -void +char * longtname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char *ttname; + const char *ttname; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - (void)printf("%-*s", v->width, "??"); - else - (void)printf("%-*s", v->width, ttname); + ttname = "??"; + + return (strdup(ttname)); } -void +char * started(KINFO *k, VARENT *ve) { VAR *v; time_t then; struct tm *tp; static int use_ampm = -1; - char buf[100]; + size_t buflen = 100; + char *buf; + + buf = malloc(buflen); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; - if (!k->ki_valid) { - (void)printf("%-*s", v->width, "-"); - return; - } + if (!k->ki_valid) + return (NULL); if (use_ampm < 0) use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); then = k->ki_p->ki_start.tv_sec; tp = localtime(&then); if (now - k->ki_p->ki_start.tv_sec < 24 * 3600) { - (void)strftime(buf, sizeof(buf), + (void)strftime(buf, buflen, use_ampm ? "%l:%M%p" : "%k:%M ", tp); } else if (now - k->ki_p->ki_start.tv_sec < 7 * 86400) { - (void)strftime(buf, sizeof(buf), + (void)strftime(buf, buflen, use_ampm ? "%a%I%p" : "%a%H ", tp); } else - (void)strftime(buf, sizeof(buf), "%e%b%y", tp); - (void)printf("%-*s", v->width, buf); + (void)strftime(buf, buflen, "%e%b%y", tp); + return (buf); } -void +char * lstarted(KINFO *k, VARENT *ve) { VAR *v; time_t then; - char buf[100]; + char *buf; + size_t buflen = 100; + + buf = malloc(buflen); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; - if (!k->ki_valid) { - (void)printf("%-*s", v->width, "-"); - return; - } + if (!k->ki_valid) + return (NULL); then = k->ki_p->ki_start.tv_sec; - (void)strftime(buf, sizeof(buf), "%c", localtime(&then)); - (void)printf("%-*s", v->width, buf); + (void)strftime(buf, buflen, "%c", localtime(&then)); + return (buf); } -void +char * lockname(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { if (k->ki_p->ki_lockname[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_lockname); + str = strdup(k->ki_p->ki_lockname); else - (void)printf("%-*s", v->width, "???"); + str = strdup("???"); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * wchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_wmesg); + str = strdup(k->ki_p->ki_wmesg); else - (void)printf("%-*lx", v->width, - (long)k->ki_p->ki_wchan); + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * nwchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - if (k->ki_p->ki_wchan) { - (void)printf("%0*lx", v->width, - (long)k->ki_p->ki_wchan); - } else - (void)printf("%-*s", v->width, "-"); + if (k->ki_p->ki_wchan) + asprintf(&str, "%0lx", (long)k->ki_p->ki_wchan); + else + str = NULL; + + return (str); } -void +char * mwchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_wmesg); + str = strdup(k->ki_p->ki_wmesg); else - (void)printf("%-*lx", v->width, - (long)k->ki_p->ki_wchan); + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); } else if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { if (k->ki_p->ki_lockname[0]) { - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_lockname); + str = strdup(k->ki_p->ki_lockname); } else - (void)printf("%-*s", v->width, "???"); + str = strdup("???"); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * vsize(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*lu", v->width, (u_long)(k->ki_p->ki_size / 1024)); + asprintf(&str, "%lu", (u_long)(k->ki_p->ki_size / 1024)); + return (str); } -static void +static char * printtime(KINFO *k, VARENT *ve, long secs, long psecs) /* psecs is "parts" of a second. first micro, then centi */ { VAR *v; - char obuff[128]; static char decimal_point; + char *str; if (decimal_point == '\0') decimal_point = localeconv()->decimal_point[0]; @@ -582,21 +565,12 @@ printtime(KINFO *k, VARENT *ve, long sec secs += psecs / 100; psecs = psecs % 100; } - (void)snprintf(obuff, sizeof(obuff), "%ld:%02ld%c%02ld", + asprintf(&str, "%ld:%02ld%c%02ld", secs / 60, secs % 60, decimal_point, psecs); - (void)printf("%*s", v->width, obuff); -} - -static int -sizetime(long secs) -{ - - if (secs < 60) - return (7); - return (log10(secs / 60) + 7); + return (str); } -void +char * cputime(KINFO *k, VARENT *ve) { long secs, psecs; @@ -612,10 +586,10 @@ cputime(KINFO *k, VARENT *ve) secs += k->ki_p->ki_childtime.tv_sec; psecs += k->ki_p->ki_childtime.tv_usec; } - printtime(k, ve, secs, psecs); + return (printtime(k, ve, secs, psecs)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 08:37:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41441106564A; Thu, 29 Sep 2011 08:37:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32FD88FC18; Thu, 29 Sep 2011 08:37:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T8bsr1012301; Thu, 29 Sep 2011 08:37:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T8bsUS012298; Thu, 29 Sep 2011 08:37:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109290837.p8T8bsUS012298@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 08:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225869 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 08:37:54 -0000 Author: mav Date: Thu Sep 29 08:37:53 2011 New Revision: 225869 URL: http://svn.freebsd.org/changeset/base/225869 Log: - Add special support for the MFI_CMD ioctl with MFI_CMD_STP command, used by present MegaCLI version. It has some special meaning for the first s/g list entry, while the main s/g list begins from the the second entry, and those lists should remain separate after loading to the busdma map. - Fix bug in 32bit ioctl compatibility shims when s/g list consists of more then on element. Sponsored by: iXsystems, inc. MFC after: 3 days Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Thu Sep 29 06:31:42 2011 (r225868) +++ head/sys/dev/mfi/mfi.c Thu Sep 29 08:37:53 2011 (r225869) @@ -1488,7 +1488,7 @@ mfi_data_cb(void *arg, bus_dma_segment_t struct mfi_command *cm; union mfi_sgl *sgl; struct mfi_softc *sc; - int i, dir; + int i, j, first, dir; cm = (struct mfi_command *)arg; sc = cm->cm_sc; @@ -1502,19 +1502,33 @@ mfi_data_cb(void *arg, bus_dma_segment_t return; } + j = 0; + if (cm->cm_frame->header.cmd == MFI_CMD_STP) { + first = cm->cm_stp_len; + if ((sc->mfi_flags & MFI_FLAGS_SG64) == 0) { + sgl->sg32[j].addr = segs[0].ds_addr; + sgl->sg32[j++].len = first; + } else { + sgl->sg64[j].addr = segs[0].ds_addr; + sgl->sg64[j++].len = first; + } + } else + first = 0; if ((sc->mfi_flags & MFI_FLAGS_SG64) == 0) { for (i = 0; i < nsegs; i++) { - sgl->sg32[i].addr = segs[i].ds_addr; - sgl->sg32[i].len = segs[i].ds_len; + sgl->sg32[j].addr = segs[i].ds_addr + first; + sgl->sg32[j++].len = segs[i].ds_len - first; + first = 0; } } else { for (i = 0; i < nsegs; i++) { - sgl->sg64[i].addr = segs[i].ds_addr; - sgl->sg64[i].len = segs[i].ds_len; + sgl->sg64[j].addr = segs[i].ds_addr + first; + sgl->sg64[j++].len = segs[i].ds_len - first; + first = 0; } hdr->flags |= MFI_FRAME_SGL64; } - hdr->sg_count = nsegs; + hdr->sg_count = j; dir = 0; if (cm->cm_flags & MFI_CMD_DATAIN) { @@ -1525,6 +1539,8 @@ mfi_data_cb(void *arg, bus_dma_segment_t dir |= BUS_DMASYNC_PREWRITE; hdr->flags |= MFI_FRAME_DIR_WRITE; } + if (cm->cm_frame->header.cmd == MFI_CMD_STP) + dir |= BUS_DMASYNC_PREWRITE; bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap, dir); cm->cm_flags |= MFI_CMD_MAPPED; @@ -1602,7 +1618,8 @@ mfi_complete(struct mfi_softc *sc, struc if ((cm->cm_flags & MFI_CMD_MAPPED) != 0) { dir = 0; - if (cm->cm_flags & MFI_CMD_DATAIN) + if ((cm->cm_flags & MFI_CMD_DATAIN) || + (cm->cm_frame->header.cmd == MFI_CMD_STP)) dir |= BUS_DMASYNC_POSTREAD; if (cm->cm_flags & MFI_CMD_DATAOUT) dir |= BUS_DMASYNC_POSTWRITE; @@ -1927,7 +1944,8 @@ mfi_ioctl(struct cdev *dev, u_long cmd, struct mfi_command *cm = NULL; uint32_t context; union mfi_sense_ptr sense_ptr; - uint8_t *data = NULL, *temp; + uint8_t *data = NULL, *temp, *addr; + size_t len; int i; struct mfi_ioc_passthru *iop = (struct mfi_ioc_passthru *)arg; #ifdef __amd64__ @@ -2024,6 +2042,21 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (cm->cm_flags == 0) cm->cm_flags |= MFI_CMD_DATAIN | MFI_CMD_DATAOUT; cm->cm_len = cm->cm_frame->header.data_len; + if (cm->cm_frame->header.cmd == MFI_CMD_STP) { +#ifdef __amd64__ + if (cmd == MFI_CMD) { +#endif + /* Native */ + cm->cm_stp_len = ioc->mfi_sgl[0].iov_len; +#ifdef __amd64__ + } else { + /* 32bit on 64bit */ + ioc32 = (struct mfi_ioc_packet32 *)ioc; + cm->cm_stp_len = ioc32->mfi_sgl[0].iov_len; + } +#endif + cm->cm_len += cm->cm_stp_len; + } if (cm->cm_len && (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT))) { cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF, @@ -2040,35 +2073,30 @@ mfi_ioctl(struct cdev *dev, u_long cmd, cm->cm_frame->header.context = context; temp = data; - if (cm->cm_flags & MFI_CMD_DATAOUT) { + if ((cm->cm_flags & MFI_CMD_DATAOUT) || + (cm->cm_frame->header.cmd == MFI_CMD_STP)) { for (i = 0; i < ioc->mfi_sge_count; i++) { #ifdef __amd64__ if (cmd == MFI_CMD) { +#endif /* Native */ - error = copyin(ioc->mfi_sgl[i].iov_base, - temp, - ioc->mfi_sgl[i].iov_len); + addr = ioc->mfi_sgl[i].iov_base; + len = ioc->mfi_sgl[i].iov_len; +#ifdef __amd64__ } else { - void *temp_convert; - /* 32bit */ + /* 32bit on 64bit */ ioc32 = (struct mfi_ioc_packet32 *)ioc; - temp_convert = - PTRIN(ioc32->mfi_sgl[i].iov_base); - error = copyin(temp_convert, - temp, - ioc32->mfi_sgl[i].iov_len); + addr = PTRIN(ioc32->mfi_sgl[i].iov_base); + len = ioc32->mfi_sgl[i].iov_len; } -#else - error = copyin(ioc->mfi_sgl[i].iov_base, - temp, - ioc->mfi_sgl[i].iov_len); #endif + error = copyin(addr, temp, len); if (error != 0) { device_printf(sc->mfi_dev, "Copy in failed\n"); goto out; } - temp = &temp[ioc->mfi_sgl[i].iov_len]; + temp = &temp[len]; } } @@ -2098,35 +2126,30 @@ mfi_ioctl(struct cdev *dev, u_long cmd, mtx_unlock(&sc->mfi_io_lock); temp = data; - if (cm->cm_flags & MFI_CMD_DATAIN) { + if ((cm->cm_flags & MFI_CMD_DATAIN) || + (cm->cm_frame->header.cmd == MFI_CMD_STP)) { for (i = 0; i < ioc->mfi_sge_count; i++) { #ifdef __amd64__ if (cmd == MFI_CMD) { +#endif /* Native */ - error = copyout(temp, - ioc->mfi_sgl[i].iov_base, - ioc->mfi_sgl[i].iov_len); + addr = ioc->mfi_sgl[i].iov_base; + len = ioc->mfi_sgl[i].iov_len; +#ifdef __amd64__ } else { - void *temp_convert; - /* 32bit */ + /* 32bit on 64bit */ ioc32 = (struct mfi_ioc_packet32 *)ioc; - temp_convert = - PTRIN(ioc32->mfi_sgl[i].iov_base); - error = copyout(temp, - temp_convert, - ioc32->mfi_sgl[i].iov_len); + addr = PTRIN(ioc32->mfi_sgl[i].iov_base); + len = ioc32->mfi_sgl[i].iov_len; } -#else - error = copyout(temp, - ioc->mfi_sgl[i].iov_base, - ioc->mfi_sgl[i].iov_len); #endif + error = copyout(temp, addr, len); if (error != 0) { device_printf(sc->mfi_dev, "Copy out failed\n"); goto out; } - temp = &temp[ioc->mfi_sgl[i].iov_len]; + temp = &temp[len]; } } Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Thu Sep 29 06:31:42 2011 (r225868) +++ head/sys/dev/mfi/mfivar.h Thu Sep 29 08:37:53 2011 (r225869) @@ -87,6 +87,7 @@ struct mfi_command { union mfi_sgl *cm_sg; void *cm_data; int cm_len; + int cm_stp_len; int cm_total_frame_size; int cm_extra_frames; int cm_flags; From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 12:14:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 377021065676; Thu, 29 Sep 2011 12:14:57 +0000 (UTC) Date: Thu, 29 Sep 2011 12:14:57 +0000 From: Alexander Best To: Edward Tomasz Napierala Message-ID: <20110929121457.GA53600@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109290631.p8T6VgJ3008377@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 12:14:57 -0000 On Thu Sep 29 11, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Sep 29 06:31:42 2011 > New Revision: 225868 > URL: http://svn.freebsd.org/changeset/base/225868 > > Log: > Make ps(1) automatically size its column widths. cool to see this committed. :) i think i wrote you about the two spaces between the "TT" and "TIME" field some time ago. you said that the "TT" entry can contain a postfix "-". can you describe a situation, where this can occur? i've never seen the "TT" field contain an entry larger than 2 chars. cheers. alex > > Modified: > head/bin/ps/extern.h > head/bin/ps/keyword.c > head/bin/ps/print.c > head/bin/ps/ps.c > head/bin/ps/ps.h > > Modified: head/bin/ps/extern.h > ============================================================================== > --- head/bin/ps/extern.h Thu Sep 29 06:00:26 2011 (r225867) > +++ head/bin/ps/extern.h Thu Sep 29 06:31:42 2011 (r225868) > @@ -39,63 +39,52 @@ extern fixpt_t ccpu; > extern int cflag, eval, fscale, nlistread, rawcpu; > extern unsigned long mempages; > extern time_t now; > -extern int showthreads, sumrusage, termwidth, totwidth; > +extern int showthreads, sumrusage, termwidth; > extern STAILQ_HEAD(velisthead, varent) varlist; > > __BEGIN_DECLS > -void arguments(KINFO *, VARENT *); > -void command(KINFO *, VARENT *); > -void cputime(KINFO *, VARENT *); > +char *arguments(KINFO *, VARENT *); > +char *command(KINFO *, VARENT *); > +char *cputime(KINFO *, VARENT *); > int donlist(void); > -void elapsed(KINFO *, VARENT *); > -void elapseds(KINFO *, VARENT *); > -void emulname(KINFO *, VARENT *); > +char *elapsed(KINFO *, VARENT *); > +char *elapseds(KINFO *, VARENT *); > +char *emulname(KINFO *, VARENT *); > VARENT *find_varentry(VAR *); > const char *fmt_argv(char **, char *, size_t); > double getpcpu(const KINFO *); > -void kvar(KINFO *, VARENT *); > -void label(KINFO *, VARENT *); > -void loginclass(KINFO *, VARENT *); > -void logname(KINFO *, VARENT *); > -void longtname(KINFO *, VARENT *); > -void lstarted(KINFO *, VARENT *); > -void maxrss(KINFO *, VARENT *); > -void lockname(KINFO *, VARENT *); > -void mwchan(KINFO *, VARENT *); > -void nwchan(KINFO *, VARENT *); > -void pagein(KINFO *, VARENT *); > +char *kvar(KINFO *, VARENT *); > +char *label(KINFO *, VARENT *); > +char *loginclass(KINFO *, VARENT *); > +char *logname(KINFO *, VARENT *); > +char *longtname(KINFO *, VARENT *); > +char *lstarted(KINFO *, VARENT *); > +char *maxrss(KINFO *, VARENT *); > +char *lockname(KINFO *, VARENT *); > +char *mwchan(KINFO *, VARENT *); > +char *nwchan(KINFO *, VARENT *); > +char *pagein(KINFO *, VARENT *); > void parsefmt(const char *, int); > -void pcpu(KINFO *, VARENT *); > -void pmem(KINFO *, VARENT *); > -void pri(KINFO *, VARENT *); > +char *pcpu(KINFO *, VARENT *); > +char *pmem(KINFO *, VARENT *); > +char *pri(KINFO *, VARENT *); > void printheader(void); > -void priorityr(KINFO *, VARENT *); > -void egroupname(KINFO *, VARENT *); > -void rgroupname(KINFO *, VARENT *); > -void runame(KINFO *, VARENT *); > -void rvar(KINFO *, VARENT *); > -int s_comm(KINFO *); > -int s_cputime(KINFO *); > -int s_label(KINFO *); > -int s_loginclass(KINFO *); > -int s_logname(KINFO *); > -int s_egroupname(KINFO *); > -int s_rgroupname(KINFO *); > -int s_runame(KINFO *); > -int s_systime(KINFO *); > -int s_uname(KINFO *); > -int s_usertime(KINFO *); > +char *priorityr(KINFO *, VARENT *); > +char *egroupname(KINFO *, VARENT *); > +char *rgroupname(KINFO *, VARENT *); > +char *runame(KINFO *, VARENT *); > +char *rvar(KINFO *, VARENT *); > void showkey(void); > -void started(KINFO *, VARENT *); > -void state(KINFO *, VARENT *); > -void systime(KINFO *, VARENT *); > -void tdev(KINFO *, VARENT *); > -void tdnam(KINFO *, VARENT *); > -void tname(KINFO *, VARENT *); > -void ucomm(KINFO *, VARENT *); > -void uname(KINFO *, VARENT *); > -void upr(KINFO *, VARENT *); > -void usertime(KINFO *, VARENT *); > -void vsize(KINFO *, VARENT *); > -void wchan(KINFO *, VARENT *); > +char *started(KINFO *, VARENT *); > +char *state(KINFO *, VARENT *); > +char *systime(KINFO *, VARENT *); > +char *tdev(KINFO *, VARENT *); > +char *tdnam(KINFO *, VARENT *); > +char *tname(KINFO *, VARENT *); > +char *ucomm(KINFO *, VARENT *); > +char *uname(KINFO *, VARENT *); > +char *upr(KINFO *, VARENT *); > +char *usertime(KINFO *, VARENT *); > +char *vsize(KINFO *, VARENT *); > +char *wchan(KINFO *, VARENT *); > __END_DECLS > > Modified: head/bin/ps/keyword.c > ============================================================================== > --- head/bin/ps/keyword.c Thu Sep 29 06:00:26 2011 (r225867) > +++ head/bin/ps/keyword.c Thu Sep 29 06:31:42 2011 (r225868) > @@ -57,178 +57,116 @@ static int vcmp(const void *, const voi > #define KOFF(x) offsetof(struct kinfo_proc, x) > #define ROFF(x) offsetof(struct rusage, x) > > -#define EMULLEN 13 /* enough for "FreeBSD ELF32" */ > #define LWPFMT "d" > -#define LWPLEN 6 > #define NLWPFMT "d" > -#define NLWPLEN 4 > #define UIDFMT "u" > -#define UIDLEN 5 > #define PIDFMT "d" > -#define PIDLEN 5 > -#define USERLEN (MAXLOGNAME - 1) > > /* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */ > static VAR var[] = { > - {"%cpu", "%CPU", NULL, 0, pcpu, NULL, 5, 0, CHAR, NULL, 0}, > - {"%mem", "%MEM", NULL, 0, pmem, NULL, 4, 0, CHAR, NULL, 0}, > - {"acflag", "ACFLG", NULL, 0, kvar, NULL, 3, KOFF(ki_acflag), USHORT, > - "x", 0}, > - {"acflg", "", "acflag", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, NULL, 16, 0, > + {"%cpu", "%CPU", NULL, 0, pcpu, 0, CHAR, NULL, 0}, > + {"%mem", "%MEM", NULL, 0, pmem, 0, CHAR, NULL, 0}, > + {"acflag", "ACFLG", NULL, 0, kvar, KOFF(ki_acflag), USHORT, "x", 0}, > + {"acflg", "", "acflag", 0, NULL, 0, CHAR, NULL, 0}, > + {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, 0, > CHAR, NULL, 0}, > - {"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"class", "CLASS", NULL, LJUST, loginclass, s_loginclass, > - MAXLOGNAME-1, 0, CHAR, NULL, 0}, > - {"comm", "COMMAND", NULL, LJUST, ucomm, s_comm, > - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, > - {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, > + {"blocked", "", "sigmask", 0, NULL, 0, CHAR, NULL, 0}, > + {"caught", "", "sigcatch", 0, NULL, 0, CHAR, NULL, 0}, > + {"class", "CLASS", NULL, LJUST, loginclass, 0, CHAR, NULL, 0}, > + {"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, > + {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0, > CHAR, NULL, 0}, > - {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", > - 0}, > - {"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, > - NULL, 0}, > - {"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0}, > - {"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0}, > - {"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0}, > - {"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups), > - UINT, UIDFMT, 0}, > - {"group", "GROUP", NULL, LJUST, egroupname, s_egroupname, > - USERLEN, 0, CHAR, NULL, 0}, > - {"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, > - "ld", 0}, > - {"inblock", "", "inblk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"jid", "JID", NULL, 0, kvar, NULL, 6, KOFF(ki_jid), INT, "d", 0}, > - {"jobc", "JOBC", NULL, 0, kvar, NULL, 4, KOFF(ki_jobc), SHORT, "d", > - 0}, > - {"ktrace", "KTRACE", NULL, 0, kvar, NULL, 8, KOFF(ki_traceflag), INT, > - "x", 0}, > - {"label", "LABEL", NULL, LJUST, label, s_label, SHRT_MAX, 0, CHAR, > - NULL, 0}, > - {"lim", "LIM", NULL, 0, maxrss, NULL, 5, 0, CHAR, NULL, 0}, > - {"lockname", "LOCK", NULL, LJUST, lockname, NULL, 6, 0, CHAR, NULL, > - 0}, > - {"login", "LOGIN", NULL, LJUST, logname, s_logname, MAXLOGNAME-1, > - 0, CHAR, NULL, 0}, > - {"logname", "", "login", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"lstart", "STARTED", NULL, LJUST|USER, lstarted, NULL, 28, 0, CHAR, > - NULL, 0}, > - {"lwp", "LWP", NULL, 0, kvar, NULL, LWPLEN, KOFF(ki_tid), UINT, > - LWPFMT, 0}, > - {"majflt", "MAJFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), > - LONG, "ld", 0}, > - {"minflt", "MINFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), > - LONG, "ld", 0}, > - {"msgrcv", "MSGRCV", NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), > - LONG, "ld", 0}, > - {"msgsnd", "MSGSND", NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd), > - LONG, "ld", 0}, > - {"mwchan", "MWCHAN", NULL, LJUST, mwchan, NULL, 6, 0, CHAR, NULL, 0}, > - {"ni", "", "nice", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"nice", "NI", NULL, 0, kvar, NULL, 2, KOFF(ki_nice), CHAR, "d", > - 0}, > - {"nivcsw", "NIVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nivcsw), > - LONG, "ld", 0}, > - {"nlwp", "NLWP", NULL, 0, kvar, NULL, NLWPLEN, KOFF(ki_numthreads), > - UINT, NLWPFMT, 0}, > - {"nsignals", "", "nsigs", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"nsigs", "NSIGS", NULL, USER, rvar, NULL, 4, ROFF(ru_nsignals), > - LONG, "ld", 0}, > - {"nswap", "NSWAP", NULL, USER, rvar, NULL, 4, ROFF(ru_nswap), > - LONG, "ld", 0}, > - {"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), > - LONG, "ld", 0}, > - {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, sizeof(void *) * 2, 0, > - CHAR, NULL, 0}, > - {"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), > - LONG, "ld", 0}, > - {"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"paddr", "PADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, > - KOFF(ki_paddr), KPTR, "lx", 0}, > - {"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6, 0, CHAR, NULL, 0}, > - {"pcpu", "", "%cpu", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"pending", "", "sig", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"pgid", "PGID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pgid), UINT, > - PIDFMT, 0}, > - {"pid", "PID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pid), UINT, > - PIDFMT, 0}, > - {"pmem", "", "%mem", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"ppid", "PPID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_ppid), UINT, > - PIDFMT, 0}, > - {"pri", "PRI", NULL, 0, pri, NULL, 3, 0, CHAR, NULL, 0}, > - {"re", "RE", NULL, INF127, kvar, NULL, 3, KOFF(ki_swtime), UINT, "d", > - 0}, > - {"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid), > - UINT, UIDFMT, 0}, > - {"rgroup", "RGROUP", NULL, LJUST, rgroupname, s_rgroupname, > - USERLEN, 0, CHAR, NULL, 0}, > - {"rss", "RSS", NULL, 0, kvar, NULL, 6, KOFF(ki_rssize), PGTOK, "ld", 0}, > - {"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR, > - NULL, 0}, > - {"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid), > - UINT, UIDFMT, 0}, > - {"ruser", "RUSER", NULL, LJUST, runame, s_runame, USERLEN, > - 0, CHAR, NULL, 0}, > - {"sid", "SID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_sid), UINT, > - PIDFMT, 0}, > - {"sig", "PENDING", NULL, 0, kvar, NULL, 8, KOFF(ki_siglist), INT, > - "x", 0}, > - {"sigcatch", "CAUGHT", NULL, 0, kvar, NULL, 8, KOFF(ki_sigcatch), > - UINT, "x", 0}, > - {"sigignore", "IGNORED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigignore), > + {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, > + {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, > + {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, > + {"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0}, > + {"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0}, > + {"etime", "ELAPSED", NULL, USER, elapsed, 0, CHAR, NULL, 0}, > + {"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0}, > + {"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0}, > + {"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0}, > + {"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0}, > + {"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0}, > + {"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0}, > + {"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0}, > + {"inblk", "INBLK", NULL, USER, rvar, ROFF(ru_inblock), LONG, "ld", 0}, > + {"inblock", "", "inblk", 0, NULL, 0, CHAR, NULL, 0}, > + {"jid", "JID", NULL, 0, kvar, KOFF(ki_jid), INT, "d", 0}, > + {"jobc", "JOBC", NULL, 0, kvar, KOFF(ki_jobc), SHORT, "d", 0}, > + {"ktrace", "KTRACE", NULL, 0, kvar, KOFF(ki_traceflag), INT, "x", 0}, > + {"label", "LABEL", NULL, LJUST, label, 0, CHAR, NULL, 0}, > + {"lim", "LIM", NULL, 0, maxrss, 0, CHAR, NULL, 0}, > + {"lockname", "LOCK", NULL, LJUST, lockname, 0, CHAR, NULL, 0}, > + {"login", "LOGIN", NULL, LJUST, logname, 0, CHAR, NULL, 0}, > + {"logname", "", "login", 0, NULL, 0, CHAR, NULL, 0}, > + {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 0, CHAR, NULL, 0}, > + {"lwp", "LWP", NULL, 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, > + {"majflt", "MAJFLT", NULL, USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, > + {"minflt", "MINFLT", NULL, USER, rvar, ROFF(ru_minflt), LONG, "ld", 0}, > + {"msgrcv", "MSGRCV", NULL, USER, rvar, ROFF(ru_msgrcv), LONG, "ld", 0}, > + {"msgsnd", "MSGSND", NULL, USER, rvar, ROFF(ru_msgsnd), LONG, "ld", 0}, > + {"mwchan", "MWCHAN", NULL, LJUST, mwchan, 0, CHAR, NULL, 0}, > + {"ni", "", "nice", 0, NULL, 0, CHAR, NULL, 0}, > + {"nice", "NI", NULL, 0, kvar, KOFF(ki_nice), CHAR, "d", 0}, > + {"nivcsw", "NIVCSW", NULL, USER, rvar, ROFF(ru_nivcsw), LONG, "ld", 0}, > + {"nlwp", "NLWP", NULL, 0, kvar, KOFF(ki_numthreads), UINT, NLWPFMT, 0}, > + {"nsignals", "", "nsigs", 0, NULL, 0, CHAR, NULL, 0}, > + {"nsigs", "NSIGS", NULL, USER, rvar, ROFF(ru_nsignals), LONG, "ld", 0}, > + {"nswap", "NSWAP", NULL, USER, rvar, ROFF(ru_nswap), LONG, "ld", 0}, > + {"nvcsw", "NVCSW", NULL, USER, rvar, ROFF(ru_nvcsw), LONG, "ld", 0}, > + {"nwchan", "NWCHAN", NULL, LJUST, nwchan, 0, CHAR, NULL, 0}, > + {"oublk", "OUBLK", NULL, USER, rvar, ROFF(ru_oublock), LONG, "ld", 0}, > + {"oublock", "", "oublk", 0, NULL, 0, CHAR, NULL, 0}, > + {"paddr", "PADDR", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, > + {"pagein", "PAGEIN", NULL, USER, pagein, 0, CHAR, NULL, 0}, > + {"pcpu", "", "%cpu", 0, NULL, 0, CHAR, NULL, 0}, > + {"pending", "", "sig", 0, NULL, 0, CHAR, NULL, 0}, > + {"pgid", "PGID", NULL, 0, kvar, KOFF(ki_pgid), UINT, PIDFMT, 0}, > + {"pid", "PID", NULL, 0, kvar, KOFF(ki_pid), UINT, PIDFMT, 0}, > + {"pmem", "", "%mem", 0, NULL, 0, CHAR, NULL, 0}, > + {"ppid", "PPID", NULL, 0, kvar, KOFF(ki_ppid), UINT, PIDFMT, 0}, > + {"pri", "PRI", NULL, 0, pri, 0, CHAR, NULL, 0}, > + {"re", "RE", NULL, INF127, kvar, KOFF(ki_swtime), UINT, "d", 0}, > + {"rgid", "RGID", NULL, 0, kvar, KOFF(ki_rgid), UINT, UIDFMT, 0}, > + {"rgroup", "RGROUP", NULL, LJUST, rgroupname, 0, CHAR, NULL, 0}, > + {"rss", "RSS", NULL, 0, kvar, KOFF(ki_rssize), PGTOK, "ld", 0}, > + {"rtprio", "RTPRIO", NULL, 0, priorityr, KOFF(ki_pri), CHAR, NULL, 0}, > + {"ruid", "RUID", NULL, 0, kvar, KOFF(ki_ruid), UINT, UIDFMT, 0}, > + {"ruser", "RUSER", NULL, LJUST, runame, 0, CHAR, NULL, 0}, > + {"sid", "SID", NULL, 0, kvar, KOFF(ki_sid), UINT, PIDFMT, 0}, > + {"sig", "PENDING", NULL, 0, kvar, KOFF(ki_siglist), INT, "x", 0}, > + {"sigcatch", "CAUGHT", NULL, 0, kvar, KOFF(ki_sigcatch), UINT, "x", 0}, > + {"sigignore", "IGNORED", NULL, 0, kvar, KOFF(ki_sigignore), > UINT, "x", 0}, > - {"sigmask", "BLOCKED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigmask), > - UINT, "x", 0}, > - {"sl", "SL", NULL, INF127, kvar, NULL, 3, KOFF(ki_slptime), UINT, "d", > - 0}, > - {"start", "STARTED", NULL, LJUST|USER, started, NULL, 7, 0, CHAR, NULL, > - 0}, > - {"stat", "", "state", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"state", "STAT", NULL, 0, state, NULL, 4, 0, CHAR, NULL, 0}, > - {"svgid", "SVGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svgid), > - UINT, UIDFMT, 0}, > - {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), > - UINT, UIDFMT, 0}, > - {"systime", "SYSTIME", NULL, USER, systime, s_systime, 15, 0, CHAR, > - NULL, 0}, > - {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, > - KOFF(ki_tdaddr), KPTR, "lx", 0}, > - {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, > - {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, > - {"time", "TIME", NULL, USER, cputime, s_cputime, 15, 0, CHAR, > - NULL, 0}, > - {"tpgid", "TPGID", NULL, 0, kvar, NULL, 4, KOFF(ki_tpgid), UINT, > - PIDFMT, 0}, > - {"tsid", "TSID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_tsid), UINT, > - PIDFMT, 0}, > - {"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0}, > - {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, > - {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, > - {"ucomm", "UCOMM", NULL, LJUST, ucomm, s_comm, > - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, > - {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, > - UIDFMT, 0}, > - {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, > - {"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2, > - KOFF(ki_paddr), KPTR, "lx", 0}, > - {"user", "USER", NULL, LJUST, uname, s_uname, USERLEN, 0, CHAR, > - NULL, 0}, > - {"usertime", "USERTIME", NULL, USER, usertime, s_usertime, 15, 0, > - CHAR, NULL, 0}, > - {"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > - {"vsz", "VSZ", NULL, 0, vsize, NULL, 6, 0, CHAR, NULL, 0}, > - {"wchan", "WCHAN", NULL, LJUST, wchan, NULL, 6, 0, CHAR, NULL, 0}, > - {"xstat", "XSTAT", NULL, 0, kvar, NULL, 4, KOFF(ki_xstat), USHORT, > - "x", 0}, > - {"", NULL, NULL, 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, > + {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, > + {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, > + {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, > + {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, > + {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, > + {"svgid", "SVGID", NULL, 0, kvar, KOFF(ki_svgid), UINT, UIDFMT, 0}, > + {"svuid", "SVUID", NULL, 0, kvar, KOFF(ki_svuid), UINT, UIDFMT, 0}, > + {"systime", "SYSTIME", NULL, USER, systime, 0, CHAR, NULL, 0}, > + {"tdaddr", "TDADDR", NULL, 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, > + {"tdev", "TDEV", NULL, 0, tdev, 0, CHAR, NULL, 0}, > + {"tdnam", "TDNAM", NULL, LJUST, tdnam, 0, CHAR, NULL, 0}, > + {"time", "TIME", NULL, USER, cputime, 0, CHAR, NULL, 0}, > + {"tpgid", "TPGID", NULL, 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, > + {"tsid", "TSID", NULL, 0, kvar, KOFF(ki_tsid), UINT, PIDFMT, 0}, > + {"tsiz", "TSIZ", NULL, 0, kvar, KOFF(ki_tsize), PGTOK, "ld", 0}, > + {"tt", "TT ", NULL, 0, tname, 0, CHAR, NULL, 0}, > + {"tty", "TTY", NULL, LJUST, longtname, 0, CHAR, NULL, 0}, > + {"ucomm", "UCOMM", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, > + {"uid", "UID", NULL, 0, kvar, KOFF(ki_uid), UINT, UIDFMT, 0}, > + {"upr", "UPR", NULL, 0, upr, 0, CHAR, NULL, 0}, > + {"uprocp", "UPROCP", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, > + {"user", "USER", NULL, LJUST, uname, 0, CHAR, NULL, 0}, > + {"usertime", "USERTIME", NULL, USER, usertime, 0, CHAR, NULL, 0}, > + {"usrpri", "", "upr", 0, NULL, 0, CHAR, NULL, 0}, > + {"vsize", "", "vsz", 0, NULL, 0, CHAR, NULL, 0}, > + {"vsz", "VSZ", NULL, 0, vsize, 0, CHAR, NULL, 0}, > + {"wchan", "WCHAN", NULL, LJUST, wchan, 0, CHAR, NULL, 0}, > + {"xstat", "XSTAT", NULL, 0, kvar, KOFF(ki_xstat), USHORT, "x", 0}, > + {"", NULL, NULL, 0, NULL, 0, CHAR, NULL, 0}, > }; > > void > > Modified: head/bin/ps/print.c > ============================================================================== > --- head/bin/ps/print.c Thu Sep 29 06:00:26 2011 (r225867) > +++ head/bin/ps/print.c Thu Sep 29 06:31:42 2011 (r225868) > @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); > > #include "ps.h" > > +#define COMMAND_WIDTH 16 > +#define ARGUMENTS_WIDTH 16 > + > #define ps_pgtok(a) (((a) * getpagesize()) / 1024) > > void > @@ -93,53 +96,42 @@ printheader(void) > (void)putchar('\n'); > } > > -void > +char * > arguments(KINFO *k, VARENT *ve) > { > VAR *v; > - int left; > - char *cp, *vis_args; > + char *vis_args; > > v = ve->var; > if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) > errx(1, "malloc failed"); > strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); > - if (STAILQ_NEXT(ve, next_ve) == NULL) { > - /* last field */ > - if (termwidth == UNLIMITED) { > - (void)printf("%s", vis_args); > - } else { > - left = termwidth - (totwidth - v->width); > - if (left < 1) /* already wrapped, just use std width */ > - left = v->width; > - for (cp = vis_args; --left >= 0 && *cp != '\0';) > - (void)putchar(*cp++); > - } > - } else { > - (void)printf("%-*.*s", v->width, v->width, vis_args); > - } > - free(vis_args); > + > + if (STAILQ_NEXT(ve, next_ve) != NULL && strlen(vis_args) > ARGUMENTS_WIDTH) > + vis_args[ARGUMENTS_WIDTH] = '\0'; > + > + return (vis_args); > } > > -void > +char * > command(KINFO *k, VARENT *ve) > { > VAR *v; > - int left; > - char *cp, *vis_env, *vis_args; > + char *vis_args, *vis_env, *str; > > v = ve->var; > if (cflag) { > /* If it is the last field, then don't pad */ > if (STAILQ_NEXT(ve, next_ve) == NULL) { > - if (k->ki_d.prefix) > - (void)printf("%s", k->ki_d.prefix); > - (void)printf("%s", k->ki_p->ki_comm); > - if (showthreads && k->ki_p->ki_numthreads > 1) > - (void)printf("/%s", k->ki_p->ki_tdname); > + asprintf(&str, "%s%s%s%s", > + k->ki_d.prefix ? k->ki_d.prefix : "", > + k->ki_p->ki_comm, > + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); > } else > - (void)printf("%-*s", v->width, k->ki_p->ki_comm); > - return; > + str = strdup(k->ki_p->ki_comm); > + > + return (str); > } > if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) > errx(1, "malloc failed"); > @@ -157,89 +149,84 @@ command(KINFO *k, VARENT *ve) > } else > vis_env = NULL; > > - if (termwidth == UNLIMITED) { > - if (k->ki_d.prefix) > - (void)printf("%s", k->ki_d.prefix); > - if (vis_env) > - (void)printf("%s ", vis_env); > - (void)printf("%s", vis_args); > - } else { > - left = termwidth - (totwidth - v->width); > - if (left < 1) /* already wrapped, just use std width */ > - left = v->width; > - if ((cp = k->ki_d.prefix) != NULL) > - while (--left >= 0 && *cp) > - (void)putchar(*cp++); > - if ((cp = vis_env) != NULL) { > - while (--left >= 0 && *cp) > - (void)putchar(*cp++); > - if (--left >= 0) > - putchar(' '); > - } > - for (cp = vis_args; --left >= 0 && *cp != '\0';) > - (void)putchar(*cp++); > - } > + asprintf(&str, "%s%s%s%s", > + k->ki_d.prefix ? k->ki_d.prefix : "", > + vis_env ? vis_env : "", > + vis_env ? " " : "", > + vis_args); > + > if (vis_env != NULL) > free(vis_env); > - } else > + free(vis_args); > + } else { > /* ki_d.prefix & ki_env aren't shown for interim fields */ > - (void)printf("%-*.*s", v->width, v->width, vis_args); > - free(vis_args); > + str = vis_args; > + > + if (strlen(str) > COMMAND_WIDTH) > + str[COMMAND_WIDTH] = '\0'; > + } > + > + return (str); > } > > -void > +char * > ucomm(KINFO *k, VARENT *ve) > { > - char tmpbuff[COMMLEN + TDNAMLEN + 2]; > VAR *v; > + char *str; > > v = ve->var; > if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ > - if (k->ki_d.prefix) > - (void)printf("%s", k->ki_d.prefix); > - (void)printf("%s", k->ki_p->ki_comm); > - if (showthreads && k->ki_p->ki_numthreads > 1) > - printf("/%s", k->ki_p->ki_tdname); > + asprintf(&str, "%s%s%s%s", > + k->ki_d.prefix ? k->ki_d.prefix : "", > + k->ki_p->ki_comm, > + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); > } else { > - bzero(tmpbuff, sizeof(tmpbuff)); > if (showthreads && k->ki_p->ki_numthreads > 1) > - sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, > - k->ki_p->ki_tdname); > + asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname); > else > - sprintf(tmpbuff, "%s", k->ki_p->ki_comm); > - (void)printf("%-*s", v->width, tmpbuff); > + str = strdup(k->ki_p->ki_comm); > } > + return (str); > } > > -void > +char * > tdnam(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > if (showthreads && k->ki_p->ki_numthreads > 1) > - (void)printf("%-*s", v->width, k->ki_p->ki_tdname); > + str = strdup(k->ki_p->ki_tdname); > else > - (void)printf("%-*s", v->width, " "); > + str = strdup(" "); > + > + return (str); > } > > -void > +char * > logname(KINFO *k, VARENT *ve) > { > VAR *v; > - char *s; > > v = ve->var; > - (void)printf("%-*s", v->width, (s = k->ki_p->ki_login, *s) ? s : "-"); > + if (*k->ki_p->ki_login == '\0') > + return (NULL); > + return (strdup(k->ki_p->ki_login)); > } > > -void > +char * > state(KINFO *k, VARENT *ve) > { > int flag, tdflags; > - char *cp; > + char *cp, *buf; > VAR *v; > - char buf[16]; > + > + buf = malloc(16); > + if (buf == NULL) > + errx(1, "malloc failed"); > > v = ve->var; > flag = k->ki_p->ki_flag; > @@ -301,274 +288,270 @@ state(KINFO *k, VARENT *ve) > if (flag & P_JAILED) > *cp++ = 'J'; > *cp = '\0'; > - (void)printf("%-*s", v->width, buf); > + return (buf); > } > > #define scalepri(x) ((x) - PZERO) > > -void > +char * > pri(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_level)); > + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_level)); > + return (str); > } > > -void > +char * > upr(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_user)); > + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_user)); > + return (str); > } > #undef scalepri > > -void > +char * > uname(KINFO *k, VARENT *ve) > { > VAR *v; > > v = ve->var; > - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_uid, 0)); > + return (strdup(user_from_uid(k->ki_p->ki_uid, 0))); > } > > -int > -s_uname(KINFO *k) > -{ > - return (strlen(user_from_uid(k->ki_p->ki_uid, 0))); > -} > - > -void > +char * > egroupname(KINFO *k, VARENT *ve) > { > VAR *v; > > v = ve->var; > - (void)printf("%-*s", v->width, > - group_from_gid(k->ki_p->ki_groups[0], 0)); > + return (strdup(group_from_gid(k->ki_p->ki_groups[0], 0))); > } > > -int > -s_egroupname(KINFO *k) > -{ > - return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0))); > -} > - > -void > +char * > rgroupname(KINFO *k, VARENT *ve) > { > VAR *v; > > v = ve->var; > - (void)printf("%-*s", v->width, group_from_gid(k->ki_p->ki_rgid, 0)); > -} > - > -int > -s_rgroupname(KINFO *k) > -{ > - return (strlen(group_from_gid(k->ki_p->ki_rgid, 0))); > + return (strdup(group_from_gid(k->ki_p->ki_rgid, 0))); > } > > -void > +char * > runame(KINFO *k, VARENT *ve) > { > VAR *v; > > v = ve->var; > - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_ruid, 0)); > -} > - > -int > -s_runame(KINFO *k) > -{ > - return (strlen(user_from_uid(k->ki_p->ki_ruid, 0))); > + return (strdup(user_from_uid(k->ki_p->ki_ruid, 0))); > } > > - > -void > +char * > tdev(KINFO *k, VARENT *ve) > { > VAR *v; > dev_t dev; > + char *str; > > v = ve->var; > dev = k->ki_p->ki_tdev; > if (dev == NODEV) > - (void)printf("%*s", v->width, "??"); > + str = strdup("??"); > else > - (void)printf("%#*jx", v->width, (uintmax_t)dev); > + asprintf(&str, "%#jx", (uintmax_t)dev); > + > + return (str); > } > > -void > +char * > tname(KINFO *k, VARENT *ve) > { > VAR *v; > dev_t dev; > - char *ttname; > + char *ttname, *str; > > v = ve->var; > dev = k->ki_p->ki_tdev; > if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) > - (void)printf("%*s ", v->width - 1, "??"); > + str = strdup("?? "); > else { > if (strncmp(ttname, "tty", 3) == 0 || > strncmp(ttname, "cua", 3) == 0) > ttname += 3; > if (strncmp(ttname, "pts/", 4) == 0) > ttname += 4; > - (void)printf("%*.*s%c", v->width - 1, v->width - 1, ttname, > + asprintf(&str, "%s%c", ttname, > k->ki_p->ki_kiflag & KI_CTTY ? ' ' : '-'); > } > + > + return (str); > } > > -void > +char * > longtname(KINFO *k, VARENT *ve) > { > VAR *v; > dev_t dev; > - char *ttname; > + const char *ttname; > > v = ve->var; > dev = k->ki_p->ki_tdev; > if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) > - (void)printf("%-*s", v->width, "??"); > - else > - (void)printf("%-*s", v->width, ttname); > + ttname = "??"; > + > + return (strdup(ttname)); > } > > -void > +char * > started(KINFO *k, VARENT *ve) > { > VAR *v; > time_t then; > struct tm *tp; > static int use_ampm = -1; > - char buf[100]; > + size_t buflen = 100; > + char *buf; > + > + buf = malloc(buflen); > + if (buf == NULL) > + errx(1, "malloc failed"); > > v = ve->var; > - if (!k->ki_valid) { > - (void)printf("%-*s", v->width, "-"); > - return; > - } > + if (!k->ki_valid) > + return (NULL); > if (use_ampm < 0) > use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); > then = k->ki_p->ki_start.tv_sec; > tp = localtime(&then); > if (now - k->ki_p->ki_start.tv_sec < 24 * 3600) { > - (void)strftime(buf, sizeof(buf), > + (void)strftime(buf, buflen, > use_ampm ? "%l:%M%p" : "%k:%M ", tp); > } else if (now - k->ki_p->ki_start.tv_sec < 7 * 86400) { > - (void)strftime(buf, sizeof(buf), > + (void)strftime(buf, buflen, > use_ampm ? "%a%I%p" : "%a%H ", tp); > } else > - (void)strftime(buf, sizeof(buf), "%e%b%y", tp); > - (void)printf("%-*s", v->width, buf); > + (void)strftime(buf, buflen, "%e%b%y", tp); > + return (buf); > } > > -void > +char * > lstarted(KINFO *k, VARENT *ve) > { > VAR *v; > time_t then; > - char buf[100]; > + char *buf; > + size_t buflen = 100; > + > + buf = malloc(buflen); > + if (buf == NULL) > + errx(1, "malloc failed"); > > v = ve->var; > - if (!k->ki_valid) { > - (void)printf("%-*s", v->width, "-"); > - return; > - } > + if (!k->ki_valid) > + return (NULL); > then = k->ki_p->ki_start.tv_sec; > - (void)strftime(buf, sizeof(buf), "%c", localtime(&then)); > - (void)printf("%-*s", v->width, buf); > + (void)strftime(buf, buflen, "%c", localtime(&then)); > + return (buf); > } > > -void > +char * > lockname(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { > if (k->ki_p->ki_lockname[0] != 0) > - (void)printf("%-*.*s", v->width, v->width, > - k->ki_p->ki_lockname); > + str = strdup(k->ki_p->ki_lockname); > else > - (void)printf("%-*s", v->width, "???"); > + str = strdup("???"); > } else > - (void)printf("%-*s", v->width, "-"); > + str = NULL; > + > + return (str); > } > > -void > +char * > wchan(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > if (k->ki_p->ki_wchan) { > if (k->ki_p->ki_wmesg[0] != 0) > - (void)printf("%-*.*s", v->width, v->width, > - k->ki_p->ki_wmesg); > + str = strdup(k->ki_p->ki_wmesg); > else > - (void)printf("%-*lx", v->width, > - (long)k->ki_p->ki_wchan); > + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); > } else > - (void)printf("%-*s", v->width, "-"); > + str = NULL; > + > + return (str); > } > > -void > +char * > nwchan(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > - if (k->ki_p->ki_wchan) { > - (void)printf("%0*lx", v->width, > - (long)k->ki_p->ki_wchan); > - } else > - (void)printf("%-*s", v->width, "-"); > + if (k->ki_p->ki_wchan) > + asprintf(&str, "%0lx", (long)k->ki_p->ki_wchan); > + else > + str = NULL; > + > + return (str); > } > > -void > +char * > mwchan(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > if (k->ki_p->ki_wchan) { > if (k->ki_p->ki_wmesg[0] != 0) > - (void)printf("%-*.*s", v->width, v->width, > - k->ki_p->ki_wmesg); > + str = strdup(k->ki_p->ki_wmesg); > else > - (void)printf("%-*lx", v->width, > - (long)k->ki_p->ki_wchan); > + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); > } else if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { > if (k->ki_p->ki_lockname[0]) { > - (void)printf("%-*.*s", v->width, v->width, > - k->ki_p->ki_lockname); > + str = strdup(k->ki_p->ki_lockname); > } else > - (void)printf("%-*s", v->width, "???"); > + str = strdup("???"); > } else > - (void)printf("%-*s", v->width, "-"); > + str = NULL; > + > + return (str); > } > > -void > +char * > vsize(KINFO *k, VARENT *ve) > { > VAR *v; > + char *str; > > v = ve->var; > - (void)printf("%*lu", v->width, (u_long)(k->ki_p->ki_size / 1024)); > + asprintf(&str, "%lu", (u_long)(k->ki_p->ki_size / 1024)); > + return (str); > } > > -static void > +static char * > printtime(KINFO *k, VARENT *ve, long secs, long psecs) > /* psecs is "parts" of a second. first micro, then centi */ > { > VAR *v; > - char obuff[128]; > static char decimal_point; > + char *str; > > if (decimal_point == '\0') > decimal_point = localeconv()->decimal_point[0]; > @@ -582,21 +565,12 @@ printtime(KINFO *k, VARENT *ve, long sec > secs += psecs / 100; > psecs = psecs % 100; > } > - (void)snprintf(obuff, sizeof(obuff), "%ld:%02ld%c%02ld", > + asprintf(&str, "%ld:%02ld%c%02ld", > secs / 60, secs % 60, decimal_point, psecs); > - (void)printf("%*s", v->width, obuff); > -} > - > -static int > -sizetime(long secs) > -{ > - > - if (secs < 60) > - return (7); > - return (log10(secs / 60) + 7); > + return (str); > } > > -void > +char * > cputime(KINFO *k, VARENT *ve) > { > long secs, psecs; > @@ -612,10 +586,10 @@ cputime(KINFO *k, VARENT *ve) > secs += k->ki_p->ki_childtime.tv_sec; > psecs += k->ki_p->ki_childtime.tv_usec; > } > - printtime(k, ve, secs, psecs); > + return (printtime(k, ve, secs, psecs)); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 13:28:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0817106566B; Thu, 29 Sep 2011 13:28:39 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C097D8FC1E; Thu, 29 Sep 2011 13:28:38 +0000 (UTC) Received: by fxg9 with SMTP id 9so2381429fxg.13 for ; Thu, 29 Sep 2011 06:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=/lvO3w6CFvMdmcpGrJhp//Sr7H14NoHmc0shv9fl7nQ=; b=l5QgQ+VHbxewcRZl7ktvNopM9Wde+xW2DC6TKkh+YifE3V7VY5kEgEI0dk6tLuSweJ 1JftjIBvKutPtMkvsAPdkgzaOHfr3L8C7vfu+CPqBLKmbzvHjr73cm5IGPjZKdOgScqM WZ+hw9aHaXDF4iDli2Stz/kHaKhU5UcKN9574= Received: by 10.223.42.216 with SMTP id t24mr6233650fae.141.1317301364627; Thu, 29 Sep 2011 06:02:44 -0700 (PDT) Received: from enapierala.whl (58.wheelsystems.com. [83.12.187.58]) by mx.google.com with ESMTPS id w6sm2070707fah.0.2011.09.29.06.02.42 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Sep 2011 06:02:43 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20110929121457.GA53600@freebsd.org> Date: Thu, 29 Sep 2011 15:02:41 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1244.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 13:28:39 -0000 Wiadomo=B6=E6 napisana przez Alexander Best w dniu 29 wrz 2011, o godz. = 14:14: > On Thu Sep 29 11, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Thu Sep 29 06:31:42 2011 >> New Revision: 225868 >> URL: http://svn.freebsd.org/changeset/base/225868 >>=20 >> Log: >> Make ps(1) automatically size its column widths. >=20 > cool to see this committed. :) >=20 > i think i wrote you about the two spaces between the "TT" and "TIME" = field > some time ago. you said that the "TT" entry can contain a postfix "-". = can > you describe a situation, where this can occur? i've never seen the = "TT" field > contain an entry larger than 2 chars. Login via ssh, run "nohup sleep 1000 &", then logout. -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 14:19:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4967A106566B; Thu, 29 Sep 2011 14:19:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39C5C8FC14; Thu, 29 Sep 2011 14:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TEJZnt026320; Thu, 29 Sep 2011 14:19:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TEJZQs026318; Thu, 29 Sep 2011 14:19:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291419.p8TEJZQs026318@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 14:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225875 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 14:19:35 -0000 Author: mav Date: Thu Sep 29 14:19:34 2011 New Revision: 225875 URL: http://svn.freebsd.org/changeset/base/225875 Log: Handle the race in cpu_idle() when due to the critical section CPU could get into sleep after receiving interrupt, delaying interrupt thread execution indefinitely until the next interrupt arrive. Reviewed by: nwhitehorn MFC after: 3 days Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Thu Sep 29 10:42:51 2011 (r225874) +++ head/sys/powerpc/powerpc/cpu.c Thu Sep 29 14:19:34 2011 (r225875) @@ -553,6 +553,11 @@ cpu_idle_60x(void) vers = mfpvr() >> 16; #ifdef AIM + mtmsr(msr & ~PSL_EE); + if (sched_runnable()) { + mtmsr(msr); + return; + } switch (vers) { case IBM970: case IBM970FX: @@ -583,6 +588,11 @@ cpu_idle_e500(void) msr = mfmsr(); #ifdef E500 + mtmsr(msr & ~PSL_EE); + if (sched_runnable()) { + mtmsr(msr); + return; + } /* Freescale E500 core RM section 6.4.1. */ __asm __volatile("msync; mtmsr %0; isync" :: "r" (msr | PSL_WE)); From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 15:12:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26C30106566C; Thu, 29 Sep 2011 15:12:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 173818FC13; Thu, 29 Sep 2011 15:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TFCwok028370; Thu, 29 Sep 2011 15:12:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TFCw9t028368; Thu, 29 Sep 2011 15:12:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291512.p8TFCw9t028368@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 15:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225877 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 15:12:59 -0000 Author: mav Date: Thu Sep 29 15:12:58 2011 New Revision: 225877 URL: http://svn.freebsd.org/changeset/base/225877 Log: Add header missed in r225875. MFC after: 3 days Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Thu Sep 29 15:05:16 2011 (r225876) +++ head/sys/powerpc/powerpc/cpu.c Thu Sep 29 15:12:58 2011 (r225877) @@ -65,6 +65,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 15:43:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACCA1065670; Thu, 29 Sep 2011 15:43:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB26A8FC12; Thu, 29 Sep 2011 15:43:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TFh28G029308; Thu, 29 Sep 2011 15:43:02 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TFh2wX029306; Thu, 29 Sep 2011 15:43:02 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201109291543.p8TFh2wX029306@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Sep 2011 15:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225878 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 15:43:02 -0000 Author: ae Date: Thu Sep 29 15:43:02 2011 New Revision: 225878 URL: http://svn.freebsd.org/changeset/base/225878 Log: Add Oxford Semiconductor OXPCIe952 (0x1c38) 1 port serial card. PR: kern/160895 Submitted by: Konstantin V. Krotov MFC after: 1 week Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Thu Sep 29 15:12:58 2011 (r225877) +++ head/sys/dev/puc/pucdata.c Thu Sep 29 15:43:02 2011 (r225878) @@ -733,6 +733,13 @@ const struct puc_cfg puc_pci_devices[] = * */ + { 0x1415, 0xc138, 0xffff, 0, + "Oxford Semiconductor OXPCIe952 UARTs", + DEFAULT_RCLK * 0x22, + PUC_PORT_NONSTANDARD, 0x10, 0, -1, + .config_function = puc_config_oxford_pcie + }, + { 0x1415, 0xc158, 0xffff, 0, "Oxford Semiconductor OXPCIe952 UARTs", DEFAULT_RCLK * 0x22, From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 18:12:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E5211065676; Thu, 29 Sep 2011 18:12:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3C28FC13; Thu, 29 Sep 2011 18:12:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TICeAV033852; Thu, 29 Sep 2011 18:12:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TICeZS033844; Thu, 29 Sep 2011 18:12:40 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201109291812.p8TICeZS033844@svn.freebsd.org> From: Dimitry Andric Date: Thu, 29 Sep 2011 18:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225880 - in head: contrib/llvm contrib/llvm/lib/Support contrib/llvm/tools/clang etc/mtree share/doc share/doc/llvm share/doc/llvm/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 18:12:40 -0000 Author: dim Date: Thu Sep 29 18:12:40 2011 New Revision: 225880 URL: http://svn.freebsd.org/changeset/base/225880 Log: Revive the LLVM and Clang license files, which were removed in my too-thorough cleanup of unused files, in r213695. Also make sure these get installed under /usr/share/doc. Submitted by: rwatson, brooks Pointy hat to: dim MFC after: 3 days Added: head/contrib/llvm/LICENSE.TXT - copied unchanged from r225844, vendor/llvm/dist/LICENSE.TXT head/contrib/llvm/lib/Support/COPYRIGHT.regex - copied unchanged from r225844, vendor/llvm/dist/lib/Support/COPYRIGHT.regex head/contrib/llvm/tools/clang/LICENSE.TXT - copied unchanged from r225870, vendor/clang/dist/LICENSE.TXT head/share/doc/llvm/ head/share/doc/llvm/Makefile (contents, props changed) head/share/doc/llvm/clang/ head/share/doc/llvm/clang/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/share/doc/Makefile Copied: head/contrib/llvm/LICENSE.TXT (from r225844, vendor/llvm/dist/LICENSE.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/LICENSE.TXT Thu Sep 29 18:12:40 2011 (r225880, copy of r225844, vendor/llvm/dist/LICENSE.TXT) @@ -0,0 +1,69 @@ +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +Autoconf llvm/autoconf + llvm/projects/ModuleMaker/autoconf + llvm/projects/sample/autoconf +CellSPU backend llvm/lib/Target/CellSPU/README.txt +Google Test llvm/utils/unittest/googletest +OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} Copied: head/contrib/llvm/lib/Support/COPYRIGHT.regex (from r225844, vendor/llvm/dist/lib/Support/COPYRIGHT.regex) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/lib/Support/COPYRIGHT.regex Thu Sep 29 18:12:40 2011 (r225880, copy of r225844, vendor/llvm/dist/lib/Support/COPYRIGHT.regex) @@ -0,0 +1,54 @@ +$OpenBSD: COPYRIGHT,v 1.3 2003/06/02 20:18:36 millert Exp $ + +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +/*- + * Copyright (c) 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 + */ Copied: head/contrib/llvm/tools/clang/LICENSE.TXT (from r225870, vendor/clang/dist/LICENSE.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/clang/LICENSE.TXT Thu Sep 29 18:12:40 2011 (r225880, copy of r225870, vendor/clang/dist/LICENSE.TXT) @@ -0,0 +1,63 @@ +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2007-2011 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- + + Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Sep 29 17:13:23 2011 (r225879) +++ head/etc/mtree/BSD.usr.dist Thu Sep 29 18:12:40 2011 (r225880) @@ -93,6 +93,10 @@ intel_wpi .. .. + llvm + clang + .. + .. ncurses .. ntp Modified: head/share/doc/Makefile ============================================================================== --- head/share/doc/Makefile Thu Sep 29 17:13:23 2011 (r225879) +++ head/share/doc/Makefile Thu Sep 29 18:12:40 2011 (r225880) @@ -3,12 +3,16 @@ .include -SUBDIR= ${_bind9} IPv6 legal ${_roffdocs} +SUBDIR= ${_bind9} IPv6 legal ${_llvm} ${_roffdocs} .if ${MK_BIND} != "no" _bind9= bind9 .endif +.if ${MK_CLANG} != "no" +_llvm= llvm +.endif + # FIXME this is not a real solution ... .if ${MK_GROFF} != "no" _roffdocs= papers psd smm usd Added: head/share/doc/llvm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/llvm/Makefile Thu Sep 29 18:12:40 2011 (r225880) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +SUBDIR= clang + +SRCDIR= ${.CURDIR}/../../../contrib/llvm + +.PATH: ${SRCDIR} ${SRCDIR}/lib/Support + +NO_OBJ= + +FILESGROUPS= TOP +TOP= LICENSE.TXT COPYRIGHT.regex +TOPDIR= ${DOCDIR}/llvm + +.include Added: head/share/doc/llvm/clang/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/llvm/clang/Makefile Thu Sep 29 18:12:40 2011 (r225880) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +SRCDIR= ${.CURDIR}/../../../../contrib/llvm/tools/clang + +.PATH: ${SRCDIR} + +NO_OBJ= + +FILESGROUPS= TOP +TOP= LICENSE.TXT +TOPDIR= ${DOCDIR}/llvm/clang + +.include From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 18:43:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 9CB6B106567A; Thu, 29 Sep 2011 18:43:06 +0000 (UTC) Date: Thu, 29 Sep 2011 18:43:06 +0000 From: Alexander Best To: Edward Tomasz Napiera?a Message-ID: <20110929184306.GB15859@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 18:43:06 -0000 On Thu Sep 29 11, Edward Tomasz Napiera?a wrote: > Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 14:14: > > On Thu Sep 29 11, Edward Tomasz Napierala wrote: > >> Author: trasz > >> Date: Thu Sep 29 06:31:42 2011 > >> New Revision: 225868 > >> URL: http://svn.freebsd.org/changeset/base/225868 > >> > >> Log: > >> Make ps(1) automatically size its column widths. > > > > cool to see this committed. :) > > > > i think i wrote you about the two spaces between the "TT" and "TIME" field > > some time ago. you said that the "TT" entry can contain a postfix "-". can > > you describe a situation, where this can occur? i've never seen the "TT" field > > contain an entry larger than 2 chars. > > Login via ssh, run "nohup sleep 1000 &", then logout. ahh thanks. maybe, since ps needs to iterate through the whole output at first anyway, it can check if a "TT" entry is postfixed with "-", and if it isn't get rid of the trailing space. cheers. alex > > -- > If you cut off my head, what would I say? Me and my head, or me and my body? From owner-svn-src-head@FreeBSD.ORG Thu Sep 29 18:57:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 681CE1065679; Thu, 29 Sep 2011 18:57:00 +0000 (UTC) Date: Thu, 29 Sep 2011 18:57:00 +0000 From: Alexander Best To: Edward Tomasz Napiera?a Message-ID: <20110929185700.GA18684@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 18:57:00 -0000 On Thu Sep 29 11, Edward Tomasz Napiera?a wrote: > Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 14:14: > > On Thu Sep 29 11, Edward Tomasz Napierala wrote: > >> Author: trasz > >> Date: Thu Sep 29 06:31:42 2011 > >> New Revision: 225868 > >> URL: http://svn.freebsd.org/changeset/base/225868 > >> > >> Log: > >> Make ps(1) automatically size its column widths. > > > > cool to see this committed. :) > > > > i think i wrote you about the two spaces between the "TT" and "TIME" field > > some time ago. you said that the "TT" entry can contain a postfix "-". can > > you describe a situation, where this can occur? i've never seen the "TT" field > > contain an entry larger than 2 chars. > > Login via ssh, run "nohup sleep 1000 &", then logout. maybe it would also be possible to introduce unit symbols for the "vsz" and "rss" fields. they are getting really huge on systems with a long uptime (*cough* mem leaks) and kilobyte granularity isn't really that great when those fields are nearing 1GB. cheers. alex > > -- > If you cut off my head, what would I say? Me and my head, or me and my body? From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 04:55:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F289106566C; Fri, 30 Sep 2011 04:55:24 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0579E8FC0A; Fri, 30 Sep 2011 04:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8U4tNxF053364; Fri, 30 Sep 2011 04:55:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8U4tNoP053355; Fri, 30 Sep 2011 04:55:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201109300455.p8U4tNoP053355@svn.freebsd.org> From: Kevin Lo Date: Fri, 30 Sep 2011 04:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225882 - in head/sys/arm: at91 econa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 04:55:24 -0000 Author: kevlo Date: Fri Sep 30 04:55:23 2011 New Revision: 225882 URL: http://svn.freebsd.org/changeset/base/225882 Log: Remove pointless semicolons after label Modified: head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_pio.c head/sys/arm/at91/at91_rtc.c head/sys/arm/at91/at91_spi.c head/sys/arm/at91/at91_ssc.c head/sys/arm/at91/at91_twi.c head/sys/arm/at91/uart_dev_at91usart.c head/sys/arm/econa/if_ece.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_mci.c Fri Sep 30 04:55:23 2011 (r225882) @@ -243,7 +243,7 @@ at91_mci_attach(device_t dev) child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); -out:; +out: if (err) at91_mci_deactivate(dev); return (err); Modified: head/sys/arm/at91/at91_pio.c ============================================================================== --- head/sys/arm/at91/at91_pio.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_pio.c Fri Sep 30 04:55:23 2011 (r225882) @@ -162,7 +162,7 @@ at91_pio_attach(device_t dev) goto out; } sc->cdev->si_drv1 = sc; -out:; +out: if (err) at91_pio_deactivate(dev); return (err); Modified: head/sys/arm/at91/at91_rtc.c ============================================================================== --- head/sys/arm/at91/at91_rtc.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_rtc.c Fri Sep 30 04:55:23 2011 (r225882) @@ -118,7 +118,7 @@ at91_rtc_attach(device_t dev) goto out; } clock_register(dev, 1000000); -out:; +out: if (err) at91_rtc_deactivate(dev); return (err); Modified: head/sys/arm/at91/at91_spi.c ============================================================================== --- head/sys/arm/at91/at91_spi.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_spi.c Fri Sep 30 04:55:23 2011 (r225882) @@ -134,7 +134,7 @@ at91_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); bus_generic_attach(dev); -out:; +out: if (err) at91_spi_deactivate(dev); return (err); @@ -259,7 +259,7 @@ at91_spi_transfer(device_t dev, device_t for (j = 0; j < i; j++) bus_dmamap_unload(sc->dmatag, sc->map[j]); return (err); -out:; +out: for (j = 0; j < i; j++) bus_dmamap_unload(sc->dmatag, sc->map[j]); return (EIO); Modified: head/sys/arm/at91/at91_ssc.c ============================================================================== --- head/sys/arm/at91/at91_ssc.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_ssc.c Fri Sep 30 04:55:23 2011 (r225882) @@ -150,7 +150,7 @@ at91_ssc_attach(device_t dev) WR4(sc, SSC_TFMR, 0x1f | SSC_TFMR_DATDEF | SSC_TFMR_MSFBF | SSC_TFMR_FSOS_NEG_PULSE); -out:; +out: if (err) at91_ssc_deactivate(dev); return (err); Modified: head/sys/arm/at91/at91_twi.c ============================================================================== --- head/sys/arm/at91/at91_twi.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/at91_twi.c Fri Sep 30 04:55:23 2011 (r225882) @@ -139,7 +139,7 @@ at91_twi_attach(device_t dev) device_printf(dev, "could not allocate iicbus instance\n"); /* probe and attach the iicbus */ bus_generic_attach(dev); -out:; +out: if (err) at91_twi_deactivate(dev); return (err); @@ -365,7 +365,7 @@ at91_twi_transfer(device_t dev, struct i if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP))) break; } -out:; +out: if (err) { WR4(sc, TWI_CR, TWI_CR_SWRST); WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/at91/uart_dev_at91usart.c Fri Sep 30 04:55:23 2011 (r225882) @@ -406,7 +406,7 @@ at91_usart_bus_attach(struct uart_softc WR4(&sc->sc_bas, USART_IER, USART_CSR_RXRDY); } WR4(&sc->sc_bas, USART_IER, USART_CSR_RXBRK); -errout:; +errout: // XXX bad return (err); } Modified: head/sys/arm/econa/if_ece.c ============================================================================== --- head/sys/arm/econa/if_ece.c Thu Sep 29 18:42:44 2011 (r225881) +++ head/sys/arm/econa/if_ece.c Fri Sep 30 04:55:23 2011 (r225882) @@ -441,7 +441,7 @@ ece_attach(device_t dev) taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->dev)); -out:; +out: if (err) ece_deactivate(dev); if (err && ifp) From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 05:17:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32050106566C; Fri, 30 Sep 2011 05:17:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D460B8FC08; Fri, 30 Sep 2011 05:17:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8U5Hv8p054059; Fri, 30 Sep 2011 05:17:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8U5Hvom054044; Fri, 30 Sep 2011 05:17:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109300517.p8U5Hvom054044@svn.freebsd.org> From: Adrian Chadd Date: Fri, 30 Sep 2011 05:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225883 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5312 ath_hal/ar5416 ath_hal/ar9001 ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 05:17:58 -0000 Author: adrian Date: Fri Sep 30 05:17:57 2011 New Revision: 225883 URL: http://svn.freebsd.org/changeset/base/225883 Log: Fix a corner case in the HAL debugging changes, where ah was NULL. Although I tried to fix this earlier by introducing HALDEBUG_G(), it turns out there seem to be other cases where the pointer value is still NULL. * Fix DO_HALDEBUG() and the HALDEBUG macro to check whether ah is NULL before deferencing it * Remove HALDEBUG_G() as it's no longer needed This is hopefully a merge candidate for 9.0-RELEASE as enabling debugging at startup could result in a kernel panic. Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5112.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ah_osdep.c Fri Sep 30 05:17:57 2011 (r225883) @@ -128,7 +128,7 @@ void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { if ((mask == HAL_DEBUG_UNMASKABLE) || - (ah->ah_config.ah_debug & mask) || + (ah != NULL && ah->ah_config.ah_debug & mask) || (ath_hal_debug & mask)) { __va_list ap; va_start(ap, fmt); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Sep 30 05:17:57 2011 (r225883) @@ -503,26 +503,15 @@ extern void ath_hal_free(void *); extern int ath_hal_debug; /* Global debug flags */ /* - * This is used for global debugging, when ahp doesn't yet have the - * related debugging state. For example, during probe/attach. - */ -#define HALDEBUG_G(_ah, __m, ...) \ - do { \ - if ((__m) == HAL_DEBUG_UNMASKABLE || \ - ath_hal_debug & (__m)) { \ - DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ - } \ - } while (0); - -/* - * This is used for local debugging, when ahp isn't NULL and - * thus may have debug flags set. + * The typecast is purely because some callers will pass in + * AH_NULL directly rather than using a NULL ath_hal pointer. */ #define HALDEBUG(_ah, __m, ...) \ do { \ if ((__m) == HAL_DEBUG_UNMASKABLE || \ ath_hal_debug & (__m) || \ - (_ah)->ah_config.ah_debug & (__m)) { \ + ((_ah) != NULL && \ + ((struct ath_hal *) (_ah))->ah_config.ah_debug & (__m))) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); @@ -531,7 +520,6 @@ extern void DO_HALDEBUG(struct ath_hal * __printflike(3,4); #else #define HALDEBUG(_ah, __m, ...) -#define HALDEBUG_G(_ah, __m, ...) #endif /* AH_DEBUG */ /* Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Fri Sep 30 05:17:57 2011 (r225883) @@ -169,7 +169,7 @@ isEepromValid(struct ath_hal *ah) if (regDomainPairs[i].regDmnEnum == rd) return AH_TRUE; } - HALDEBUG_G(ah, HAL_DEBUG_REGDOMAIN, + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: invalid regulatory domain/country code 0x%x\n", __func__, rd); return AH_FALSE; } @@ -613,7 +613,7 @@ ath_hal_mapgsm(int sku, int freq) return 1544 + freq; if (sku == SKU_SR9) return 3344 - freq; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot map freq %u unknown gsm sku %u\n", __func__, freq, sku); return freq; Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -182,14 +182,14 @@ ar5210Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; int i; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: devid 0x%x sc %p st %p sh %p\n", __func__, devid, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5210)); if (ahp == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: no memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -201,13 +201,13 @@ ar5211Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5211)); if (ahp == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5112.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5112.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5212/ar5112.c Fri Sep 30 05:17:57 2011 (r225883) @@ -611,7 +611,7 @@ getFullPwrTable(uint16_t numPcdacs, uint uint16_t idxR = 1; if (numPcdacs < 2) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: at least 2 pcdac values needed [%d]\n", __func__, numPcdacs); return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -319,13 +319,13 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -71,13 +71,13 @@ ar5312Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -246,7 +246,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ @@ -255,7 +255,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s sizeof(ar5416Addac) ); if (ahp5416 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -78,13 +78,13 @@ ar9130Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -123,13 +123,13 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -153,13 +153,13 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s int8_t pwr_table_offset; uint8_t pwr; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9280 = ath_hal_malloc(sizeof (struct ath_hal_9280)); if (ahp9280 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -118,13 +118,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9285 = ath_hal_malloc(sizeof (struct ath_hal_9285)); if (ahp9285 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri Sep 30 04:55:23 2011 (r225882) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri Sep 30 05:17:57 2011 (r225883) @@ -119,13 +119,13 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s HAL_BOOL rfStatus; int8_t pwr_table_offset; - HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9287 = ath_hal_malloc(sizeof (struct ath_hal_9287)); if (ahp9287 == AH_NULL) { - HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 08:16:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 834FA1065670; Fri, 30 Sep 2011 08:16:31 +0000 (UTC) Date: Fri, 30 Sep 2011 08:16:31 +0000 From: Alexander Best To: "Bjoern A. Zeeb" Message-ID: <20110930081631.GA2005@freebsd.org> References: <201109280847.p8S8lIHV063682@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109280847.p8S8lIHV063682@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 08:16:31 -0000 On Wed Sep 28 11, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Sep 28 08:47:17 2011 > New Revision: 225827 > URL: http://svn.freebsd.org/changeset/base/225827 > > Log: > Fix handling of corrupt compress(1)ed data. [11:04] a thread on freebsd-questions@ indicates that the changes to uipc_usrreq.c broke support for flash. the thread's subject line is "FreeBSD 9-Beta3 and FlashPlayer". cheers. alex > > Add missing length checks on unix socket addresses. [11:05] > > Approved by: so (cperciva) > Approved by: re (kensmith) > Security: FreeBSD-SA-11:04.compress > Security: CVE-2011-2895 [11:04] > Security: FreeBSD-SA-11:05.unix > > Modified: > head/sys/kern/uipc_usrreq.c > head/usr.bin/compress/zopen.c > head/usr.bin/gzip/zuncompress.c > > Changes in other areas also in this revision: > Modified: > releng/7.3/UPDATING > releng/7.3/sys/conf/newvers.sh > releng/7.3/sys/kern/uipc_usrreq.c > releng/7.3/usr.bin/compress/zopen.c > releng/7.3/usr.bin/gzip/zuncompress.c > releng/7.4/UPDATING > releng/7.4/sys/conf/newvers.sh > releng/7.4/sys/kern/uipc_usrreq.c > releng/7.4/usr.bin/compress/zopen.c > releng/7.4/usr.bin/gzip/zuncompress.c > releng/8.1/UPDATING > releng/8.1/sys/conf/newvers.sh > releng/8.1/sys/kern/uipc_usrreq.c > releng/8.1/usr.bin/compress/zopen.c > releng/8.1/usr.bin/gzip/zuncompress.c > releng/8.2/UPDATING > releng/8.2/sys/conf/newvers.sh > releng/8.2/sys/kern/uipc_usrreq.c > releng/8.2/usr.bin/compress/zopen.c > releng/8.2/usr.bin/gzip/zuncompress.c > stable/7/sys/kern/uipc_usrreq.c > stable/7/usr.bin/compress/zopen.c > stable/7/usr.bin/gzip/zuncompress.c > stable/8/sys/kern/uipc_usrreq.c > stable/8/usr.bin/compress/zopen.c > stable/8/usr.bin/gzip/zuncompress.c > stable/9/sys/kern/uipc_usrreq.c > stable/9/usr.bin/compress/zopen.c > stable/9/usr.bin/gzip/zuncompress.c > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) > +++ head/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) > @@ -462,6 +462,8 @@ uipc_bind(struct socket *so, struct sock > unp = sotounpcb(so); > KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); > > + if (soun->sun_len > sizeof(struct sockaddr_un)) > + return (EINVAL); > namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); > if (namelen <= 0) > return (EINVAL); > @@ -1252,6 +1254,8 @@ unp_connect(struct socket *so, struct so > unp = sotounpcb(so); > KASSERT(unp != NULL, ("unp_connect: unp == NULL")); > > + if (nam->sa_len > sizeof(struct sockaddr_un)) > + return (EINVAL); > len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); > if (len <= 0) > return (EINVAL); > > Modified: head/usr.bin/compress/zopen.c > ============================================================================== > --- head/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) > +++ head/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) > @@ -486,7 +486,7 @@ zread(void *cookie, char *rbp, int num) > block_compress = maxbits & BLOCK_MASK; > maxbits &= BIT_MASK; > maxmaxcode = 1L << maxbits; > - if (maxbits > BITS) { > + if (maxbits > BITS || maxbits < 12) { > errno = EFTYPE; > return (-1); > } > @@ -513,17 +513,28 @@ zread(void *cookie, char *rbp, int num) > for (code = 255; code >= 0; code--) > tab_prefixof(code) = 0; > clear_flg = 1; > - free_ent = FIRST - 1; > - if ((code = getcode(zs)) == -1) /* O, untimely death! */ > - break; > + free_ent = FIRST; > + oldcode = -1; > + continue; > } > incode = code; > > - /* Special case for KwKwK string. */ > + /* Special case for kWkWk string. */ > if (code >= free_ent) { > + if (code > free_ent || oldcode == -1) { > + /* Bad stream. */ > + errno = EINVAL; > + return (-1); > + } > *stackp++ = finchar; > code = oldcode; > } > + /* > + * The above condition ensures that code < free_ent. > + * The construction of tab_prefixof in turn guarantees that > + * each iteration decreases code and therefore stack usage is > + * bound by 1 << BITS - 256. > + */ > > /* Generate output characters in reverse order. */ > while (code >= 256) { > @@ -540,7 +551,7 @@ middle: do { > } while (stackp > de_stack); > > /* Generate the new entry. */ > - if ((code = free_ent) < maxmaxcode) { > + if ((code = free_ent) < maxmaxcode && oldcode != -1) { > tab_prefixof(code) = (u_short) oldcode; > tab_suffixof(code) = finchar; > free_ent = code + 1; > > Modified: head/usr.bin/gzip/zuncompress.c > ============================================================================== > --- head/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) > +++ head/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) > @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) > zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; > zs->zs_maxbits &= BIT_MASK; > zs->zs_maxmaxcode = 1L << zs->zs_maxbits; > - if (zs->zs_maxbits > BITS) { > + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { > errno = EFTYPE; > return (-1); > } > @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) > } > zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; > > - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); > - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ > - return (0); /* Get out of here */ > - > - /* First code must be 8 bits = char. */ > - *bp++ = (u_char)zs->u.r.zs_finchar; > - count--; > + zs->u.r.zs_oldcode = -1; > zs->u.r.zs_stackp = de_stack; > > while ((zs->u.r.zs_code = getcode(zs)) > -1) { > @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) > zs->u.r.zs_code--) > tab_prefixof(zs->u.r.zs_code) = 0; > zs->zs_clear_flg = 1; > - zs->zs_free_ent = FIRST - 1; > - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ > - break; > + zs->zs_free_ent = FIRST; > + zs->u.r.zs_oldcode = -1; > + continue; > } > zs->u.r.zs_incode = zs->u.r.zs_code; > > /* Special case for KwKwK string. */ > if (zs->u.r.zs_code >= zs->zs_free_ent) { > + if (zs->u.r.zs_code > zs->zs_free_ent || > + zs->u.r.zs_oldcode == -1) { > + /* Bad stream. */ > + errno = EINVAL; > + return (-1); > + } > *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; > zs->u.r.zs_code = zs->u.r.zs_oldcode; > } > + /* > + * The above condition ensures that code < free_ent. > + * The construction of tab_prefixof in turn guarantees that > + * each iteration decreases code and therefore stack usage is > + * bound by 1 << BITS - 256. > + */ > > /* Generate output characters in reverse order. */ > while (zs->u.r.zs_code >= 256) { > @@ -302,7 +308,8 @@ middle: do { > } while (zs->u.r.zs_stackp > de_stack); > > /* Generate the new entry. */ > - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { > + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && > + zs->u.r.zs_oldcode != -1) { > tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; > tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; > zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 08:19:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A960A106566C; Fri, 30 Sep 2011 08:19:54 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B43498FC08; Fri, 30 Sep 2011 08:19:53 +0000 (UTC) Received: by fxg9 with SMTP id 9so3547527fxg.13 for ; Fri, 30 Sep 2011 01:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=gRsmBN0n7CgSSJnNye4bbBijc/T1o6AagFBzWKyXgAg=; b=AocSCwOxVEg3uCjOTxwUt766rN2ps3yfHoLHzDxhcA8MYbI+htW5yLSNZcxMFs4qbq kNJulWBLuJFhCvASHU1phgj5RSPytB6aTpX58gneIEGwEkWYnyjb2WVwYZoBtPiB1tpc fdWGvt2BDwJJKztiwlw+B5Wms5EJxvVX/3MiU= Received: by 10.223.44.90 with SMTP id z26mr3578946fae.28.1317370792676; Fri, 30 Sep 2011 01:19:52 -0700 (PDT) Received: from enapierala.whl (58.wheelsystems.com. [83.12.187.58]) by mx.google.com with ESMTPS id c5sm5719528fai.2.2011.09.30.01.19.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Sep 2011 01:19:51 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20110929185700.GA18684@freebsd.org> Date: Fri, 30 Sep 2011 10:19:49 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> <20110929185700.GA18684@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1244.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 08:19:54 -0000 Wiadomo=B6=E6 napisana przez Alexander Best w dniu 29 wrz 2011, o godz. = 20:57: > On Thu Sep 29 11, Edward Tomasz Napiera?a wrote: >> Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. = 14:14: >>> On Thu Sep 29 11, Edward Tomasz Napierala wrote: >>>> Author: trasz >>>> Date: Thu Sep 29 06:31:42 2011 >>>> New Revision: 225868 >>>> URL: http://svn.freebsd.org/changeset/base/225868 >>>>=20 >>>> Log: >>>> Make ps(1) automatically size its column widths. >>>=20 >>> cool to see this committed. :) >>>=20 >>> i think i wrote you about the two spaces between the "TT" and "TIME" = field >>> some time ago. you said that the "TT" entry can contain a postfix = "-". can >>> you describe a situation, where this can occur? i've never seen the = "TT" field >>> contain an entry larger than 2 chars. >>=20 >> Login via ssh, run "nohup sleep 1000 &", then logout. >=20 > maybe it would also be possible to introduce unit symbols for the = "vsz" and > "rss" fields. they are getting really huge on systems with a long = uptime > (*cough* mem leaks) and kilobyte granularity isn't really that great = when > those fields are nearing 1GB. I thought about it, but the "-h" option is already taken. -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 08:21:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA2CD1065673; Fri, 30 Sep 2011 08:21:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAF18FC17; Fri, 30 Sep 2011 08:21:38 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 872F425D3872; Fri, 30 Sep 2011 08:21:37 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id AD3D7BD3C84; Fri, 30 Sep 2011 08:21:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id R1p76kZFLEZ3; Fri, 30 Sep 2011 08:21:35 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8788CBD3C22; Fri, 30 Sep 2011 08:21:35 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20110930081631.GA2005@freebsd.org> Date: Fri, 30 Sep 2011 08:21:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2A9D712D-6152-45A2-80D2-8E1E04760150@FreeBSD.org> References: <201109280847.p8S8lIHV063682@svn.freebsd.org> <20110930081631.GA2005@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 08:21:38 -0000 On Sep 30, 2011, at 8:16 AM, Alexander Best wrote: > On Wed Sep 28 11, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Wed Sep 28 08:47:17 2011 >> New Revision: 225827 >> URL: http://svn.freebsd.org/changeset/base/225827 >>=20 >> Log: >> Fix handling of corrupt compress(1)ed data. [11:04] >=20 That's the wrong line to cite;-) You mean 11:05. > a thread on freebsd-questions@ indicates that the changes to = uipc_usrreq.c > broke support for flash. >=20 > the thread's subject line is "FreeBSD 9-Beta3 and FlashPlayer". And so does an email to security@, etc. already. Colin is aware of the = fact and looking into the changes needed. We obviously all missed that part. As far as I understood him there's a mix of "linux is different" and "the linuxolator was always buggy there and we luckily caught that now" = involved. Assume it will be handled some way properly. /bz --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 10:10:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id D441C106566B; Fri, 30 Sep 2011 10:10:27 +0000 (UTC) Date: Fri, 30 Sep 2011 10:10:27 +0000 From: Alexander Best To: "Bjoern A. Zeeb" Message-ID: <20110930101027.GA15019@freebsd.org> References: <201109280847.p8S8lIHV063682@svn.freebsd.org> <20110930081631.GA2005@freebsd.org> <2A9D712D-6152-45A2-80D2-8E1E04760150@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2A9D712D-6152-45A2-80D2-8E1E04760150@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 10:10:27 -0000 On Fri Sep 30 11, Bjoern A. Zeeb wrote: > > On Sep 30, 2011, at 8:16 AM, Alexander Best wrote: > > > On Wed Sep 28 11, Bjoern A. Zeeb wrote: > >> Author: bz > >> Date: Wed Sep 28 08:47:17 2011 > >> New Revision: 225827 > >> URL: http://svn.freebsd.org/changeset/base/225827 > >> > >> Log: > >> Fix handling of corrupt compress(1)ed data. [11:04] > > > > That's the wrong line to cite;-) You mean 11:05. oops. sorry. > > > a thread on freebsd-questions@ indicates that the changes to uipc_usrreq.c > > broke support for flash. > > > > the thread's subject line is "FreeBSD 9-Beta3 and FlashPlayer". > > And so does an email to security@, etc. already. Colin is aware of the fact > and looking into the changes needed. We obviously all missed that part. > As far as I understood him there's a mix of "linux is different" and > "the linuxolator was always buggy there and we luckily caught that now" involved. > > Assume it will be handled some way properly. thanks for the info. good to know people are working on it. :) cheers. alex > > /bz > > -- > Bjoern A. Zeeb You have to have visions! > Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 10:23:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37732106564A for ; Fri, 30 Sep 2011 10:23:00 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.info) Received: from o2.my.homeservicemail.com (o2.my.homeservicemail.com [67.228.50.52]) by mx1.freebsd.org (Postfix) with SMTP id F0E2B8FC13 for ; Fri, 30 Sep 2011 10:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=aRjfKzWkRbqLC2gGGv3sg414amE=; b=SByRJL+ZzLPWGtii90wH80xqP42+ VZd/1w+ku35uM2IBw6Y7NsUWcTY4Q75veFmcJIc3J4+ie8yV4PRjWDC8eyZ06MCN gGfj0VDdbb10OTJU+3rUEaI5wagAf/agVVY0A7nG5r+lcW8lknQ/h0fzLhp8xTnF rguOmSXOB2Twp4Y= Received: by 10.8.49.92 with SMTP id mf40.26473.4E857BDA6 Fri, 30 Sep 2011 03:20:42 -0500 (CDT) Received: from mail.tarsnap.com (unknown [10.9.180.5]) by mi7 (SG) with ESMTP id 4e857bda.4d2c.2e67d5c for ; Fri, 30 Sep 2011 03:20:42 -0500 (CST) Received: (qmail 76935 invoked from network); 30 Sep 2011 08:19:06 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by mail.tarsnap.com with ESMTP; 30 Sep 2011 08:19:06 -0000 Received: (qmail 31124 invoked from network); 30 Sep 2011 08:18:59 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 30 Sep 2011 08:18:59 -0000 Message-ID: <4E857B73.2050501@freebsd.org> Date: Fri, 30 Sep 2011 01:18:59 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.2) Gecko/20110914 Thunderbird/6.0.2 MIME-Version: 1.0 To: Alexander Best References: <201109280847.p8S8lIHV063682@svn.freebsd.org> <20110930081631.GA2005@freebsd.org> In-Reply-To: <20110930081631.GA2005@freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNH1hBSAA8VgH2A4oWYBu6jEm9NyrEZWzcrUzL2M6UhHveMTimWyE5eo3F/XJx96438UyF71hm2yLI9FfWaleNqaei4Bd9V2nu9otC55OmKuZoJhvM5N/aYMvSnqybDqhro= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 10:23:00 -0000 On 09/30/11 01:16, Alexander Best wrote: > a thread on freebsd-questions@ indicates that the changes to uipc_usrreq.c > broke support for flash. Correct. I just sent an email to -security and -emulation about this -- we accidentally exposed a long-standing linux emulation bug. A fix will be coming soon. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 18:20:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88977106566B; Fri, 30 Sep 2011 18:20:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78B058FC0C; Fri, 30 Sep 2011 18:20:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8UIKGXN081344; Fri, 30 Sep 2011 18:20:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8UIKGZH081342; Fri, 30 Sep 2011 18:20:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109301820.p8UIKGZH081342@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 30 Sep 2011 18:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225885 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 18:20:16 -0000 Author: bz Date: Fri Sep 30 18:20:16 2011 New Revision: 225885 URL: http://svn.freebsd.org/changeset/base/225885 Log: Fix an obvious bug from r186196 shadowing a variable, not correctly appending the new mbuf to the chain reference but possibly causing an mbuf nextpkt loop leading to a memory used after handoff (or having been freed) and leaking an mbuf here. Reviewed by: rwatson, brooks MFC after: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Sep 30 08:05:58 2011 (r225884) +++ head/sys/netinet6/nd6.c Fri Sep 30 18:20:16 2011 (r225885) @@ -2042,14 +2042,15 @@ nd6_output_lle(struct ifnet *ifp, struct if (*chain == NULL) *chain = m; else { - struct mbuf *m = *chain; + struct mbuf *mb; /* * append mbuf to end of deferred chain */ - while (m->m_nextpkt != NULL) - m = m->m_nextpkt; - m->m_nextpkt = m; + mb = *chain; + while (mb->m_nextpkt != NULL) + mb = mb->m_nextpkt; + mb->m_nextpkt = m; } return (error); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 20:06:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E26B71065672; Fri, 30 Sep 2011 20:06:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79BA8FC12; Fri, 30 Sep 2011 20:06:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8UK6N5j084668; Fri, 30 Sep 2011 20:06:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8UK6Nvd084666; Fri, 30 Sep 2011 20:06:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109302006.p8UK6Nvd084666@svn.freebsd.org> From: Marius Strobl Date: Fri, 30 Sep 2011 20:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225886 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 20:06:24 -0000 Author: marius Date: Fri Sep 30 20:06:23 2011 New Revision: 225886 URL: http://svn.freebsd.org/changeset/base/225886 Log: - Right-justify backslashes as suggested by style(9). - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly. Modified: head/sys/sparc64/include/asmacros.h Modified: head/sys/sparc64/include/asmacros.h ============================================================================== --- head/sys/sparc64/include/asmacros.h Fri Sep 30 18:20:16 2011 (r225885) +++ head/sys/sparc64/include/asmacros.h Fri Sep 30 20:06:23 2011 (r225886) @@ -49,98 +49,98 @@ /* * Atomically decrement an integer in memory. */ -#define ATOMIC_DEC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: sub r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_DEC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: sub r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically increment an integer in memory. */ -#define ATOMIC_INC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically increment an u_long in memory. + * Atomically increment a long in memory. */ -#define ATOMIC_INC_ULONG(r1, r2, r3) \ - ldx [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_LONG(r1, r2, r3) \ + ldx [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically clear a number of bits of an integer in memory. */ -#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ - lduw [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ + lduw [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically clear a number of bits of an u_long in memory. + * Atomically clear a number of bits of a long in memory. */ -#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ - ldx [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 #define PCPU(member) PCPU_REG + PC_ ## member -#define PCPU_ADDR(member, reg) \ +#define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg -#define DEBUGGER() \ +#define DEBUGGER() \ ta %xcc, 1 -#define PANIC(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call panic ; \ +#define PANIC(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call panic ; \ nop #ifdef INVARIANTS -#define KASSERT(r1, msg) \ - brnz,pt r1, 8f ; \ - nop ; \ - PANIC(msg, r1) ; \ +#define KASSERT(r1, msg) \ + brnz,pt r1, 8f ; \ + nop ; \ + PANIC(msg, r1) ; \ 8: #else #define KASSERT(r1, msg) #endif -#define PUTS(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call printf ; \ +#define PUTS(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call printf ; \ nop #define _ALIGN_DATA .align 8 -#define DATA(name) \ - .data ; \ - _ALIGN_DATA ; \ - .globl name ; \ - .type name, @object ; \ +#define DATA(name) \ + .data ; \ + _ALIGN_DATA ; \ + .globl name ; \ + .type name, @object ; \ name: #define EMPTY From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 20:13:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED2A9106566C; Fri, 30 Sep 2011 20:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCD7C8FC0A; Fri, 30 Sep 2011 20:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8UKDpV2084916; Fri, 30 Sep 2011 20:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8UKDpaL084914; Fri, 30 Sep 2011 20:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109302013.p8UKDpaL084914@svn.freebsd.org> From: Marius Strobl Date: Fri, 30 Sep 2011 20:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225887 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 20:13:52 -0000 Author: marius Date: Fri Sep 30 20:13:51 2011 New Revision: 225887 URL: http://svn.freebsd.org/changeset/base/225887 Log: Use the extended integer condition code when comparing 64-bit values. Given that ATOMIC_INC_LONG currently is unused this happened to not be fatal. Modified: head/sys/sparc64/include/asmacros.h Modified: head/sys/sparc64/include/asmacros.h ============================================================================== --- head/sys/sparc64/include/asmacros.h Fri Sep 30 20:06:23 2011 (r225886) +++ head/sys/sparc64/include/asmacros.h Fri Sep 30 20:13:51 2011 (r225887) @@ -76,7 +76,7 @@ 9: add r2, 1, r3 ; \ casxa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ + bne,pn %xcc, 9b ; \ mov r3, r2 /* From owner-svn-src-head@FreeBSD.ORG Fri Sep 30 20:23:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6AC4106566B; Fri, 30 Sep 2011 20:23:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67FE8FC15; Fri, 30 Sep 2011 20:23:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8UKNIiC085307; Fri, 30 Sep 2011 20:23:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8UKNIvp085305; Fri, 30 Sep 2011 20:23:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109302023.p8UKNIvp085305@svn.freebsd.org> From: Marius Strobl Date: Fri, 30 Sep 2011 20:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225888 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 20:23:18 -0000 Author: marius Date: Fri Sep 30 20:23:18 2011 New Revision: 225888 URL: http://svn.freebsd.org/changeset/base/225888 Log: Add a comment about why contrary to what once would think running all of userland with total store order actually is appropriate. Modified: head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Sep 30 20:13:51 2011 (r225887) +++ head/sys/sparc64/sparc64/machdep.c Fri Sep 30 20:23:18 2011 (r225888) @@ -1015,6 +1015,10 @@ exec_setregs(struct thread *td, struct i tf->tf_out[6] = sp - SPOFF - sizeof(struct frame); tf->tf_tnpc = imgp->entry_addr + 4; tf->tf_tpc = imgp->entry_addr; + /* + * While we could adhere to the memory model indicated in the ELF + * header, it turns out that just always using TSO performs best. + */ tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO; td->td_retval[0] = tf->tf_out[0]; From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 00:11:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220541065670; Sat, 1 Oct 2011 00:11:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECA7E8FC08; Sat, 1 Oct 2011 00:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p910B3C8092089; Sat, 1 Oct 2011 00:11:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p910B31Y092087; Sat, 1 Oct 2011 00:11:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110010011.p910B31Y092087@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 00:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225889 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 00:11:04 -0000 Author: marius Date: Sat Oct 1 00:11:03 2011 New Revision: 225889 URL: http://svn.freebsd.org/changeset/base/225889 Log: In total store which we use for running the kernel and all of the userland atomic operations behave as if the were followed by a memory barrier so there's no need to include ones in the acquire variants of atomic(9). Removing these results a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing. Modified: head/sys/sparc64/include/atomic.h Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Fri Sep 30 20:23:18 2011 (r225888) +++ head/sys/sparc64/include/atomic.h Sat Oct 1 00:11:03 2011 (r225889) @@ -74,12 +74,16 @@ * * the return value of cas is used to avoid the extra reload. * - * The memory barriers provided by the acq and rel variants are intended - * to be sufficient for use of relaxed memory ordering. Due to the - * suggested assembly syntax of the membar operands containing a # - * character, they cannot be used in macros. The cmask and mmask bits + * We only include a memory barrier in the rel variants as in total store + * order which we use for running the kernel and all of the userland atomic + * loads and stores behave as if the were followed by a membar with a mask + * of #LoadLoad | #LoadStore | #StoreStore. In order to be also sufficient + * for use of relaxed memory ordering, the atomic_cas() in the acq variants + * additionally would have to be followed by a membar #LoadLoad | #LoadStore. + * Due to the suggested assembly syntax of the membar operands containing a + * # character, they cannot be used in macros. The cmask and mmask bits thus * are hard coded in machine/cpufunc.h and used here through macros. - * Hopefully sun will choose not to change the bit numbers. + * Hopefully the bit numbers won't change in the future. */ #define itype(sz) uint ## sz ## _t @@ -93,7 +97,6 @@ #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ v = atomic_cas(p, e, s, sz); \ - membar(LoadLoad | LoadStore); \ v; \ }) @@ -118,7 +121,6 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ t = atomic_op(p, op, v, sz); \ - membar(LoadLoad | LoadStore); \ t; \ }) @@ -135,7 +137,6 @@ #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ v = atomic_load(p, sz); \ - membar(LoadLoad | LoadStore); \ v; \ }) From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 00:22:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1FE3106564A; Sat, 1 Oct 2011 00:22:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C13378FC08; Sat, 1 Oct 2011 00:22:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p910MO4W092531; Sat, 1 Oct 2011 00:22:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p910MOsr092529; Sat, 1 Oct 2011 00:22:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110010022.p910MOsr092529@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 00:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225890 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 00:22:24 -0000 Author: marius Date: Sat Oct 1 00:22:24 2011 New Revision: 225890 URL: http://svn.freebsd.org/changeset/base/225890 Log: - Add protective parentheses to macros as far as possible. - Move {r,w,}mb() to the top of this file where they live on most of the other architectures. Modified: head/sys/sparc64/include/atomic.h Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Sat Oct 1 00:11:03 2011 (r225889) +++ head/sys/sparc64/include/atomic.h Sat Oct 1 00:22:24 2011 (r225890) @@ -33,6 +33,10 @@ #include +#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") +#define wmb() mb() +#define rmb() mb() + /* Userland needs different ASI's. */ #ifdef _KERNEL #define __ASI_ATOMIC ASI_N @@ -40,10 +44,6 @@ #define __ASI_ATOMIC ASI_P #endif -#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") -#define wmb() mb() -#define rmb() mb() - /* * Various simple arithmetic on memory which is atomic in the presence * of interrupts and multiple processors. See atomic(9) for details. @@ -88,30 +88,30 @@ #define itype(sz) uint ## sz ## _t -#define atomic_cas_32(p, e, s) casa(p, e, s, __ASI_ATOMIC) -#define atomic_cas_64(p, e, s) casxa(p, e, s, __ASI_ATOMIC) +#define atomic_cas_32(p, e, s) casa((p), (e), (s), __ASI_ATOMIC) +#define atomic_cas_64(p, e, s) casxa((p), (e), (s), __ASI_ATOMIC) #define atomic_cas(p, e, s, sz) \ - atomic_cas_ ## sz(p, e, s) + atomic_cas_ ## sz((p), (e), (s)) #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ v; \ }) #define atomic_cas_rel(p, e, s, sz) ({ \ itype(sz) v; \ membar(LoadStore | StoreStore); \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ v; \ }) #define atomic_op(p, op, v, sz) ({ \ itype(sz) e, r, s; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - s = e op v; \ - r = atomic_cas_ ## sz(p, e, s); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + s = e op (v); \ + r = atomic_cas_ ## sz((p), e, s); \ if (r == e) \ break; \ } \ @@ -120,30 +120,30 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ t; \ }) #define atomic_op_rel(p, op, v, sz) ({ \ itype(sz) t; \ membar(LoadStore | StoreStore); \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ t; \ }) #define atomic_load(p, sz) \ - atomic_cas(p, 0, 0, sz) + atomic_cas((p), 0, 0, sz) #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ - v = atomic_load(p, sz); \ + v = atomic_load((p), sz); \ v; \ }) #define atomic_load_clear(p, sz) ({ \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, 0, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, 0, sz); \ if (r == e) \ break; \ } \ @@ -152,8 +152,8 @@ #define atomic_store(p, v, sz) do { \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, v, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, (v), sz); \ if (r == e) \ break; \ } \ @@ -161,7 +161,7 @@ #define atomic_store_rel(p, v, sz) do { \ membar(LoadStore | StoreStore); \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } while (0) #define ATOMIC_GEN(name, ptype, vtype, atype, sz) \ @@ -169,109 +169,109 @@ static __inline vtype \ atomic_add_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, +, v, sz)); \ + return ((vtype)atomic_op((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, +, v, sz)); \ + return ((vtype)atomic_op_acq((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, +, v, sz)); \ + return ((vtype)atomic_op_rel((p), +, (v), sz)); \ } \ \ static __inline vtype \ atomic_clear_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, &, ~v, sz)); \ + return ((vtype)atomic_op((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, &, ~v, sz)); \ + return ((vtype)atomic_op_acq((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, &, ~v, sz)); \ + return ((vtype)atomic_op_rel((p), &, ~(v), sz)); \ } \ \ static __inline int \ atomic_cmpset_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_acq_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_acq(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_acq((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_rel_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_rel(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \ } \ \ static __inline vtype \ atomic_load_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas(p, 0, 0, sz)); \ + return ((vtype)atomic_cas((p), 0, 0, sz)); \ } \ static __inline vtype \ atomic_load_acq_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas_acq(p, 0, 0, sz)); \ + return ((vtype)atomic_cas_acq((p), 0, 0, sz)); \ } \ \ static __inline vtype \ atomic_readandclear_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_load_clear(p, sz)); \ + return ((vtype)atomic_load_clear((p), sz)); \ } \ \ static __inline vtype \ atomic_set_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, |, v, sz)); \ + return ((vtype)atomic_op((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, |, v, sz)); \ + return ((vtype)atomic_op_acq((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, |, v, sz)); \ + return ((vtype)atomic_op_rel((p), |, (v), sz)); \ } \ \ static __inline vtype \ atomic_subtract_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, -, v, sz)); \ + return ((vtype)atomic_op((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, -, v, sz)); \ + return ((vtype)atomic_op_acq((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, -, v, sz)); \ + return ((vtype)atomic_op_rel((p), -, (v), sz)); \ } \ \ static __inline void \ atomic_store_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } \ static __inline void \ atomic_store_rel_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store_rel(p, v, sz); \ + atomic_store_rel((p), (v), sz); \ } ATOMIC_GEN(int, u_int *, u_int, u_int, 32); From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 00:31:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C934106564A; Sat, 1 Oct 2011 00:31:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0248FC17; Sat, 1 Oct 2011 00:31:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p910VVFO092826; Sat, 1 Oct 2011 00:31:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p910VU8N092824; Sat, 1 Oct 2011 00:31:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110010031.p910VU8N092824@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 00:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225891 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 00:31:31 -0000 Author: marius Date: Sat Oct 1 00:31:30 2011 New Revision: 225891 URL: http://svn.freebsd.org/changeset/base/225891 Log: Re-reading the Schizo errata suggests that it's actually tolerable to also use the streaming buffer of pre version 5/revision 2.3 hardware as long as we stay away from context flushes (which iommu(4) so far doesn't take advantage of). OpenSolaris does the same. Modified: head/sys/sparc64/pci/schizo.c Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Sat Oct 1 00:22:24 2011 (r225890) +++ head/sys/sparc64/pci/schizo.c Sat Oct 1 00:31:30 2011 (r225891) @@ -501,7 +501,8 @@ schizo_attach(device_t dev) * Set up the IOMMU. Schizo, Tomatillo and XMITS all have * one per PBM. Schizo and XMITS additionally have a streaming * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's - * affected by several errata and basically unusable though. + * affected by several errata though. However, except for context + * flushes, taking advantage of it should be okay even with those. */ memcpy(&sc->sc_dma_methods, &iommu_dma_methods, sizeof(sc->sc_dma_methods)); @@ -509,8 +510,7 @@ schizo_attach(device_t dev) sc->sc_is.sis_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.sis_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.sis_is.is_sb[0] = sc->sc_is.sis_is.is_sb[1] = 0; - if (OF_getproplen(node, "no-streaming-cache") < 0 && - !(sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver < 5)) + if (OF_getproplen(node, "no-streaming-cache") < 0) sc->sc_is.sis_is.is_sb[0] = STX_PCI_STRBUF; #define TSBCASE(x) \ From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 05:56:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408741065922; Sat, 1 Oct 2011 05:56:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 302BA8FC2B; Sat, 1 Oct 2011 05:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p915uQId003018; Sat, 1 Oct 2011 05:56:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p915uQH6003016; Sat, 1 Oct 2011 05:56:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110010556.p915uQH6003016@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Oct 2011 05:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 05:56:26 -0000 Author: adrian Date: Sat Oct 1 05:56:25 2011 New Revision: 225892 URL: http://svn.freebsd.org/changeset/base/225892 Log: Disable using wait in cpu_idle() until a better solution to timer and interrupt handling can be implemented. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Oct 1 00:31:30 2011 (r225891) +++ head/sys/mips/mips/machdep.c Sat Oct 1 05:56:25 2011 (r225892) @@ -485,9 +485,24 @@ spinlock_exit(void) /* * call platform specific code to halt (until next interrupt) for the idle loop */ +/* + * This is disabled because of three issues: + * + * + By calling critical_enter(), any interrupt which occurs after that but + * before the wait instruction will be handled but not serviced (in the case + * of a netisr) because preemption is not allowed at this point; + * + Any fast interrupt handler which schedules an immediate or fast callout + * will not occur until the wait instruction is interrupted, as the clock + * has already been set by cpu_idleclock(); + * + There is currently no known way to atomically enable interrupts and call + * wait, which is how the i386/amd64 code gets around (1). Thus even if + * interrupts were disabled and reenabled just before the wait call, any + * interrupt that did occur may not interrupt wait. + */ void cpu_idle(int busy) { +#if 0 KASSERT((mips_rd_status() & MIPS_SR_INT_IE) != 0, ("interrupts disabled in idle process.")); KASSERT((mips_rd_status() & MIPS_INT_MASK) != 0, @@ -502,6 +517,7 @@ cpu_idle(int busy) cpu_activeclock(); critical_exit(); } +#endif } int From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 06:58:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7084D1065670; Sat, 1 Oct 2011 06:58:37 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id A7FAC8FC19; Sat, 1 Oct 2011 06:58:36 +0000 (UTC) Received: by wwe3 with SMTP id 3so3386843wwe.31 for ; Fri, 30 Sep 2011 23:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=OqEWCpKFty6Ae25hv3Rmm66PZJBydYXSJrpTFzy4cUk=; b=M2EHf6BSVjSEYxts/FNiaaJSKqZ7DF4s4jkUcvE7M5lywehJyFJpXS1wC7V5Dp/4tC sDemUNY+22hDOwrQ2arLr3UWXU8Wq0W1d9AlNxWOj4MY8CreZTL6XvKDMcc3qkjVEY63 OVZer1ZI/wcOZsJVeMcmUy7jrXfG61lJtj5ac= MIME-Version: 1.0 Received: by 10.216.131.67 with SMTP id l45mr10342207wei.26.1317450629095; Fri, 30 Sep 2011 23:30:29 -0700 (PDT) Sender: c.jayachandran@gmail.com Received: by 10.216.154.5 with HTTP; Fri, 30 Sep 2011 23:30:29 -0700 (PDT) In-Reply-To: <201110010556.p915uQH6003016@svn.freebsd.org> References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 12:00:29 +0530 X-Google-Sender-Auth: 5HfVmas3awecmU9_aedZ6Urq9-M Message-ID: From: "Jayachandran C." To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 06:58:37 -0000 Hi Adrian, On Sat, Oct 1, 2011 at 11:26 AM, Adrian Chadd wrote: > Author: adrian > Date: Sat Oct =A01 05:56:25 2011 > New Revision: 225892 > URL: http://svn.freebsd.org/changeset/base/225892 > > Log: > =A0Disable using wait in cpu_idle() until a better solution to timer and > =A0interrupt handling can be implemented. Taking out the whole thing looks like an overkill here - this is especially bad on XLR where busy wait on a hardware thread will take away cycles from the other hardware threads. The better workaround would be to revert to the version before r216862, which does not have the critical_enter/cpu_idleclock. JC. From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 07:09:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEFAB106564A; Sat, 1 Oct 2011 07:09:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3755D8FC14; Sat, 1 Oct 2011 07:09:17 +0000 (UTC) Received: by ywp17 with SMTP id 17so2679230ywp.13 for ; Sat, 01 Oct 2011 00:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=PSGxS5gT+W8SuRT5l8qBmw4epbm1DdO3/lfjYyfw1uA=; b=eJ7WqAYk20akEYVkXeRhj0ooYoEhZ93vwB0c/1QfWzMLxbVCiMQR2lKufOAMsuKskM P+fvRqlAVUkdgPxxAU1A6jfkiwwwSNv3wh0LOH+weOmYGyWYT6R7eEt0vck4AlbhdItq 4lgZoAO5d1XAtb8NMu/OxOovzegLJRQ3Iijpk= MIME-Version: 1.0 Received: by 10.236.129.165 with SMTP id h25mr19951029yhi.38.1317452957546; Sat, 01 Oct 2011 00:09:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Sat, 1 Oct 2011 00:09:17 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 15:09:17 +0800 X-Google-Sender-Auth: USs0jpW0mdDTdhFb-1Tq3N_G4Rc Message-ID: From: Adrian Chadd To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 07:09:18 -0000 Reverting it unfortunately doesn't help; it messes up the event timer stuff. I'd like to see a more permanent solution. What I suggest we do moving forward is: * create a function pointer setup, like what i386 does * override it per-platform and per-chipset, once we know what the correct behaviour should be. Are you able to figure out how to achieve correct timer/interrupt/wait handling on XLR? Adrian From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 07:21:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ECF8106566C; Sat, 1 Oct 2011 07:21:23 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 24F738FC08; Sat, 1 Oct 2011 07:21:21 +0000 (UTC) Received: by wyj26 with SMTP id 26so2358498wyj.13 for ; Sat, 01 Oct 2011 00:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=fJJqvSsWjQc48JiU1eI+Zu+sW7vBeQODqjuACWQJfTc=; b=WXM3Uu6M0idKYOeCXESlTSMDGxvvTuwpc34ds3Y6AA0Cnu4DLKyJOAR8N1bL6qrjk6 5nP120AiH/jOeLllXDhFk7ZIb8TlDVNc/C7Tv0xdvfOZU0dVWWO+TzNN12rYaCdzeqqz UxpA32e9oCnzRWX0kCZG8+pRBsKD/T4hSaabE= MIME-Version: 1.0 Received: by 10.216.230.67 with SMTP id i45mr715447weq.56.1317453681056; Sat, 01 Oct 2011 00:21:21 -0700 (PDT) Sender: c.jayachandran@gmail.com Received: by 10.216.154.5 with HTTP; Sat, 1 Oct 2011 00:21:20 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 12:51:20 +0530 X-Google-Sender-Auth: bGXSU-waAlAVlUdJMcDH6qA5F5Q Message-ID: From: "Jayachandran C." To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 07:21:23 -0000 On Sat, Oct 1, 2011 at 12:39 PM, Adrian Chadd wrote: > Reverting it unfortunately doesn't help; it messes up the event timer stuff. I would like to understand this, reverting r216862 would take out the critical_enter() and cpu_idleclock() which would keep the timer interrupts coming is as usual, this should not affect the event timer. > I'd like to see a more permanent solution. What I suggest we do moving > forward is: > > * create a function pointer setup, like what i386 does > * override it per-platform and per-chipset, once we know what the > correct behaviour should be. > > Are you able to figure out how to achieve correct timer/interrupt/wait > handling on XLR? I'm not aware of any platforms which provide an equivalent of 'sti', so going for an implementation per platform may not help. JC. From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 08:50:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0E81065672; Sat, 1 Oct 2011 08:50:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4D60B8FC18; Sat, 1 Oct 2011 08:50:56 +0000 (UTC) Received: by vws11 with SMTP id 11so2637804vws.13 for ; Sat, 01 Oct 2011 01:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=j1Ow5aVxc4AG8vCbipX2HAlssnLILNYmvTH0r+tocqQ=; b=Kx2TYauz8fu9aMVpV+juOKxsDLHT4zVdZtKCArdTSCxx2ZoxSLblfvhFH/HG5PcYaM MEHJI2sHOqNU2WCL7gJWrYu/kaLPbrI8BvWs9qXvLPkIB1P1vze+PA/HG+3BoY1lW/4j 8Wsh/Q0l8/7ReTWa8p/GroQ0KQol7pswLUh5Y= MIME-Version: 1.0 Received: by 10.52.68.203 with SMTP id y11mr2901300vdt.462.1317459055567; Sat, 01 Oct 2011 01:50:55 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.161.138 with HTTP; Sat, 1 Oct 2011 01:50:55 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 16:50:55 +0800 X-Google-Sender-Auth: rDBbFlgcRf85jmXUkq0yopvpp6g Message-ID: From: Adrian Chadd To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 08:50:56 -0000 On 1 October 2011 15:21, Jayachandran C. wrote: > I would like to understand this, reverting r216862 would take out the > critical_enter() and cpu_idleclock() which would keep the timer > interrupts coming is as usual, this should not affect the event timer. Because the fundamental problem still exists w/out preemption - netisr/taskqueue scheduling doesn't happen if it happens just before the wait call. I haven't verified that mav's timer stuff does the correct thing by configuring the clock timer to occur every 1000hz in this instance. I kinda hope so. If I flip on preemption, then this may be fixed, but flipping on preemption causes other issues on the single-core MIPS boards that I've used when doing high-throughput 11n NIC testing. I don't (yet) know why. In any case, I think it's worth writing per-platform/per-chip cpu_idle() functions and set it up at boot/probe time. I'll happy do it if you're happy to do the digging with XLR to ensure this is all handled accurately in that instance. I just don't have the deep MIPS clue needed to ensure this is all correct and noone really piped up to come up with a better solution. I really want to see this all work correctly. :) Adrian From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 08:54:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21214106564A; Sat, 1 Oct 2011 08:54:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 895D08FC1C; Sat, 1 Oct 2011 08:54:54 +0000 (UTC) Received: by vcbf13 with SMTP id f13so2630836vcb.13 for ; Sat, 01 Oct 2011 01:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=y8L1U2w3rK/oMROABPCkl5ap26qgV1aI7Zl0387MpRg=; b=voyzUV9CJudyLS2He/4+glEZlyV/qxgGbLjzwe7tjfC7ogFHzTfaNU3GzW6jw3NkqB WdnzdfaM79yWYhKOjY0KHkcUY0LDr+OhVh/DmzqNlSMwe+G0IbF/5RLFNi/ZQDlA331J aioyA8C4HsiK2rbVBdXVWPldP28WfvDkFXmfw= MIME-Version: 1.0 Received: by 10.52.98.167 with SMTP id ej7mr2366992vdb.529.1317459293713; Sat, 01 Oct 2011 01:54:53 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.161.138 with HTTP; Sat, 1 Oct 2011 01:54:53 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 16:54:53 +0800 X-Google-Sender-Auth: PxoeIInuPAZFKHE6FlwEeY2UoLQ Message-ID: From: Adrian Chadd To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 08:54:55 -0000 .. and somehow linux mips code does do a variety of WAIT-y things; how is it they don't have the interrupt handling issues we do? Is it because they're doing preemption? If so, how do they accurately handle hz clock pulses when an interrupt may preempt things just before that wait instruction occurs? Adrian From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 09:16:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638C0106566B; Sat, 1 Oct 2011 09:16:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F608FC13; Sat, 1 Oct 2011 09:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p919G7sT008933; Sat, 1 Oct 2011 09:16:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p919G7f2008931; Sat, 1 Oct 2011 09:16:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201110010916.p919G7f2008931@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Oct 2011 09:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225893 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 09:16:07 -0000 Author: ed Date: Sat Oct 1 09:16:07 2011 New Revision: 225893 URL: http://svn.freebsd.org/changeset/base/225893 Log: Correct column with for device numbers made in previous change. The device number should be displayed using only five columns -- not eight. Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Sat Oct 1 05:56:25 2011 (r225892) +++ head/usr.bin/fstat/fstat.c Sat Oct 1 09:16:07 2011 (r225893) @@ -441,7 +441,7 @@ print_vnode_info(struct procstat *procst } if (nflg) - printf(" %#8jx", (uintmax_t)vn.vn_fsid); + printf(" %#5jx", (uintmax_t)vn.vn_fsid); else if (vn.vn_mntdir != NULL) (void)printf(" %-8s", vn.vn_mntdir); From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 10:18:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA51B1065674; Sat, 1 Oct 2011 10:18:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA74A8FC17; Sat, 1 Oct 2011 10:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91AItcq010924; Sat, 1 Oct 2011 10:18:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91AItDp010921; Sat, 1 Oct 2011 10:18:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011018.p91AItDp010921@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 10:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225894 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 10:18:55 -0000 Author: kib Date: Sat Oct 1 10:18:55 2011 New Revision: 225894 URL: http://svn.freebsd.org/changeset/base/225894 Log: The sigwait(3) function shall not return EINTR, according to the POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7 contains the wrapper sigwait(3) which hides EINTR from callers. The EINTR return is used by libthr to handle required cancellation point in the sigwait(3). To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and earlier, to have right ABI for sigwait(3), transform EINTR return from sigwait(2) into ERESTART. Discussed with: davidxu MFC after: 1 week Modified: head/sys/kern/kern_sig.c head/sys/sys/param.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Oct 1 09:16:07 2011 (r225893) +++ head/sys/kern/kern_sig.c Sat Oct 1 10:18:55 2011 (r225894) @@ -1094,6 +1094,8 @@ sys_sigwait(struct thread *td, struct si error = kern_sigtimedwait(td, set, &ksi, NULL); if (error) { + if (error == EINTR && td->td_proc->p_osrel < P_OSREL_SIGWAIT) + error = ERESTART; if (error == ERESTART) return (error); td->td_retval[0] = error; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Oct 1 09:16:07 2011 (r225893) +++ head/sys/sys/param.h Sat Oct 1 10:18:55 2011 (r225894) @@ -61,6 +61,7 @@ #define __FreeBSD_version 1000000 /* Master, propagated to newvers */ #ifdef _KERNEL +#define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 #endif From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 10:23:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00CB106564A; Sat, 1 Oct 2011 10:23:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1F80A8FC08; Sat, 1 Oct 2011 10:23:00 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p91AMtjh050054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Oct 2011 13:22:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p91AMttS064248; Sat, 1 Oct 2011 13:22:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p91AMtmU064247; Sat, 1 Oct 2011 13:22:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Oct 2011 13:22:55 +0300 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20111001102255.GC1511@deviant.kiev.zoral.com.ua> References: <201110011018.p91AItDp010921@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CYvw4a70jcGnzNfi" Content-Disposition: inline In-Reply-To: <201110011018.p91AItDp010921@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r225894 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 10:23:01 -0000 --CYvw4a70jcGnzNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 01, 2011 at 10:18:55AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Oct 1 10:18:55 2011 > New Revision: 225894 > URL: http://svn.freebsd.org/changeset/base/225894 >=20 > Log: > The sigwait(3) function shall not return EINTR, according to the > POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7 > contains the wrapper sigwait(3) which hides EINTR from callers. The r212405 will be merged to stable/8 shortly. > EINTR return is used by libthr to handle required cancellation point > in the sigwait(3). > =20 > To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and > earlier, to have right ABI for sigwait(3), transform EINTR return from > sigwait(2) into ERESTART. This leaves the static binaries linked against libc.a from a system with libc.so.N, where N < 7 or N =3D=3D 7 and does not contain r212405, with the broken sigwait(). More intrusive change is to allocate new syscall number for sigwait(2), and change old sigwait(2) to never return EINTR. Then, the static binaries linked on HEAD and stable/9 prior to introduction of the new sigwait syscall numbers will have broken cancellation at sigwait. I had this done, but sort of agreement we reached is to go with less intrusive commit you see. And before you ask, the story started from the real user report of a broken binary-only program that is not prepared to handle EINTR there. --CYvw4a70jcGnzNfi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6G6f8ACgkQC3+MBN1Mb4iJ5wCcD2XQJUtLmnDu00Su3uP1Hpud NyoAn3qAcKbac+hPO70tgtGoKBQhwCI3 =N9TP -----END PGP SIGNATURE----- --CYvw4a70jcGnzNfi-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 11:13:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D7F106566B; Sat, 1 Oct 2011 11:13:15 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3BD8FC13; Sat, 1 Oct 2011 11:13:13 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so3355444bkb.13 for ; Sat, 01 Oct 2011 04:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=ZDVQxfn2RQK6EipuEbyj1H1vzyLotzIWlKgu0zfkUrI=; b=T1vTeaGw6Z7aQx5PuXKMclztqaGU5qsy0Sb6fm0j0B6RogX+Qytqv2YBfZMiT/7cQ7 KU0ddv33YoAWJa7pgZ4SRelVwIQogVk/mxEsfR54E77fCngmaHJc2vOMgd294mbYahc1 2Js2ImkPgtwQ65ZePq5mSfHOjWE2OzFoMRPvw= Received: by 10.223.29.69 with SMTP id p5mr3530445fac.35.1317466178985; Sat, 01 Oct 2011 03:49:38 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id k26sm10976612fab.12.2011.10.01.03.49.37 (version=SSLv3 cipher=OTHER); Sat, 01 Oct 2011 03:49:38 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E86F033.9040305@FreeBSD.org> Date: Sat, 01 Oct 2011 13:49:23 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Adrian Chadd References: <201110010556.p915uQH6003016@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Jayachandran C." , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:13:15 -0000 Adrian Chadd wrote: > .. and somehow linux mips code does do a variety of WAIT-y things; how > is it they don't have the interrupt handling issues we do? > Is it because they're doing preemption? If so, how do they accurately > handle hz clock pulses when an interrupt may preempt things just > before that wait instruction occurs? I may be wrong, it was time ago, but I think I've seen they doing some timer stuff within each interrupt handler. FreeBSD neither has unified place to do it now, nor I much like to add some overhead to every possible interrupt in a system. Present implementation supposed to be a compromise. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 11:21:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B61D106566B; Sat, 1 Oct 2011 11:21:01 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 044638FC15; Sat, 1 Oct 2011 11:20:59 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so3362797bkb.13 for ; Sat, 01 Oct 2011 04:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=DtQJeCY9P9QbUsi6IK/VIbu4kg00+FPwPy7mTdHkJQI=; b=gG076iB8U1kNgOYlyTPl0RHuyL5AnbTdmcPLKYIUL+ezydAbjMfqzQpmVXwK/CrPRb iDNzeY+A+BuJ9IU+/cYKHaurLeKsVVdBaqS8PVe595cwePSUO1hJO0LvyX0lp7jODGCf LCEkPp307dSxuhOupY4y0ko7i5XR9sL+N2NTU= Received: by 10.223.46.89 with SMTP id i25mr20162849faf.34.1317468058768; Sat, 01 Oct 2011 04:20:58 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id k26sm11092788fab.12.2011.10.01.04.20.57 (version=SSLv3 cipher=OTHER); Sat, 01 Oct 2011 04:20:58 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E86F78B.7050707@FreeBSD.org> Date: Sat, 01 Oct 2011 14:20:43 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Adrian Chadd References: <201110010556.p915uQH6003016@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Jayachandran C." , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:21:01 -0000 Adrian Chadd wrote: > On 1 October 2011 15:21, Jayachandran C. wrote: > >> I would like to understand this, reverting r216862 would take out the >> critical_enter() and cpu_idleclock() which would keep the timer >> interrupts coming is as usual, this should not affect the event timer. > > I haven't verified that mav's timer stuff does the correct thing by > configuring the clock timer to occur every 1000hz in this instance. I > kinda hope so. When setting kern.eventtimer.idletick=1, you were effectively disabling cpu_idleclock()/cpu_activeclock() and you've properly received about 1127 timer interrupts per second (mix of 1000 of hz and 127 of stathz). Also when CPU is busy or has high interrupt/context switch rate, that happen automatically, so it definitely works. If you are talking about programming hardware timer for periodic 1000Hz rate, it doesn't happen automatically, because I doubt benefits it gives worth strict aliasing of hardclock() and statclock() it causes. If you like, you can do it manually via kern.eventtimer.periodic=1. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 12:19:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A790A106566B; Sat, 1 Oct 2011 12:19:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C64C8FC13; Sat, 1 Oct 2011 12:19:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91CJmTh016770; Sat, 1 Oct 2011 12:19:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91CJmTc016767; Sat, 1 Oct 2011 12:19:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201110011219.p91CJmTc016767@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Oct 2011 12:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225897 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 12:19:48 -0000 Author: ed Date: Sat Oct 1 12:19:48 2011 New Revision: 225897 URL: http://svn.freebsd.org/changeset/base/225897 Log: Reimplement ctermid(). Even though POSIX allows us to return simply /dev/tty as a pathname identifying the controlling terminal of the running process, it is nicer if this function were actually useful, by returning the actual pathname of the controlling terminal. Implement ctermid() by using the kern.devname sysctl to resolve the actual name of /dev/tty. Don't use devname(3), since it may return bogus strings like #C:0x123. Modified: head/lib/libc/gen/ctermid.3 head/lib/libc/gen/ctermid.c Modified: head/lib/libc/gen/ctermid.3 ============================================================================== --- head/lib/libc/gen/ctermid.3 Sat Oct 1 11:59:45 2011 (r225896) +++ head/lib/libc/gen/ctermid.3 Sat Oct 1 12:19:48 2011 (r225897) @@ -28,7 +28,7 @@ .\" @(#)ctermid.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd October 1, 2011 .Dt CTERMID 3 .Os .Sh NAME @@ -77,7 +77,8 @@ pointer, .Dv NULL is returned. .Pp -The current implementation simply returns +If no suitable lookup of the controlling terminal name can be performed, +this implementation returns .Ql /dev/tty . .Sh RETURN VALUES Upon successful completion, a Modified: head/lib/libc/gen/ctermid.c ============================================================================== --- head/lib/libc/gen/ctermid.c Sat Oct 1 11:59:45 2011 (r225896) +++ head/lib/libc/gen/ctermid.c Sat Oct 1 12:19:48 2011 (r225897) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2011 Ed Schouten + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +10,11 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -27,31 +24,47 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)ctermid.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); -#include +#include +#include +#include + +#include #include +#include #include +#define LEN_PATH_DEV (sizeof(_PATH_DEV) - 1) + char * ctermid(char *s) { - static char def[] = _PATH_TTY; - - if (s) { - bcopy(def, s, sizeof(_PATH_TTY)); - return(s); - } - return(def); + static char def[sizeof(_PATH_DEV) + SPECNAMELEN]; + struct stat sb; + size_t dlen; + int sverrno; + + if (s == NULL) { + s = def; + dlen = sizeof(def) - LEN_PATH_DEV; + } else + dlen = L_ctermid - LEN_PATH_DEV; + strcpy(s, _PATH_TTY); + + /* Attempt to perform a lookup of the actual TTY pathname. */ + sverrno = errno; + if (stat(_PATH_TTY, &sb) == 0 && S_ISCHR(sb.st_mode)) + (void)sysctlbyname("kern.devname", s + LEN_PATH_DEV, + &dlen, &sb.st_rdev, sizeof(sb.st_rdev)); + errno = sverrno; + return (s); } - char * ctermid_r(char *s) { - return (s) ? ctermid(s) : NULL; + + return (s != NULL ? ctermid(s) : NULL); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 12:43:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A7D19106566C; Sat, 1 Oct 2011 12:43:23 +0000 (UTC) Date: Sat, 1 Oct 2011 12:43:23 +0000 From: Alexander Best To: Edward Tomasz Napiera?a Message-ID: <20111001124323.GA14050@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <11B87D92-4C1E-4AD9-BEC5-13D28B022FB1@FreeBSD.org> <20110929185700.GA18684@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 12:43:23 -0000 On Fri Sep 30 11, Edward Tomasz Napiera?a wrote: > Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 20:57: > > On Thu Sep 29 11, Edward Tomasz Napiera?a wrote: > >> Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 14:14: > >>> On Thu Sep 29 11, Edward Tomasz Napierala wrote: > >>>> Author: trasz > >>>> Date: Thu Sep 29 06:31:42 2011 > >>>> New Revision: 225868 > >>>> URL: http://svn.freebsd.org/changeset/base/225868 > >>>> > >>>> Log: > >>>> Make ps(1) automatically size its column widths. > >>> > >>> cool to see this committed. :) > >>> > >>> i think i wrote you about the two spaces between the "TT" and "TIME" field > >>> some time ago. you said that the "TT" entry can contain a postfix "-". can > >>> you describe a situation, where this can occur? i've never seen the "TT" field > >>> contain an entry larger than 2 chars. > >> > >> Login via ssh, run "nohup sleep 1000 &", then logout. > > > > maybe it would also be possible to introduce unit symbols for the "vsz" and > > "rss" fields. they are getting really huge on systems with a long uptime > > (*cough* mem leaks) and kilobyte granularity isn't really that great when > > those fields are nearing 1GB. > > I thought about it, but the "-h" option is already taken. maybe making unit symbols the default behavior and introducing a -k flag, which toggles between the unit symbol mode and the traditional kilobyte mode? we could then add an envar $PS, so users can set PS=-k to restore the historic ps(1) behavior. a note to the BUGS section could then be added, similar to the note in top(1)'s BUGS section regarding the -I flag, which explains that ps(1)es semantics were changed, but can be restored via PS=-k. cheers. alex > > -- > If you cut off my head, what would I say? Me and my head, or me and my body? From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 13:06:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8634106564A; Sat, 1 Oct 2011 13:06:44 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 8D19F8FC0C; Sat, 1 Oct 2011 13:06:44 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id F41342A28CE3; Sat, 1 Oct 2011 15:06:43 +0200 (CEST) Date: Sat, 1 Oct 2011 15:06:43 +0200 From: Ed Schouten To: Alexander Best Message-ID: <20111001130643.GC91943@hoeg.nl> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JGq01gMRpXZxBGpH" Content-Disposition: inline In-Reply-To: <20110929121457.GA53600@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:06:44 -0000 --JGq01gMRpXZxBGpH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alexander Best , 20110929 14:14: > i think i wrote you about the two spaces between the "TT" and "TIME" field > some time ago. you said that the "TT" entry can contain a postfix "-". can > you describe a situation, where this can occur? i've never seen the "TT" = field > contain an entry larger than 2 chars. Also, it would be better if we replaced the "??" string with "-". When we print "??", it actually means: this process has no controlling terminal, not that we don't know which TTY it is. --=20 Ed Schouten WWW: http://80386.nl/ --JGq01gMRpXZxBGpH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOhxBjAAoJEG5e2P40kaK7gHwP/149fbKOPo8BG0pHMNZE9ozN 1MxGcDk5GrY/5jFcPaUqpppAbv6K4uL2pA36aDgAIJNGwwiRUAIczDFM/vmEpAtb VTcqNqWdZ1eeDgaryc82F/C3oJyKJQAMcGHHoiKx4elL9yG522vh7GTiLmyl3fUB eryiYrbmk5TlZGQG7+8NUK9wM5f0Hpm3XyppoyeKGJR+xhFxpI85NU/djVUdOBtc Ko57VMpz/0POO3KRWGRbZKavFaj7wAdqW0tLnDRkZrbrW110R/ZbmlekmSnIz5M+ i6jRb2BkHf6rvk1XhSjGKidGJzWJTxZFdsxTFm86bJPISpDwrsbMqgN7/z4+kLKJ SjlrQQBE1eLzYW4pR94Ks9NZoUnJVuSOj9gKlLabk5jcX5TffpMGN9CnySnK/lwe nGMCK5EAExM65NT7OxQJqAyJzreqxo+NTiEg2AzpI64gBY3Ec/WWqYt3Diw/hywI TkSLB+qjJtPbpUMytR/LqvqFfIESqN3HsmbMcVa3EbqbBvn4+Np3KKj23acfUMZz G35fkUXpZeZOUsFxodKMOleN+3FjF+ZTgUUvDJWreNMuMcmFWlOm8XO/zABZKx3U 2ZtJkjqLbflAzz+I8uon53kIoizd0FUpZEfbf1tmMk7rhFLmMsR9C5tiYdDa0xsp edgjyuXC93BjpnbNhYvO =/NvX -----END PGP SIGNATURE----- --JGq01gMRpXZxBGpH-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 13:11:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE60D1065677; Sat, 1 Oct 2011 13:11:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE5938FC22; Sat, 1 Oct 2011 13:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DBTLb018421; Sat, 1 Oct 2011 13:11:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91DBTIx018419; Sat, 1 Oct 2011 13:11:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110011311.p91DBTIx018419@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 13:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225899 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:11:29 -0000 Author: marius Date: Sat Oct 1 13:11:29 2011 New Revision: 225899 URL: http://svn.freebsd.org/changeset/base/225899 Log: Also allocate space for the PIL counters. Given that no machine actually uses IV_MAX interrupt vectors this wasn't a problem in practice though. Modified: head/sys/sparc64/sparc64/exception.S Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Sat Oct 1 12:35:09 2011 (r225898) +++ head/sys/sparc64/sparc64/exception.S Sat Oct 1 13:11:29 2011 (r225899) @@ -373,15 +373,15 @@ END(rsf_fatal) _ALIGN_DATA .globl intrnames, sintrnames intrnames: - .space IV_MAX * (MAXCOMLEN + 1) + .space (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) sintrnames: - .quad IV_MAX * (MAXCOMLEN + 1) + .quad (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) .globl intrcnt, sintrcnt intrcnt: - .space IV_MAX * 8 + .space (IV_MAX + PIL_MAX) * 8 sintrcnt: - .quad IV_MAX * 8 + .quad (IV_MAX + PIL_MAX) * 8 .text From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 13:16:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5705106566B; Sat, 1 Oct 2011 13:16:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA7B38FC14; Sat, 1 Oct 2011 13:16:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DG1KT018598; Sat, 1 Oct 2011 13:16:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91DG1o5018596; Sat, 1 Oct 2011 13:16:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110011316.p91DG1o5018596@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 13:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225900 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:16:02 -0000 Author: marius Date: Sat Oct 1 13:16:01 2011 New Revision: 225900 URL: http://svn.freebsd.org/changeset/base/225900 Log: Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any purpose. Modified: head/sys/sparc64/sparc64/genassym.c Modified: head/sys/sparc64/sparc64/genassym.c ============================================================================== --- head/sys/sparc64/sparc64/genassym.c Sat Oct 1 13:11:29 2011 (r225899) +++ head/sys/sparc64/sparc64/genassym.c Sat Oct 1 13:16:01 2011 (r225900) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SUN4U #include -#endif #include #include #include @@ -62,9 +60,7 @@ ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); ASSYM(_NCPUBITS, _NCPUBITS); -#ifdef SUN4U ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL); -#endif ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); @@ -82,21 +78,17 @@ ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M); #ifdef SMP ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); -#ifdef SUN4U ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); ASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick)); ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); #endif -#endif -#ifdef SUN4U ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size)); ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize)); ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size)); ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize)); -#endif ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); @@ -112,7 +104,6 @@ ASSYM(KTR_PARM5, offsetof(struct ktr_ent ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5])); ASSYM(TTE_SHIFT, TTE_SHIFT); -#ifdef SUN4U ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); @@ -132,7 +123,6 @@ ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MA ASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); -#endif ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); @@ -146,14 +136,12 @@ ASSYM(PC_IRFREE, offsetof(struct pcpu, p ASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt)); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); -#ifdef SUN4U ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap)); ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); -#endif ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next)); ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func)); @@ -161,7 +149,7 @@ ASSYM(IR_ARG, offsetof(struct intr_reque ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri)); ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec)); -#if defined(SUN4U) && defined(SMP) +#ifdef SMP ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa)); ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask)); @@ -239,14 +227,12 @@ ASSYM(TF_FPRS, offsetof(struct trapframe ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr)); ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); -#ifdef SUN4U ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); -#endif ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 13:33:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 988F8106570B; Sat, 1 Oct 2011 13:33:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D09D8FC1B; Sat, 1 Oct 2011 13:33:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DXFJg019445; Sat, 1 Oct 2011 13:33:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91DXFwq019443; Sat, 1 Oct 2011 13:33:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110011333.p91DXFwq019443@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Oct 2011 13:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225901 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:33:15 -0000 Author: marius Date: Sat Oct 1 13:33:14 2011 New Revision: 225901 URL: http://svn.freebsd.org/changeset/base/225901 Log: Remove obsolete macros. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Oct 1 13:16:01 2011 (r225900) +++ head/sys/sparc64/sparc64/pmap.c Sat Oct 1 13:33:14 2011 (r225901) @@ -100,12 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define PMAP_DEBUG - -#ifndef PMAP_SHPGPERPROC -#define PMAP_SHPGPERPROC 200 -#endif - /* XXX */ #include "opt_sched.h" #ifndef SCHED_4BSD From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 17:14:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 27A4C1065677; Sat, 1 Oct 2011 17:14:01 +0000 (UTC) Date: Sat, 1 Oct 2011 17:14:01 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20111001171401.GA47100@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111001130643.GC91943@hoeg.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 17:14:01 -0000 On Sat Oct 1 11, Ed Schouten wrote: > * Alexander Best , 20110929 14:14: > > i think i wrote you about the two spaces between the "TT" and "TIME" field > > some time ago. you said that the "TT" entry can contain a postfix "-". can > > you describe a situation, where this can occur? i've never seen the "TT" field > > contain an entry larger than 2 chars. > > Also, it would be better if we replaced the "??" string with "-". When > we print "??", it actually means: this process has no controlling > terminal, not that we don't know which TTY it is. good point. also i was thinking: if a process had a controlling terminal, but that terminal has been revoked, are users really interested to know what the name of that revoked terminal was? can't we just use "-"? is it important to know whether a process never had a controlling terminal, or had one at some point, but not anymore? also the ps(1) man page claims that a process running on console has a "TT" entry of "con". i've never seen such an entry. is this still correct? and the last point i'd like to make: looking at 'ps alx' on freebsd 7.x makes it easy to distinguish between ttys and pts'es, because they are names ttyvX and ttypX. looking at the same output under HEAD, all pts terminal descriptors have moved to /dev/pts/X. so they will not show up as pX, but merely as X. can't we tell ps to prefix anything coming from /dev/pts with a "p"? in this output: 1001 1780 1778 1 16 0 15956 3136 pause Is 0 0:00,02 /usr/local/bin/zsh users are supposed to know that the "0" stands for /dev/pts/0. imho 1001 1780 1778 1 16 0 15956 3136 pause Is p0 0:00,02 /usr/local/bin/zsh would be much better here (like under freebsd 7.x). cheers. alex > > -- > Ed Schouten > WWW: http://80386.nl/ From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 18:20:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0881F106564A; Sat, 1 Oct 2011 18:20:11 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39058FC13; Sat, 1 Oct 2011 18:20:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91IKA7s028723; Sat, 1 Oct 2011 18:20:10 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91IKAm8028719; Sat, 1 Oct 2011 18:20:10 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201110011820.p91IKAm8028719@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Oct 2011 18:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225906 - head/contrib/sendmail/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 18:20:11 -0000 Author: ume Date: Sat Oct 1 18:20:10 2011 New Revision: 225906 URL: http://svn.freebsd.org/changeset/base/225906 Log: Shut up warnings with Cyrus SASL 2.1.25. Spotted by: ache Tested by: ache Modified: head/contrib/sendmail/src/main.c head/contrib/sendmail/src/sendmail.h head/contrib/sendmail/src/usersmtp.c Modified: head/contrib/sendmail/src/main.c ============================================================================== --- head/contrib/sendmail/src/main.c Sat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/main.c Sat Oct 1 18:20:10 2011 (r225906) @@ -109,8 +109,8 @@ GIDSET_T InitialGidSet[NGROUPS_MAX]; #if SASL static sasl_callback_t srvcallbacks[] = { - { SASL_CB_VERIFYFILE, &safesaslfile, NULL }, - { SASL_CB_PROXY_POLICY, &proxy_policy, NULL }, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile, NULL }, + { SASL_CB_PROXY_POLICY, (sasl_callback_ft)&proxy_policy, NULL }, { SASL_CB_LIST_END, NULL, NULL } }; #endif /* SASL */ Modified: head/contrib/sendmail/src/sendmail.h ============================================================================== --- head/contrib/sendmail/src/sendmail.h Sat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/sendmail.h Sat Oct 1 18:20:10 2011 (r225906) @@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = "@(#) # if SASL == 2 || SASL >= 20000 # include +# include # include +# if SASL_VERSION_FULL < 0x020119 +typedef int (*sasl_callback_ft)(void); +# endif # else /* SASL == 2 || SASL >= 20000 */ # include # include +typedef int (*sasl_callback_ft)(void); # endif /* SASL == 2 || SASL >= 20000 */ # if defined(SASL_VERSION_MAJOR) && defined(SASL_VERSION_MINOR) && defined(SASL_VERSION_STEP) # define SASL_VERSION (SASL_VERSION_MAJOR * 10000) + (SASL_VERSION_MINOR * 100) + SASL_VERSION_STEP Modified: head/contrib/sendmail/src/usersmtp.c ============================================================================== --- head/contrib/sendmail/src/usersmtp.c Sat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/usersmtp.c Sat Oct 1 18:20:10 2011 (r225906) @@ -524,15 +524,15 @@ static int attemptauth __P((MAILER *, MC static sasl_callback_t callbacks[] = { - { SASL_CB_GETREALM, &saslgetrealm, NULL }, + { SASL_CB_GETREALM, (sasl_callback_ft)&saslgetrealm, NULL }, #define CB_GETREALM_IDX 0 - { SASL_CB_PASS, &getsecret, NULL }, + { SASL_CB_PASS, (sasl_callback_ft)&getsecret, NULL }, #define CB_PASS_IDX 1 - { SASL_CB_USER, &getsimple, NULL }, + { SASL_CB_USER, (sasl_callback_ft)&getsimple, NULL }, #define CB_USER_IDX 2 - { SASL_CB_AUTHNAME, &getsimple, NULL }, + { SASL_CB_AUTHNAME, (sasl_callback_ft)&getsimple, NULL }, #define CB_AUTHNAME_IDX 3 - { SASL_CB_VERIFYFILE, &safesaslfile, NULL }, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile, NULL }, #define CB_SAFESASL_IDX 4 { SASL_CB_LIST_END, NULL, NULL } }; From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 19:43:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32E81065743; Sat, 1 Oct 2011 19:43:15 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 37EC98FC14; Sat, 1 Oct 2011 19:43:15 +0000 (UTC) Received: by qadz30 with SMTP id z30so1212654qad.13 for ; Sat, 01 Oct 2011 12:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=2fw5u97E/sVU7m75jU+CQ8MmIVFROyi9QjlxEx1DnQ0=; b=NUpz4CvH76FsTX+cCAyuOCQhvJWIi5md24yGyF+WbOYoMhzbJj6jYfipKwr+QUrgRW jLbCzYFqFhfiEZI4miJVixYeSmULZnIQJGSxZ42FgEm1m8xq2e8GxNvUoYX+vbFfBUqr TbpfnExLw0w0nwd4GY/6lVncRp6l2bdCJalYc= MIME-Version: 1.0 Received: by 10.224.215.2 with SMTP id hc2mr9832703qab.324.1317498193710; Sat, 01 Oct 2011 12:43:13 -0700 (PDT) Received: by 10.224.74.82 with HTTP; Sat, 1 Oct 2011 12:43:13 -0700 (PDT) In-Reply-To: <201110011219.p91CJmTc016767@svn.freebsd.org> References: <201110011219.p91CJmTc016767@svn.freebsd.org> Date: Sat, 1 Oct 2011 12:43:13 -0700 Message-ID: From: Garrett Cooper To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225897 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 19:43:15 -0000 On Sat, Oct 1, 2011 at 5:19 AM, Ed Schouten wrote: > Author: ed > Date: Sat Oct =A01 12:19:48 2011 > New Revision: 225897 > URL: http://svn.freebsd.org/changeset/base/225897 ... > + =A0 =A0 =A0 if (s =3D=3D NULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 s =3D def; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dlen =3D sizeof(def) - LEN_PATH_DEV; > + =A0 =A0 =A0 } else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dlen =3D L_ctermid - LEN_PATH_DEV; > + =A0 =A0 =A0 strcpy(s, _PATH_TTY); Why not use strlcpy, etc with dlen? -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 20:34:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A3F3106566B; Sat, 1 Oct 2011 20:34:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id B606E8FC0A; Sat, 1 Oct 2011 20:34:42 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 9A1D91DD74B; Sat, 1 Oct 2011 22:34:41 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 8054917512; Sat, 1 Oct 2011 22:34:41 +0200 (CEST) Date: Sat, 1 Oct 2011 22:34:41 +0200 From: Jilles Tjoelker To: Alexander Best Message-ID: <20111001203441.GA88035@stack.nl> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> <20111001171401.GA47100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111001171401.GA47100@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 20:34:43 -0000 On Sat, Oct 01, 2011 at 05:14:01PM +0000, Alexander Best wrote: > On Sat Oct 1 11, Ed Schouten wrote: > > Also, it would be better if we replaced the "??" string with "-". When > > we print "??", it actually means: this process has no controlling > > terminal, not that we don't know which TTY it is. > good point. also i was thinking: if a process had a controlling > terminal, but that terminal has been revoked, are users really > interested to know what the name of that revoked terminal was? can't > we just use "-"? is it important to know whether a process never had a > controlling terminal, or had one at some point, but not anymore? I think this is potentially useful, because it shows that the process did not explicitly detach from the terminal (such as via setsid(2)). Particularly if the terminal is real (not a pseudo-terminal), its name may be useful in recognition. When asking for processes attached to a specific terminal with ps's t option, ps will also show processes that used to be attached ("-"), possibly allowing users to keep track of processes better. It appears that even if a terminal is "revoked" in this way, it still prevents reuse of the pts number. > also the ps(1) man page claims that a process running on console has a "TT" > entry of "con". i've never seen such an entry. is this still correct? This may indeed be no longer the case, although it was never common to see "con". With syscons in multi-user mode, you cannot log in on /dev/console, only on /dev/ttyv*. With syscons in single-user mode, ps(1) says "v0" or "ttyv0" but tty(1) says /dev/console. > and the last point i'd like to make: looking at 'ps alx' on freebsd > 7.x makes it easy to distinguish between ttys and pts'es, because they > are names ttyvX and ttypX. looking at the same output under HEAD, all > pts terminal descriptors have moved to /dev/pts/X. so they will not > show up as pX, but merely as X. > can't we tell ps to prefix anything coming from /dev/pts with a "p"? > in this output: > 1001 1780 1778 1 16 0 15956 3136 pause Is 0 0:00,02 /usr/local/bin/zsh > users are supposed to know that the "0" stands for /dev/pts/0. imho > 1001 1780 1778 1 16 0 15956 3136 pause Is p0 0:00,02 /usr/local/bin/zsh > would be much better here (like under freebsd 7.x). I rather like the new output. Pseudo-terminals are by far the most common kind of terminal and there may be many of them, so it makes sense not to have a prefix. The t option in ps also accepts these short names, like 'ps lt0'. All other terminal names start with a letter. In FreeBSD 7, the first 256 pseudo-terminals are named /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a few more pseudo-terminals but even then two characters suffice. The TTY keyword shows the full pathname relative to /dev. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 20:54:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 9C09A1065672; Sat, 1 Oct 2011 20:54:05 +0000 (UTC) Date: Sat, 1 Oct 2011 20:54:05 +0000 From: Alexander Best To: Jilles Tjoelker Message-ID: <20111001205405.GA72884@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> <20111001171401.GA47100@freebsd.org> <20111001203441.GA88035@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111001203441.GA88035@stack.nl> Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 20:54:05 -0000 On Sat Oct 1 11, Jilles Tjoelker wrote: > On Sat, Oct 01, 2011 at 05:14:01PM +0000, Alexander Best wrote: > > On Sat Oct 1 11, Ed Schouten wrote: > > > Also, it would be better if we replaced the "??" string with "-". When > > > we print "??", it actually means: this process has no controlling > > > terminal, not that we don't know which TTY it is. > > > good point. also i was thinking: if a process had a controlling > > terminal, but that terminal has been revoked, are users really > > interested to know what the name of that revoked terminal was? can't > > we just use "-"? is it important to know whether a process never had a > > controlling terminal, or had one at some point, but not anymore? > > I think this is potentially useful, because it shows that the process > did not explicitly detach from the terminal (such as via setsid(2)). > > Particularly if the terminal is real (not a pseudo-terminal), its name > may be useful in recognition. > > When asking for processes attached to a specific terminal with ps's t > option, ps will also show processes that used to be attached ("-"), > possibly allowing users to keep track of processes better. > > It appears that even if a terminal is "revoked" in this way, it still > prevents reuse of the pts number. that's a very good explanation. :) so yeah...let's keep it the way it is. > > > also the ps(1) man page claims that a process running on console has a "TT" > > entry of "con". i've never seen such an entry. is this still correct? > > This may indeed be no longer the case, although it was never common to > see "con". With syscons in multi-user mode, you cannot log in on > /dev/console, only on /dev/ttyv*. With syscons in single-user mode, > ps(1) says "v0" or "ttyv0" but tty(1) says /dev/console. > > > and the last point i'd like to make: looking at 'ps alx' on freebsd > > 7.x makes it easy to distinguish between ttys and pts'es, because they > > are names ttyvX and ttypX. looking at the same output under HEAD, all > > pts terminal descriptors have moved to /dev/pts/X. so they will not > > show up as pX, but merely as X. > > > can't we tell ps to prefix anything coming from /dev/pts with a "p"? > > > in this output: > > > 1001 1780 1778 1 16 0 15956 3136 pause Is 0 0:00,02 /usr/local/bin/zsh > > > users are supposed to know that the "0" stands for /dev/pts/0. imho > > > 1001 1780 1778 1 16 0 15956 3136 pause Is p0 0:00,02 /usr/local/bin/zsh > > > would be much better here (like under freebsd 7.x). > > I rather like the new output. Pseudo-terminals are by far the most > common kind of terminal and there may be many of them, so it makes sense > not to have a prefix. The t option in ps also accepts these short names, > like 'ps lt0'. All other terminal names start with a letter. > > In FreeBSD 7, the first 256 pseudo-terminals are named > /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a > few more pseudo-terminals but even then two characters suffice. > > The TTY keyword shows the full pathname relative to /dev. i think we should adjust the following paragraph " tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for the console, ``con''. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). " to something like this then " tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for pseudo-terminals, the entry in /dev/pts. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). The full pathname of the controlling terminal is available via the tty keyword. " cheers. alex ps: i am also wondering, why -o and -O aren't mutually exclusive. this would make more sense to me. > > -- > Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 20:56:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C9C41065672; Sat, 1 Oct 2011 20:56:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3858FC08; Sat, 1 Oct 2011 20:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91Kuw4S033483; Sat, 1 Oct 2011 20:56:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91KuwwX033481; Sat, 1 Oct 2011 20:56:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201110012056.p91KuwwX033481@svn.freebsd.org> From: Glen Barber Date: Sat, 1 Oct 2011 20:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225908 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 20:56:58 -0000 Author: gjb (doc committer) Date: Sat Oct 1 20:56:58 2011 New Revision: 225908 URL: http://svn.freebsd.org/changeset/base/225908 Log: Reorder default ps(1) output according to reality. Submitted by: arundel (via docs@) MFC after: 1 week Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Sat Oct 1 19:58:35 2011 (r225907) +++ head/bin/ps/ps.1 Sat Oct 1 20:56:58 2011 (r225908) @@ -90,8 +90,8 @@ and .Fl o options). The default output format includes, for each process, the process' ID, -controlling terminal, CPU time (including both user and system time), -state, and associated command. +controlling terminal, state, CPU time (including both user and system time) +and associated command. .Pp The process file system (see .Xr procfs 5 ) From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 21:10:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 141731065670; Sat, 1 Oct 2011 21:10:03 +0000 (UTC) Date: Sat, 1 Oct 2011 21:10:03 +0000 From: Alexander Best To: Jilles Tjoelker Message-ID: <20111001211003.GA76629@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> <20111001171401.GA47100@freebsd.org> <20111001203441.GA88035@stack.nl> <20111001205405.GA72884@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <20111001205405.GA72884@freebsd.org> Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 21:10:03 -0000 --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat Oct 1 11, Alexander Best wrote: > On Sat Oct 1 11, Jilles Tjoelker wrote: > > On Sat, Oct 01, 2011 at 05:14:01PM +0000, Alexander Best wrote: > > > On Sat Oct 1 11, Ed Schouten wrote: > > > > Also, it would be better if we replaced the "??" string with "-". When > > > > we print "??", it actually means: this process has no controlling > > > > terminal, not that we don't know which TTY it is. > > > > > good point. also i was thinking: if a process had a controlling > > > terminal, but that terminal has been revoked, are users really > > > interested to know what the name of that revoked terminal was? can't > > > we just use "-"? is it important to know whether a process never had a > > > controlling terminal, or had one at some point, but not anymore? > > > > I think this is potentially useful, because it shows that the process > > did not explicitly detach from the terminal (such as via setsid(2)). > > > > Particularly if the terminal is real (not a pseudo-terminal), its name > > may be useful in recognition. > > > > When asking for processes attached to a specific terminal with ps's t > > option, ps will also show processes that used to be attached ("-"), > > possibly allowing users to keep track of processes better. > > > > It appears that even if a terminal is "revoked" in this way, it still > > prevents reuse of the pts number. > > that's a very good explanation. :) so yeah...let's keep it the way it is. > > > > > > also the ps(1) man page claims that a process running on console has a "TT" > > > entry of "con". i've never seen such an entry. is this still correct? > > > > This may indeed be no longer the case, although it was never common to > > see "con". With syscons in multi-user mode, you cannot log in on > > /dev/console, only on /dev/ttyv*. With syscons in single-user mode, > > ps(1) says "v0" or "ttyv0" but tty(1) says /dev/console. > > > > > and the last point i'd like to make: looking at 'ps alx' on freebsd > > > 7.x makes it easy to distinguish between ttys and pts'es, because they > > > are names ttyvX and ttypX. looking at the same output under HEAD, all > > > pts terminal descriptors have moved to /dev/pts/X. so they will not > > > show up as pX, but merely as X. > > > > > can't we tell ps to prefix anything coming from /dev/pts with a "p"? > > > > > in this output: > > > > > 1001 1780 1778 1 16 0 15956 3136 pause Is 0 0:00,02 /usr/local/bin/zsh > > > > > users are supposed to know that the "0" stands for /dev/pts/0. imho > > > > > 1001 1780 1778 1 16 0 15956 3136 pause Is p0 0:00,02 /usr/local/bin/zsh > > > > > would be much better here (like under freebsd 7.x). > > > > I rather like the new output. Pseudo-terminals are by far the most > > common kind of terminal and there may be many of them, so it makes sense > > not to have a prefix. The t option in ps also accepts these short names, > > like 'ps lt0'. All other terminal names start with a letter. > > > > In FreeBSD 7, the first 256 pseudo-terminals are named > > /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a > > few more pseudo-terminals but even then two characters suffice. > > > > The TTY keyword shows the full pathname relative to /dev. > > i think we should adjust the following paragraph > > " tt An abbreviation for the pathname of the controlling terminal, > if any. The abbreviation consists of the three letters follow- > ing /dev/tty, or, for the console, ``con''. This is followed > by a `-' if the process can no longer reach that controlling > terminal (i.e., it has been revoked). > " > > to something like this then > > " tt An abbreviation for the pathname of the controlling terminal, > if any. The abbreviation consists of the three letters follow- > ing /dev/tty, or, for pseudo-terminals, the entry in /dev/pts. > This is followed by a `-' if the process can no longer reach > that controlling terminal (i.e., it has been revoked). > The full pathname of the controlling terminal is available via > the tty keyword. > " i'd like to propose the following patch. any objections? cheers. alex > > cheers. > alex > > ps: i am also wondering, why -o and -O aren't mutually exclusive. this would > make more sense to me. > > > > > -- > > Jilles Tjoelker --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ps.1.diff2" diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 8c27186..44a8d0e 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 1, 2011 +.Dd October 1, 2011 .Dt PS 1 .Os .Sh NAME @@ -427,12 +427,15 @@ The process is being traced or debugged. An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters following .Pa /dev/tty , -or, for the console, -.Dq Li con . +or, for psuedo-terminals, the corresponding entry in +.Pa /dev/pts . This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +The full pathname of the controlling terminal is available via the +.Cm tty +keyword. .It Cm wchan The event (an address in the system) on which a process waits. When printed numerically, the initial part of the address is --SUOF0GtieIMvvwua-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 22:08:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0531C106566B; Sat, 1 Oct 2011 22:08:58 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 94A2B8FC0A; Sat, 1 Oct 2011 22:08:57 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id A2D332A28CE3; Sun, 2 Oct 2011 00:08:56 +0200 (CEST) Date: Sun, 2 Oct 2011 00:08:56 +0200 From: Ed Schouten To: Garrett Cooper Message-ID: <20111001220856.GD91943@hoeg.nl> References: <201110011219.p91CJmTc016767@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BtLpl2nkGUzqmEOn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225897 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 22:08:58 -0000 --BtLpl2nkGUzqmEOn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Garrett Cooper , 20111001 21:43: > Why not use strlcpy, etc with dlen? Well, I could, but it wouldn't change anything. In both cases, the size of the buffer exceeds the size of _PATH_TTY. --=20 Ed Schouten WWW: http://80386.nl/ --BtLpl2nkGUzqmEOn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOh494AAoJEG5e2P40kaK73OYP/3rqefb9/V+eHarzs3+2phBO UQr5ywH5G5vW/CqeSwwFfdV7UFvDIhEUzuK4d/W7ztxNiuXeQR6kLKMG/RqKXBdW P65LBPGRo1B5X0tIdpIkiqtUZB9dsatljxzxovh/3cvdXxt5QHiXwujgCE48MrfY U1e1jkbouKzHGuQ8jQVYLgxtf21cqJ8ti+QsHA0+2lMyY7WUDNCmo7s9Fs/g4xye M5lJq8R7uNg6SkvH2yKdGEPgKsqjObBWcULB0eUk99EPh9HNehh2AH4H/lDaSexG kdLvrH5w+GUMiSuF3Ht8YGajfHZAJ6VY8WrW95DCBszIW6Ja8AU+rFiF/9bWqptj /V1FiSPaNrrtYlLe8QV3TfpnQ6P6JfS1hAAg406/5361SbYkZV3JgrLgnXzldBYN G0SSOKht0LFNC/nBWBRKmK5dqaPIsxNkujfbM7A6xUKv+DX0ZPsoM9wAkXU+vyqz iEdF0+WxvYtq35o9rSySP0H+ewbAOAnMRErHW4wvSLhcJAnC6pkbzxnsSLyYDl2E vLxamUPxoLo33+fZex4HIO32N3/huYToqm5tFchNamzE4ca7DeE+aYwiwcMyO1yf FFaUt5qjICx/ogF89Q14JzcehzP+BKXUsT6yTzRX+KHgZLV4BiLDnmPtmuayTryI +c08igcxtJiI6uqO5xZg =GQud -----END PGP SIGNATURE----- --BtLpl2nkGUzqmEOn-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 22:10:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D89641065670; Sat, 1 Oct 2011 22:10:44 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 990438FC14; Sat, 1 Oct 2011 22:10:44 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 0B8BD2A28CE3; Sun, 2 Oct 2011 00:10:44 +0200 (CEST) Date: Sun, 2 Oct 2011 00:10:44 +0200 From: Ed Schouten To: Alexander Best Message-ID: <20111001221044.GE91943@hoeg.nl> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> <20111001171401.GA47100@freebsd.org> <20111001203441.GA88035@stack.nl> <20111001205405.GA72884@freebsd.org> <20111001211003.GA76629@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y18yPE/eBgOv3N1p" Content-Disposition: inline In-Reply-To: <20111001211003.GA76629@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala , Jilles Tjoelker Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 22:10:44 -0000 --Y18yPE/eBgOv3N1p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alexander Best , 20111001 23:10: > i'd like to propose the following patch. any objections? Looks good! Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --Y18yPE/eBgOv3N1p Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOh4/jAAoJEG5e2P40kaK7Tg4P/jwPaQZY1BejyBPJClv4kkdi Re+UYIsQIMb/g2XJlkBET2AkJ/SlvSImK3atA0GoZB8o+D1tB9B9/vYQuc6ZGSw6 gwSInTu+0t8mYzJXmk1EaoNuSui4o7ULE1QfolNUGyf47e63QpSwjWEkLM6lQrhV RZFiUQZLNiKVDrsmWLvMCua8YRzWy/7hCnHTkeQ+i88rYbE9NN98DK6H4ETq5ptA FaiSqqtAEDHrPu3CJIBMnkHt5pVqtVuYgYQINMAD8EOpW6/tJ9n3lDabbJUV0pXB n0+0DJ2DaXOcDAIgyFN3Z4FL3wRNzmCkN2N57E1mz3kVvA5O46pIqStubHJoWBbN MZ4DLWkZxYvlFWKQcNHqM2qLlqfq1JI0N1Gbjz40mc5EoStZaYQGYgV6cw5RbBEV eYjVTMMA5ZZ7iKU+Pbsvr07PRvqomRU0JKb1XNVxWRlAgXnWmu9yacNuZ9OHiLqN MnQ+IGqHx/S9KCz4ob2FyXcbS9Dkv7R6K/WxQsl6i20LOOcLPKI3wnFhnIIfH6xQ 8d62sLEX+Z3klpV1b48dTnpnP8BI40pQWwF1L1vtjjv3XbMLrIlLRjtExbeewaNj FRzBK8KSOiwc5ZdzSLtprLW57ibpd1U/oqzVwDomPfFRS/xWJYAPu33kH6GeRUOk 6vYDDsCNZRfy6idn9FA0 =lMzh -----END PGP SIGNATURE----- --Y18yPE/eBgOv3N1p-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 22:32:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id BD6931065676; Sat, 1 Oct 2011 22:32:48 +0000 (UTC) Date: Sat, 1 Oct 2011 22:32:48 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20111001223248.GA86103@freebsd.org> References: <201109290631.p8T6VgJ3008377@svn.freebsd.org> <20110929121457.GA53600@freebsd.org> <20111001130643.GC91943@hoeg.nl> <20111001171401.GA47100@freebsd.org> <20111001203441.GA88035@stack.nl> <20111001205405.GA72884@freebsd.org> <20111001211003.GA76629@freebsd.org> <20111001221044.GE91943@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111001221044.GE91943@hoeg.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala , Jilles Tjoelker Subject: Re: svn commit: r225868 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 22:32:48 -0000 On Sun Oct 2 11, Ed Schouten wrote: > * Alexander Best , 20111001 23:10: > > i'd like to propose the following patch. any objections? > > Looks good! here's an updated patch, which fixes another few issues imo: http://lists.freebsd.org/pipermail/freebsd-doc/2011-October/018910.html cheers. alex > > Thanks, > -- > Ed Schouten > WWW: http://80386.nl/ From owner-svn-src-head@FreeBSD.ORG Sat Oct 1 23:47:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98FB1065670; Sat, 1 Oct 2011 23:47:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F12A8FC16; Sat, 1 Oct 2011 23:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91NlbaN038752; Sat, 1 Oct 2011 23:47:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91NlbkK038750; Sat, 1 Oct 2011 23:47:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201110012347.p91NlbkK038750@svn.freebsd.org> From: Glen Barber Date: Sat, 1 Oct 2011 23:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225912 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 23:47:37 -0000 Author: gjb (doc committer) Date: Sat Oct 1 23:47:37 2011 New Revision: 225912 URL: http://svn.freebsd.org/changeset/base/225912 Log: Tweaks to ps(1): - there's no reason the semantics of the -x flag are being explained in the -a flag description - be more precise regarding the relation between the -a flag and the security.bsd.see_other_uids sysctl - describe the format of the -t flag's argument - 'con' no longer is a possible entry in the 'TT' column - explain that the 'TT' column refers to pseudo-terminals via mere numbers - add a hint in the 'tt' keyword description that a keyword 'tty' exists, which will give the full terminal pathname Submitted by: arundel (via docs@) (original) MFC after: 1 week With-MFC: 225908 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Sat Oct 1 22:19:22 2011 (r225911) +++ head/bin/ps/ps.1 Sat Oct 1 23:47:37 2011 (r225912) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 1, 2011 +.Dd October 1, 2011 .Dt PS 1 .Os .Sh NAME @@ -54,6 +54,11 @@ utility displays a header line, followed by lines containing information about all of your processes that have controlling terminals. +If the +.Fl x +options is specified, +.Nm +will also display processes that do not have controlling terminals. .Pp A different set of processes can be selected for display by using any combination of the @@ -103,13 +108,9 @@ The options are as follows: .Bl -tag -width indent .It Fl a Display information about other users' processes as well as your own. -This will skip any processes which do not have a controlling terminal, -unless the -.Fl x -option is also specified. -This can be disabled by setting the +If the .Va security.bsd.see_other_uids -sysctl to zero. +sysctl is set to zero, this option is honored only if the UID of the user is 0. .It Fl c Change the .Dq command @@ -216,6 +217,9 @@ with the standard input. .It Fl t Display information about processes attached to the specified terminal devices. +Full pathnames, as well as abbreviations (see explanation of the +.Cm tt +keyword) can be specified. .It Fl U Display the processes belonging to the specified usernames. .It Fl u @@ -427,12 +431,15 @@ The process is being traced or debugged. An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters following .Pa /dev/tty , -or, for the console, -.Dq Li con . +or, for psuedo-terminals, the corresponding entry in +.Pa /dev/pts . This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +The full pathname of the controlling terminal is available via the +.Cm tty +keyword. .It Cm wchan The event (an address in the system) on which a process waits. When printed numerically, the initial part of the address is