Re: CVS commit: src/sys/fs/tmpfs

2011-05-10 Thread Iain Hibbert
On Tue, 10 May 2011, Takahiro Kambe wrote:

 In message 20110509170006.GA15831@marx.bitnet
   on Mon, 9 May 2011 20:00:06 +0300,
   Jukka Ruohonen jruoho...@iki.fi wrote:
  On Mon, May 09, 2011 at 06:50:08PM +0200, Adam Hoka wrote:
  So can we use for (int i = 0; ... ? :p
 lint(1) support them?

Yes, lint(1) knows about it, see lint(7):

  325 variable declaration in for loop

and lint -S (use C9X mode) disables this warning..

iain


Re: CVS commit: src/sys/fs/tmpfs

2011-05-10 Thread Takahiro Kambe
In message alpine.neb.2.00.1105100716550.29...@galant.ukfsn.org
on Tue, 10 May 2011 07:19:51 +0100 (BST),
Iain Hibbert plu...@rya-online.net wrote:
 On Tue, 10 May 2011, Takahiro Kambe wrote:
 
 In message 20110509170006.GA15831@marx.bitnet
  on Mon, 9 May 2011 20:00:06 +0300,
  Jukka Ruohonen jruoho...@iki.fi wrote:
  On Mon, May 09, 2011 at 06:50:08PM +0200, Adam Hoka wrote:
  So can we use for (int i = 0; ... ? :p
 lint(1) support them?
 
 Yes, lint(1) knows about it, see lint(7):
 
   325 variable declaration in for loop
Wow, thanks much!

-- 
Takahiro Kambe t...@back-street.net


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

2011-05-10 Thread Cliff Neighbors
Jukka,

#include fenv.h as part of this seems to have caused build.sh to break on arch 
evbmips64-eb 

 In file included from 
 /home/cliff/netbsd/NetBSD-current/usr/src/tests/lib/libc/s
 tdlib/t_strtod.c:38:
 /home/cliff/netbsd/NetBSD-current/build/evbmips64-eb-20110510/dest/usr/include/f
 env.h:29:2: error: #error fenv.h is currently not supported for this 
 architectu
 re
 /home/cliff/netbsd/NetBSD-current/build/evbmips64-eb-20110510/dest/usr/include/f
 env.h:35:26: error: machine/fenv.h: No such file or directory
 nbmkdep: compile failed.
 *** [t_strtod.d] Error code 1
 

do we need #ifdef Honor_FLT_ROUNDS around that include?

 -cliff-




On May 10, 2011, at 8:20 AM, Jukka Ruohonen wrote:

 Module Name:  src
 Committed By: jruoho
 Date: Tue May 10 15:20:19 UTC 2011
 
 Modified Files:
   src/tests/lib/libc/stdlib: t_strtod.c
 
 Log Message:
 Verify that strtod(3) honors the current rounding mode set by fesetround(3).
 Passes on amd64. Prompted by a bug in the GNU C library.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/stdlib/t_strtod.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 



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

2011-05-10 Thread Jukka Ruohonen
On Tue, May 10, 2011 at 11:37:16AM -0700, Cliff Neighbors wrote:
  In file included from 
  /home/cliff/netbsd/NetBSD-current/usr/src/tests/lib/libc/s
  tdlib/t_strtod.c:38:
  /home/cliff/netbsd/NetBSD-current/build/evbmips64-eb-20110510/dest/usr/include/f
  env.h:29:2: error: #error fenv.h is currently not supported for this 
  architectu
  re
  /home/cliff/netbsd/NetBSD-current/build/evbmips64-eb-20110510/dest/usr/include/f
  env.h:35:26: error: machine/fenv.h: No such file or directory
  nbmkdep: compile failed.
  *** [t_strtod.d] Error code 1
  
 
 do we need #ifdef Honor_FLT_ROUNDS around that include?

Hmm, I guess so. Or #ifndef NO_FENV_H? I am not familiar with the
conditional compilation of gdtoa.

- Jukka.


CVS commit: src/lib/libm

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:38:33 UTC 2011

Modified Files:
src/lib/libm: Makefile
src/lib/libm/man: ieee.3
Added Files:
src/lib/libm/man: ilogb.3

Log Message:
Split out the ilogb(3) family out of ieee(3) and properly document it.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/lib/libm/Makefile
cvs rdiff -u -r1.24 -r1.25 src/lib/libm/man/ieee.3
cvs rdiff -u -r0 -r1.1 src/lib/libm/man/ilogb.3

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.107 src/lib/libm/Makefile:1.108
--- src/lib/libm/Makefile:1.107	Sat Apr 16 05:48:50 2011
+++ src/lib/libm/Makefile	Tue May 10 06:38:33 2011
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.107 2011/04/16 05:48:50 jruoho Exp $
+#  $NetBSD: Makefile,v 1.108 2011/05/10 06:38:33 jruoho Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -204,7 +204,7 @@
 	ceil.3 copysign.3 cos.3 cosh.3 \
 	erf.3 exp.3 \
 	fabs.3 fmod.3 frexp.3 hypot.3 ieee.3 \
-	ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
+	ieee_test.3 ilogb.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
 	math.3 modf.3 nextafter.3 \
 	remainder.3 rint.3 round.3 \
 	sin.3 sinh.3 sqrt.3 \
@@ -249,11 +249,11 @@
 MLINKS+=fmod.3 fmodf.3
 MLINKS+=hypot.3 hypotf.3
 MLINKS+=ieee.3 finite.3 ieee.3 finitef.3 \
-	ieee.3 ilogb.3 ieee.3 ilogbf.3	\
 	ieee.3 scalbn.3 ieee.3 scalbnf.3
 MLINKS+=ieee_test.3 logb.3 ieee_test.3 logbf.3
 MLINKS+=ieee_test.3 scalb.3 ieee_test.3 scalbf.3
 MLINKS+=ieee_test.3 significand.3 ieee_test.3 significandf.3
+MLINKS+=ilogb.3 ilogbf.3	\
 MLINKS+=isinff.3 isnanf.3
 MLINKS+=j0.3 j0f.3 j0.3 j1.3 j0.3 j1f.3 j0.3 jn.3 j0.3 jnf.3 \
 	j0.3 y0.3 j0.3 y0f.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 j0.3 ynf.3

Index: src/lib/libm/man/ieee.3
diff -u src/lib/libm/man/ieee.3:1.24 src/lib/libm/man/ieee.3:1.25
--- src/lib/libm/man/ieee.3:1.24	Wed Apr 13 04:57:10 2011
+++ src/lib/libm/man/ieee.3	Tue May 10 06:38:33 2011
@@ -26,7 +26,7 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)ieee.3	6.4 (Berkeley) 5/6/91
-.\	$NetBSD: ieee.3,v 1.24 2011/04/13 04:57:10 jruoho Exp $
+.\	$NetBSD: ieee.3,v 1.25 2011/05/10 06:38:33 jruoho Exp $
 .\
 .Dd April 12, 2011
 .Dt IEEE 3
@@ -34,8 +34,6 @@
 .Sh NAME
 .Nm finite ,
 .Nm finitef ,
-.Nm ilogb ,
-.Nm ilogbf ,
 .Nm scalbn ,
 .Nm scalbnf
 .Nd functions for IEEE arithmetic
@@ -47,10 +45,6 @@
 .Fn finite double x
 .Ft int
 .Fn finitef float x
-.Ft int
-.Fn ilogb double x
-.Ft int
-.Fn ilogbf float x
 .Ft double
 .Fn scalbn double x int n
 .Ft float
@@ -72,20 +66,6 @@
 .Fa x
 is \*(Na).
 .Pp
-.Fn ilogb
-returns
-.Fa x Ns 's exponent
-.Fa n ,
-in integer format.
-.Fn ilogb \*(Pm\*(If
-returns
-.Dv INT_MAX
-and
-.Fn ilogb 0
-returns
-.Dv INT_MIN .
-is even.
-.Pp
 .Fn scalbn
 returns
 .Fa x Ns \(**(2** Ns Fa n )

Added files:

Index: src/lib/libm/man/ilogb.3
diff -u /dev/null src/lib/libm/man/ilogb.3:1.1
--- /dev/null	Tue May 10 06:38:34 2011
+++ src/lib/libm/man/ilogb.3	Tue May 10 06:38:33 2011
@@ -0,0 +1,110 @@
+.\ $NetBSD: ilogb.3,v 1.1 2011/05/10 06:38:33 jruoho Exp $
+.\
+.\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd May 10, 2011
+.Dt ILOGB 3
+.Os
+.Sh NAME
+.Nm ilogb ,
+.Nm ilogbf
+.Nd an unbiased exponent
+.Sh LIBRARY
+.Lb libm
+.Sh SYNOPSIS
+.In math.h
+.Ft int
+.Fn ilogb double x
+.Ft int
+.Fn ilogbf float x
+.Sh DESCRIPTION
+The
+.Fn ilogb
+and
+.Fn ilogbf
+functions return the exponent of the non-zero real floating-point number
+.Fa x
+as a signed integer value.
+Formally the return value is the integral part of
+.Bd 

CVS commit: src/share/man/man3

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:39:46 UTC 2011

Modified Files:
src/share/man/man3: ilog2.3

Log Message:
Xref ilogb(3).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man3/ilog2.3

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

Modified files:

Index: src/share/man/man3/ilog2.3
diff -u src/share/man/man3/ilog2.3:1.4 src/share/man/man3/ilog2.3:1.5
--- src/share/man/man3/ilog2.3:1.4	Fri Apr  8 08:40:05 2011
+++ src/share/man/man3/ilog2.3	Tue May 10 06:39:45 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: ilog2.3,v 1.4 2011/04/08 08:40:05 jruoho Exp $ $
+.\ $NetBSD: ilog2.3,v 1.5 2011/05/10 06:39:45 jruoho Exp $ $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 8, 2011
+.Dd May 10, 2011
 .Dt ILOG2 3
 .Os
 .Sh NAME
@@ -55,6 +55,7 @@
 A value \-1 is returned on error.
 .Sh SEE ALSO
 .Xr bitops 3 ,
+.Xr ilogb 3 ,
 .Xr log2 3 ,
 .Xr imax 9 ,
 .Xr powerof2 9



CVS commit: othersrc/external/bsd/gensetlist

2011-05-10 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 10 06:41:26 UTC 2011

Modified Files:
othersrc/external/bsd/gensetlist: gensetlist.c

Log Message:
Occasional MAN definitions can hold multiple pages (see src/bin/pax for one
example).

Change the parsing of the contents of MAN definitions so that both single
and multiple definitions of man pages can be recognised.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/gensetlist/gensetlist.c

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

Modified files:

Index: othersrc/external/bsd/gensetlist/gensetlist.c
diff -u othersrc/external/bsd/gensetlist/gensetlist.c:1.2 othersrc/external/bsd/gensetlist/gensetlist.c:1.3
--- othersrc/external/bsd/gensetlist/gensetlist.c:1.2	Mon May  9 14:47:15 2011
+++ othersrc/external/bsd/gensetlist/gensetlist.c	Tue May 10 06:41:26 2011
@@ -111,6 +111,7 @@
 	static regex_t	 bindir;
 	static regex_t	 libdir;
 	static regex_t	 mandir;
+	static regex_t	 subman;
 	static regex_t	 mlinks;
 	static regex_t	 shlib;
 	static regex_t	 incs;
@@ -124,7 +125,8 @@
 	if (!compiled) {
 		(void) regcomp(lib, ^[ \t]*LIB[ \t]*=[ \t]*([^ \t]+), REG_EXTENDED);
 		(void) regcomp(libdir, ^[ \t]*LIBDIR[ \t]*=[ \t]*([^ \t]+), REG_EXTENDED);
-		(void) regcomp(man, ^[ \t]*MAN[ \t]*([+]?=)[ \t]*([^ \t]+), REG_EXTENDED);
+		(void) regcomp(man, ^[ \t]*MAN[ \t]*=, REG_EXTENDED);
+		(void) regcomp(subman, ^[ \t]*([^ \t]+), REG_EXTENDED);
 		(void) regcomp(prog, ^[ \t]*PROG[ \t]*=[ \t]*([^ \t]+), REG_EXTENDED);
 		(void) regcomp(bindir, ^[ \t]*BINDIR[ \t]*=[ \t]*([^ \t]+), REG_EXTENDED);
 		(void) regcomp(mandir, ^[ \t]*MANDIR[ \t]*=[ \t]*([^ \t]+), REG_EXTENDED);
@@ -151,10 +153,14 @@
 		return 1;
 	}
 	if (regexec(man, in, 10, matches, 0) == 0) {
-		(void) asprintf(vars-mans[vars-manc++], 
-			%.*s,
-			(int)(matches[2].rm_eo - matches[2].rm_so),
-			in[(int)matches[2].rm_so]);
+		for (cp = in[(int)matches[0].rm_eo] ; 
+		 regexec(subman, cp, 10, matches, 0) == 0 ;
+		 cp += matches[0].rm_eo) {
+			(void) asprintf(vars-mans[vars-manc++], 
+%.*s,
+(int)(matches[1].rm_eo - matches[1].rm_so),
+cp[(int)matches[1].rm_so]);
+		}
 		return 1;
 	}
 	if (regexec(prog, in, 10, matches, 0) == 0) {



CVS commit: othersrc/external/bsd/gensetlist

2011-05-10 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 10 06:42:13 UTC 2011

Modified Files:
othersrc/external/bsd/gensetlist: Makefile bsd.setlist.mk

Log Message:
add license

set binary directory explicitly


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/gensetlist/Makefile
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/gensetlist/bsd.setlist.mk

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

Modified files:

Index: othersrc/external/bsd/gensetlist/Makefile
diff -u othersrc/external/bsd/gensetlist/Makefile:1.1.1.1 othersrc/external/bsd/gensetlist/Makefile:1.2
--- othersrc/external/bsd/gensetlist/Makefile:1.1.1.1	Sat Mar 12 08:20:42 2011
+++ othersrc/external/bsd/gensetlist/Makefile	Tue May 10 06:42:13 2011
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.1.1.1 2011/03/12 08:20:42 agc Exp $
+# $NetBSD: Makefile,v 1.2 2011/05/10 06:42:13 agc Exp $
 
 SRCS=gensetlist.c
 PROG=gensetlist
 WARNS=4
 MAN=gensetlist.8
+BINDIR=/usr/bin
 
 .include bsd.prog.mk
 

Index: othersrc/external/bsd/gensetlist/bsd.setlist.mk
diff -u othersrc/external/bsd/gensetlist/bsd.setlist.mk:1.2 othersrc/external/bsd/gensetlist/bsd.setlist.mk:1.3
--- othersrc/external/bsd/gensetlist/bsd.setlist.mk:1.2	Mon May  9 15:03:58 2011
+++ othersrc/external/bsd/gensetlist/bsd.setlist.mk	Tue May 10 06:42:13 2011
@@ -1,6 +1,30 @@
-# $NetBSD: bsd.setlist.mk,v 1.2 2011/05/09 15:03:58 agc Exp $
+# $NetBSD: bsd.setlist.mk,v 1.3 2011/05/10 06:42:13 agc Exp $
 
-# Makefile fragment to hand the args to setlist from the Makefile
+# Copyright (c) 2010,2011 Alistair Crooks a...@netbsd.org
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR 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.
+#
+
+# Makefile fragment to hand the args to gensetlist from the Makefile
 
 .if defined(LIB)
 GENSETLIST_ARGS+=-v LIB=${LIB:Q}
@@ -48,5 +72,5 @@
 GENSETLIST_ARGS+=-c ${CATEGORY:Q}
 .endif
 
-setlist:
+setlist: .PHONY
 	gensetlist ${GENSETLIST_ARGS}



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:55:27 UTC 2011

Modified Files:
src/tests/lib/libc/string: t_strerror.c

Log Message:
Fix typo.


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

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

Modified files:

Index: src/tests/lib/libc/string/t_strerror.c
diff -u src/tests/lib/libc/string/t_strerror.c:1.2 src/tests/lib/libc/string/t_strerror.c:1.3
--- src/tests/lib/libc/string/t_strerror.c:1.2	Mon May  9 06:05:54 2011
+++ src/tests/lib/libc/string/t_strerror.c	Tue May 10 06:55:27 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strerror.c,v 1.2 2011/05/09 06:05:54 jruoho Exp $ */
+/* $NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strerror.c,v 1.2 2011/05/09 06:05:54 jruoho Exp $);
+__RCSID($NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $);
 
 #include atf-c.h
 #include errno.h
@@ -77,7 +77,7 @@
 ATF_TC(strerror_r_basic);
 ATF_TC_HEAD(strerror_r_basic, tc)
 {
-	atf_tc_set_md_var(tc, descr, A basic test of strerrorr_(3));
+	atf_tc_set_md_var(tc, descr, A basic test of strerror_r(3));
 }
 
 ATF_TC_BODY(strerror_r_basic, tc)



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:58:17 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_alarm.c

Log Message:
Fix comment/string typos.


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

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

Modified files:

Index: src/tests/lib/libc/gen/t_alarm.c
diff -u src/tests/lib/libc/gen/t_alarm.c:1.1 src/tests/lib/libc/gen/t_alarm.c:1.2
--- src/tests/lib/libc/gen/t_alarm.c:1.1	Thu May  5 13:22:56 2011
+++ src/tests/lib/libc/gen/t_alarm.c	Tue May 10 06:58:17 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_alarm.c,v 1.1 2011/05/05 13:22:56 jruoho Exp $ */
+/* $NetBSD: t_alarm.c,v 1.2 2011/05/10 06:58:17 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_alarm.c,v 1.1 2011/05/05 13:22:56 jruoho Exp $);
+__RCSID($NetBSD: t_alarm.c,v 1.2 2011/05/10 06:58:17 jruoho Exp $);
 
 #include sys/wait.h
 
@@ -52,7 +52,7 @@
 ATF_TC(alarm_basic);
 ATF_TC_HEAD(alarm_basic, tc)
 {
-	atf_tc_set_md_var(tc, descr, A basic test of alarm(2));
+	atf_tc_set_md_var(tc, descr, A basic test of alarm(3));
 }
 
 ATF_TC_BODY(alarm_basic, tc)
@@ -110,7 +110,7 @@
 ATF_TC(alarm_previous);
 ATF_TC_HEAD(alarm_previous, tc)
 {
-	atf_tc_set_md_var(tc, descr, Test return value from alarm(2));
+	atf_tc_set_md_var(tc, descr, Test return value from alarm(3));
 }
 
 ATF_TC_BODY(alarm_previous, tc)
@@ -118,7 +118,7 @@
 	unsigned int rv;
 
 	/*
-	 * See that alarm(2) returns the amount
+	 * See that alarm(3) returns the amount
 	 * left on the timer from the previous call.
 	*/
 	rv = alarm(60);
@@ -136,7 +136,7 @@
 	return;
 
 fail:
-	atf_tc_fail(invalid return value from alarm(2));
+	atf_tc_fail(invalid return value from alarm(3));
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 10 07:04:17 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h rf_paritylogging.c
rf_reconmap.c rf_reconmap.h rf_states.c

Log Message:
convert RF_CommonLogData_s/RF_ReconMap_s mutex to a kmutex/cv.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/raidframe/rf_paritylogging.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/raidframe/rf_reconmap.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/raidframe/rf_reconmap.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/raidframe/rf_states.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_paritylog.c
diff -u src/sys/dev/raidframe/rf_paritylog.c:1.13 src/sys/dev/raidframe/rf_paritylog.c:1.14
--- src/sys/dev/raidframe/rf_paritylog.c:1.13	Sun Mar  4 06:02:38 2007
+++ src/sys/dev/raidframe/rf_paritylog.c	Tue May 10 07:04:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.c,v 1.13 2007/03/04 06:02:38 christos Exp $	*/
+/*	$NetBSD: rf_paritylog.c,v 1.14 2011/05/10 07:04:17 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.13 2007/03/04 06:02:38 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.14 2011/05/10 07:04:17 mrg Exp $);
 
 #include rf_archs.h
 
@@ -75,7 +75,8 @@
 	} else {
 		RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
 		RF_Malloc(common, sizeof(RF_CommonLogData_t), (RF_CommonLogData_t *));
-		rf_mutex_init(common-mutex);
+		/* destroy is in rf_paritylogging.c */
+		rf_init_mutex2(common-mutex, IPL_VM);
 	}
 	common-next = NULL;
 	return (common);
@@ -815,13 +816,13 @@
 			/* Processed this item completely, decrement count of
 			 * items to be processed. */
 			RF_ASSERT(item-diskAddress.numSector == 0);
-			RF_LOCK_MUTEX(item-common-mutex);
+			rf_lock_mutex2(item-common-mutex);
 			item-common-cnt--;
 			if (item-common-cnt == 0)
 itemDone = RF_TRUE;
 			else
 itemDone = RF_FALSE;
-			RF_UNLOCK_MUTEX(item-common-mutex);
+			rf_unlock_mutex2(item-common-mutex);
 			if (itemDone) {
 /* Finished processing all log data for this
  * IO Return structs to free list and invoke

Index: src/sys/dev/raidframe/rf_paritylog.h
diff -u src/sys/dev/raidframe/rf_paritylog.h:1.5 src/sys/dev/raidframe/rf_paritylog.h:1.6
--- src/sys/dev/raidframe/rf_paritylog.h:1.5	Sun Mar  4 06:02:38 2007
+++ src/sys/dev/raidframe/rf_paritylog.h	Tue May 10 07:04:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.h,v 1.5 2007/03/04 06:02:38 christos Exp $	*/
+/*	$NetBSD: rf_paritylog.h,v 1.6 2011/05/10 07:04:17 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -46,8 +46,8 @@
 }   RF_ParityRecordType_t;
 
 struct RF_CommonLogData_s {
-	RF_DECLARE_MUTEX(mutex)	/* protects cnt */
-	int cnt;		/* when 0, time to call wakeFunc */
+	rf_declare_mutex2(mutex);	/* protects cnt */
+	int cnt;			/* when 0, time to call wakeFunc */
 	RF_Raid_t *raidPtr;
 /*   int(*wakeFunc)(struct buf *); */
 	int (*wakeFunc) (RF_DagNode_t * node, int status);

Index: src/sys/dev/raidframe/rf_paritylogging.c
diff -u src/sys/dev/raidframe/rf_paritylogging.c:1.28 src/sys/dev/raidframe/rf_paritylogging.c:1.29
--- src/sys/dev/raidframe/rf_paritylogging.c:1.28	Sun Mar  4 06:02:39 2007
+++ src/sys/dev/raidframe/rf_paritylogging.c	Tue May 10 07:04:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylogging.c,v 1.28 2007/03/04 06:02:39 christos Exp $	*/
+/*	$NetBSD: rf_paritylogging.c,v 1.29 2011/05/10 07:04:17 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylogging.c,v 1.28 2007/03/04 06:02:39 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylogging.c,v 1.29 2011/05/10 07:04:17 mrg Exp $);
 
 #include rf_archs.h
 
@@ -637,8 +637,9 @@
 	}
 	while (raidPtr-parityLogDiskQueue.freeCommonList) {
 		c = raidPtr-parityLogDiskQueue.freeCommonList;
-		raidPtr-parityLogDiskQueue.freeCommonList =
-			raidPtr-parityLogDiskQueue.freeCommonList-next;
+		raidPtr-parityLogDiskQueue.freeCommonList = c-next;
+		/* init is in rf_paritylog.c */
+		rf_destroy_mutex2(c-mutex);
 		RF_Free(c, sizeof(RF_CommonLogData_t));
 	}
 }

Index: src/sys/dev/raidframe/rf_reconmap.c
diff -u src/sys/dev/raidframe/rf_reconmap.c:1.31 src/sys/dev/raidframe/rf_reconmap.c:1.32
--- src/sys/dev/raidframe/rf_reconmap.c:1.31	Mon May 19 19:49:54 2008
+++ src/sys/dev/raidframe/rf_reconmap.c	Tue May 10 07:04:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconmap.c,v 1.31 2008/05/19 19:49:54 oster Exp $	*/
+/*	$NetBSD: rf_reconmap.c,v 1.32 2011/05/10 07:04:17 mrg 

CVS commit: src/sys/ufs/ufs

2011-05-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue May 10 08:29:32 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
Fix filesystem root leaked lock when using UFS_EXTATTR_AUTOSTART.
This way, statvfs(2) calls obtained by df(1) or umount(8) will no
longer sleep forever in the kernel to acquire the lock.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/ufs/ufs/ufs_extattr.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_extattr.c
diff -u src/sys/ufs/ufs/ufs_extattr.c:1.28 src/sys/ufs/ufs/ufs_extattr.c:1.29
--- src/sys/ufs/ufs/ufs_extattr.c:1.28	Tue Nov 30 10:30:04 2010
+++ src/sys/ufs/ufs/ufs_extattr.c	Tue May 10 08:29:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extattr.c,v 1.28 2010/11/30 10:30:04 dholland Exp $	*/
+/*	$NetBSD: ufs_extattr.c,v 1.29 2011/05/10 08:29:32 manu Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ufs_extattr.c,v 1.28 2010/11/30 10:30:04 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ufs_extattr.c,v 1.29 2011/05/10 08:29:32 manu Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ffs.h
@@ -287,7 +287,9 @@
 	error = ufs_lookup(vargs);
 	PNBUF_PUT(pnbuf);
 	if (error) {
-		VOP_UNLOCK(start_dvp);
+		if (lockparent == 0) {
+			VOP_UNLOCK(start_dvp);
+		}
 		return (error);
 	}
 #if 0
@@ -295,6 +297,9 @@
 		panic(ufs_extattr_lookup: target_vp == start_dvp);
 #endif
 
+	if ((target_vp != start_dvp)  (lockparent == 0))
+		 VOP_UNLOCK(start_dvp);
+
 	KASSERT(VOP_ISLOCKED(target_vp) == LK_EXCLUSIVE);
 	*vp = target_vp;
 	return (0);



CVS commit: src/lib/libm

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 09:07:51 UTC 2011

Modified Files:
src/lib/libm: Makefile

Log Message:
Remove trailing '\'.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.108 src/lib/libm/Makefile:1.109
--- src/lib/libm/Makefile:1.108	Tue May 10 06:38:33 2011
+++ src/lib/libm/Makefile	Tue May 10 09:07:51 2011
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.108 2011/05/10 06:38:33 jruoho Exp $
+#  $NetBSD: Makefile,v 1.109 2011/05/10 09:07:51 jruoho Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -253,7 +253,7 @@
 MLINKS+=ieee_test.3 logb.3 ieee_test.3 logbf.3
 MLINKS+=ieee_test.3 scalb.3 ieee_test.3 scalbf.3
 MLINKS+=ieee_test.3 significand.3 ieee_test.3 significandf.3
-MLINKS+=ilogb.3 ilogbf.3	\
+MLINKS+=ilogb.3 ilogbf.3
 MLINKS+=isinff.3 isnanf.3
 MLINKS+=j0.3 j0f.3 j0.3 j1.3 j0.3 j1f.3 j0.3 jn.3 j0.3 jnf.3 \
 	j0.3 y0.3 j0.3 y0f.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 j0.3 ynf.3



CVS commit: src/share/man/man3

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 12:09:00 UTC 2011

Modified Files:
src/share/man/man3: fast_divide32.3

Log Message:
Xref div(3) and remainder(3).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3/fast_divide32.3

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

Modified files:

Index: src/share/man/man3/fast_divide32.3
diff -u src/share/man/man3/fast_divide32.3:1.7 src/share/man/man3/fast_divide32.3:1.8
--- src/share/man/man3/fast_divide32.3:1.7	Fri Apr  8 08:40:05 2011
+++ src/share/man/man3/fast_divide32.3	Tue May 10 12:09:00 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: fast_divide32.3,v 1.7 2011/04/08 08:40:05 jruoho Exp $
+.\	$NetBSD: fast_divide32.3,v 1.8 2011/05/10 12:09:00 jruoho Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 8, 2011
+.Dd May 10, 2011
 .Dt FAST_DIVIDE32 3
 .Os
 .Sh NAME
@@ -92,7 +92,9 @@
 r = fast_remainder32(a, b, m, s1, s2);
 .Ed
 .Sh SEE ALSO
-.Xr bitops 3
+.Xr bitops 3 ,
+.Xr div 3 ,
+.Xr remainder 3
 .Rs
 .%A Torbj\(:orn Granlund
 .%A Peter L. Montgomery



CVS commit: src/lib/libperfuse

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 12:14:37 UTC 2011

Modified Files:
src/lib/libperfuse: libperfuse.3

Log Message:
Small typo in macro (Xd - Xr).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libperfuse/libperfuse.3

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

Modified files:

Index: src/lib/libperfuse/libperfuse.3
diff -u src/lib/libperfuse/libperfuse.3:1.2 src/lib/libperfuse/libperfuse.3:1.3
--- src/lib/libperfuse/libperfuse.3:1.2	Wed Sep  1 13:04:11 2010
+++ src/lib/libperfuse/libperfuse.3	Tue May 10 12:14:37 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: libperfuse.3,v 1.2 2010/09/01 13:04:11 wiz Exp $
+.\ $NetBSD: libperfuse.3,v 1.3 2011/05/10 12:14:37 njoly Exp $
 .\
 .\ Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
 .\
@@ -111,7 +111,7 @@
 .\.Bl -tag -width Er
 .\.El
 .Sh SEE ALSO
-.Xd df 1 ,
+.Xr df 1 ,
 .Xr mount 2 ,
 .Xr open 2 ,
 .Xr mount 8 ,



CVS commit: src/usr.sbin/perfused

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 12:16:19 UTC 2011

Modified Files:
src/usr.sbin/perfused: perfused.8

Log Message:
Fix prologue macros order.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/perfused/perfused.8

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

Modified files:

Index: src/usr.sbin/perfused/perfused.8
diff -u src/usr.sbin/perfused/perfused.8:1.4 src/usr.sbin/perfused/perfused.8:1.5
--- src/usr.sbin/perfused/perfused.8:1.4	Fri Aug 27 18:12:51 2010
+++ src/usr.sbin/perfused/perfused.8	Tue May 10 12:16:18 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: perfused.8,v 1.4 2010/08/27 18:12:51 wiz Exp $
+.\ $NetBSD: perfused.8,v 1.5 2011/05/10 12:16:18 njoly Exp $
 .\
 .\ Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
 .\
@@ -24,8 +24,8 @@
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd August 12, 2010
-.Os
 .Dt PERFUSED 8
+.Os
 .Sh NAME
 .Nm perfused
 .Nd PUFFS Enabled Relay to FUSE Daemon



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 12:43:42 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_raise.c

Log Message:
Add also a simplistic stress unit test.


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

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

Modified files:

Index: src/tests/lib/libc/gen/t_raise.c
diff -u src/tests/lib/libc/gen/t_raise.c:1.4 src/tests/lib/libc/gen/t_raise.c:1.5
--- src/tests/lib/libc/gen/t_raise.c:1.4	Mon May  9 09:27:37 2011
+++ src/tests/lib/libc/gen/t_raise.c	Tue May 10 12:43:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_raise.c,v 1.4 2011/05/09 09:27:37 jruoho Exp $ */
+/*	$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_raise.c,v 1.4 2011/05/09 09:27:37 jruoho Exp $);
+__RCSID($NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $);
 
 #include atf-c.h
 
@@ -39,11 +39,19 @@
 #include unistd.h
 
 static bool	fail;
+static int	count;
 static void	handler_err(int);
 static void	handler_ret(int);
+static void	handler_stress(int);
 static int	sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2, SIGPWR };
 
 static void
+handler_stress(int signo)
+{
+	count++;
+}
+
+static void
 handler_err(int signo)
 {
 	size_t i;
@@ -146,11 +154,37 @@
 	}
 }
 
+ATF_TC(raise_stress);
+ATF_TC_HEAD(raise_stress, tc)
+{
+	atf_tc_set_md_var(tc, descr, A basic stress test with raise(3));
+}
+
+ATF_TC_BODY(raise_stress, tc)
+{
+	static const int maxiter = 1000 * 10;
+	struct sigaction sa;
+	int i;
+
+	sa.sa_flags = 0;
+	sa.sa_handler = handler_stress;
+
+	ATF_REQUIRE(sigemptyset(sa.sa_mask) == 0);
+	ATF_REQUIRE(sigaction(SIGUSR1, sa, 0) == 0);
+
+	for (count = i = 0; i  maxiter; i++)
+		(void)raise(SIGUSR1);
+
+	if (count != maxiter)
+		atf_tc_fail(not all signals were catched);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, raise_err);
 	ATF_TP_ADD_TC(tp, raise_ret);
 	ATF_TP_ADD_TC(tp, raise_sig);
+	ATF_TP_ADD_TC(tp, raise_stress);
 
 	return atf_no_error();
 }



CVS commit: src

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 13:03:06 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/gen: Makefile
Added Files:
src/tests/lib/libc/gen: t_pause.c

Log Message:
Few naive tests for pause(3).


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/t_pause.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.335 src/distrib/sets/lists/tests/mi:1.336
--- src/distrib/sets/lists/tests/mi:1.335	Mon May  9 17:53:54 2011
+++ src/distrib/sets/lists/tests/mi	Tue May 10 13:03:05 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.335 2011/05/09 17:53:54 jruoho Exp $
+# $NetBSD: mi,v 1.336 2011/05/10 13:03:05 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -360,6 +360,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_humanize_number.debug	tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_ldexp.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_nice.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/gen/t_pause.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_raise.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_randomid.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_rbstress.debug		tests-obsolete		obsolete
@@ -1789,6 +1790,7 @@
 ./usr/tests/lib/libc/gen/t_humanize_number	tests-lib-tests		atf
 ./usr/tests/lib/libc/gen/t_ldexp		tests-lib-tests		atf
 ./usr/tests/lib/libc/gen/t_nice			tests-lib-tests		atf
+./usr/tests/lib/libc/gen/t_pause		tests-lib-tests		atf
 ./usr/tests/lib/libc/gen/t_raise		tests-lib-tests		atf
 ./usr/tests/lib/libc/gen/t_randomid		tests-lib-tests		atf
 ./usr/tests/lib/libc/gen/t_rbstress		tests-obsolete		obsolete

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.22 src/tests/lib/libc/gen/Makefile:1.23
--- src/tests/lib/libc/gen/Makefile:1.22	Mon May  9 05:17:12 2011
+++ src/tests/lib/libc/gen/Makefile	Tue May 10 13:03:06 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2011/05/09 05:17:12 jruoho Exp $
+# $NetBSD: Makefile,v 1.23 2011/05/10 13:03:06 jruoho Exp $
 
 .include bsd.own.mk
 
@@ -15,6 +15,7 @@
 TESTS_C+=	t_humanize_number
 TESTS_C+=	t_ldexp
 TESTS_C+=	t_nice
+TESTS_C+=	t_pause
 TESTS_C+=	t_raise
 TESTS_C+=	t_randomid
 TESTS_C+=	t_siginfo

Added files:

Index: src/tests/lib/libc/gen/t_pause.c
diff -u /dev/null src/tests/lib/libc/gen/t_pause.c:1.1
--- /dev/null	Tue May 10 13:03:06 2011
+++ src/tests/lib/libc/gen/t_pause.c	Tue May 10 13:03:06 2011
@@ -0,0 +1,114 @@
+/* $NetBSD: t_pause.c,v 1.1 2011/05/10 13:03:06 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_pause.c,v 1.1 2011/05/10 13:03:06 jruoho Exp $);
+
+#include sys/wait.h
+
+#include atf-c.h
+#include stdlib.h
+#include signal.h
+#include unistd.h
+
+static bool	fail;
+static void	handler(int);
+
+static void
+handler(int signo)
+{
+
+	if (signo == SIGALRM)
+		fail = false;
+}
+
+ATF_TC(pause_basic);
+ATF_TC_HEAD(pause_basic, tc)
+{
+	atf_tc_set_md_var(tc, descr, A basic test of pause(3), #1);
+}
+

CVS commit: src/sys/arch/hp300/hp300

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:38:08 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: autoconf.c machdep.c

Log Message:
Move intr_init() call from early hp300_init() to cpu_configure(9)
since interrupt functions would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/hp300/hp300/machdep.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.97 src/sys/arch/hp300/hp300/autoconf.c:1.98
--- src/sys/arch/hp300/hp300/autoconf.c:1.97	Sat Feb 12 05:08:40 2011
+++ src/sys/arch/hp300/hp300/autoconf.c	Tue May 10 14:38:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -282,6 +282,9 @@
 	/* Kick off autoconfiguration. */
 	(void)splhigh();
 
+	/* Initialize the interrupt handlers. */
+	intr_init();
+
 	if (config_rootfound(mainbus, NULL) == NULL)
 		panic(no mainbus found);
 

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.219 src/sys/arch/hp300/hp300/machdep.c:1.220
--- src/sys/arch/hp300/hp300/machdep.c:1.219	Fri Mar  4 22:25:25 2011
+++ src/sys/arch/hp300/hp300/machdep.c	Tue May 10 14:38:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -203,9 +203,6 @@
 	uvm_page_physload(atop(avail_start), atop(avail_end),
 	atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT);
 
-	/* Initialize the interrupt handlers. */
-	intr_init();
-
 	/* Calibrate the delay loop. */
 	hp300_calibrate_delay();
 



CVS commit: src/sys/arch/news68k/news68k

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:41:55 UTC 2011

Modified Files:
src/sys/arch/news68k/news68k: autoconf.c machdep.c

Log Message:
Move isrinit() call from early news68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/news68k/news68k/autoconf.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/news68k/news68k/machdep.c

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

Modified files:

Index: src/sys/arch/news68k/news68k/autoconf.c
diff -u src/sys/arch/news68k/news68k/autoconf.c:1.19 src/sys/arch/news68k/news68k/autoconf.c:1.20
--- src/sys/arch/news68k/news68k/autoconf.c:1.19	Tue Feb  8 20:20:20 2011
+++ src/sys/arch/news68k/news68k/autoconf.c	Tue May 10 14:41:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.19 2011/02/08 20:20:20 rmind Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.20 2011/05/10 14:41:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -51,7 +51,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.19 2011/02/08 20:20:20 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.20 2011/05/10 14:41:55 tsutsui Exp $);
 
 #include scsibus.h
 
@@ -68,6 +68,8 @@
 #include machine/romcall.h
 #include machine/autoconf.h
 
+#include news68k/news68k/isr.h
+
 /*
  * The following several variables are related to
  * the configuration process, and are used in initializing
@@ -91,6 +93,9 @@
 	 */
 	(void) splhigh();
 
+	/* Initialize the interrupt handlers. */
+	isrinit();
+
 	if (config_rootfound(mainbus, NULL) == NULL)
 		panic(autoconfig failed, no root);
 

Index: src/sys/arch/news68k/news68k/machdep.c
diff -u src/sys/arch/news68k/news68k/machdep.c:1.91 src/sys/arch/news68k/news68k/machdep.c:1.92
--- src/sys/arch/news68k/news68k/machdep.c:1.91	Sun Mar  6 14:54:47 2011
+++ src/sys/arch/news68k/news68k/machdep.c	Tue May 10 14:41:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.91 2011/03/06 14:54:47 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.92 2011/05/10 14:41:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.91 2011/03/06 14:54:47 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.92 2011/05/10 14:41:55 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -186,8 +186,6 @@
 		panic(impossible system type);
 	}
 
-	isrinit();
-
 	/*
 	 * Initialize error message buffer (at end of core).
 	 * avail_end was pre-decremented in pmap_bootstrap to compensate.



CVS commit: src/sys/arch/next68k/next68k

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:45:28 UTC 2011

Modified Files:
src/sys/arch/next68k/next68k: autoconf.c machdep.c

Log Message:
Move isrinit() call from early next68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/next68k/autoconf.c
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/next68k/next68k/machdep.c

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

Modified files:

Index: src/sys/arch/next68k/next68k/autoconf.c
diff -u src/sys/arch/next68k/next68k/autoconf.c:1.24 src/sys/arch/next68k/next68k/autoconf.c:1.25
--- src/sys/arch/next68k/next68k/autoconf.c:1.24	Tue Feb  8 20:20:21 2011
+++ src/sys/arch/next68k/next68k/autoconf.c	Tue May 10 14:45:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:21 rmind Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.25 2011/05/10 14:45:28 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:21 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.25 2011/05/10 14:45:28 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -96,6 +96,9 @@
 
 	booted_device = NULL;	/* set by device drivers (if found) */
 
+	/* Initialize the interrupt handlers. */
+	isrinit();
+
 #if 0
 	dma_rev = ((volatile u_char *)IIOV(NEXT_P_SCR1))[1];
 	switch (dma_rev) {

Index: src/sys/arch/next68k/next68k/machdep.c
diff -u src/sys/arch/next68k/next68k/machdep.c:1.102 src/sys/arch/next68k/next68k/machdep.c:1.103
--- src/sys/arch/next68k/next68k/machdep.c:1.102	Sat Mar  5 19:04:58 2011
+++ src/sys/arch/next68k/next68k/machdep.c	Tue May 10 14:45:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.103 2011/05/10 14:45:28 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 Darrin B. Jewell
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.103 2011/05/10 14:45:28 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -211,9 +211,6 @@
 		}
 	}
 
-	/* Initialize the interrupt handlers. */
-	isrinit();
-
 	/* Calibrate the delay loop. */
 	next68k_calibrate_delay();
 



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 15:20:19 UTC 2011

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Verify that strtod(3) honors the current rounding mode set by fesetround(3).
Passes on amd64. Prompted by a bug in the GNU C library.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/stdlib/t_strtod.c

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

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.7 src/tests/lib/libc/stdlib/t_strtod.c:1.8
--- src/tests/lib/libc/stdlib/t_strtod.c:1.7	Tue Apr 12 02:56:20 2011
+++ src/tests/lib/libc/stdlib/t_strtod.c	Tue May 10 15:20:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.7 2011/04/12 02:56:20 jruoho Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.8 2011/05/10 15:20:19 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,9 +32,10 @@
 /* Public domain, Otto Moerbeek o...@drijf.net, 2006. */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strtod.c,v 1.7 2011/04/12 02:56:20 jruoho Exp $);
+__RCSID($NetBSD: t_strtod.c,v 1.8 2011/05/10 15:20:19 jruoho Exp $);
 
 #include errno.h
+#include fenv.h
 #include math.h
 #include stdio.h
 #include stdlib.h
@@ -124,6 +125,38 @@
 #endif
 }
 
+ATF_TC(strtod_round);
+ATF_TC_HEAD(strtod_round, tc)
+{
+	atf_tc_set_md_var(tc, descr, Test rouding in strtod(3));
+}
+
+ATF_TC_BODY(strtod_round, tc)
+{
+#ifndef __vax__
+
+	const char *val;
+	double d1, d2;
+
+	/*
+	 * Test that strtod(3) honors the current rounding mode.
+	 *
+	 * The used value is somewhere near 1 + DBL_EPSILON + FLT_EPSILON.
+	 */
+	val = 1.0011920928977282585492503130808472633361816406;
+
+	(void)fesetround(FE_UPWARD);
+
+	d1 = strtod(val, NULL);
+
+	(void)fesetround(FE_DOWNWARD);
+
+	d2 = strtod(val, NULL);
+
+	ATF_REQUIRE(fabs(d1 - d2)  0.0);
+#endif
+}
+
 ATF_TC(strtod_underflow);
 ATF_TC_HEAD(strtod_underflow, tc)
 {
@@ -158,6 +191,7 @@
 	ATF_TP_ADD_TC(tp, strtod_basic);
 	ATF_TP_ADD_TC(tp, strtod_hex);
 	ATF_TP_ADD_TC(tp, strtod_inf);
+	ATF_TP_ADD_TC(tp, strtod_round);
 	ATF_TP_ADD_TC(tp, strtod_underflow);
 
 	return atf_no_error();



CVS commit: src/share/man/man7

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 17:00:44 UTC 2011

Modified Files:
src/share/man/man7: sticky.7

Log Message:
Use .Ss.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man7/sticky.7

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

Modified files:

Index: src/share/man/man7/sticky.7
diff -u src/share/man/man7/sticky.7:1.5 src/share/man/man7/sticky.7:1.6
--- src/share/man/man7/sticky.7:1.5	Mon Feb  5 14:54:31 2007
+++ src/share/man/man7/sticky.7	Tue May 10 17:00:44 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: sticky.7,v 1.5 2007/02/05 14:54:31 rillig Exp $
+.\	$NetBSD: sticky.7,v 1.6 2011/05/10 17:00:44 jruoho Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)sticky.8	8.1 (Berkeley) 6/5/93
 .\
-.Dd February 5, 2007
+.Dd May 10, 2011
 .Dt STICKY 7
 .Os
 .Sh NAME
@@ -45,14 +45,14 @@
 .Xr chmod 2
 or the file
 .Pa /usr/include/sys/stat.h
-.Sh STICKY FILES
+.Ss Sticky files
 For regular files, the use of mode
 .Dv S_ISVTX
 is reserved and can be set only by the super-user.
 .Nx
 does not currently treat regular files that have the sticky bit set
 specially, but this behavior might change in the future.
-.Sh STICKY DIRECTORIES
+.Ss Sticky directories
 A directory whose
 .Dq sticky bit
 is set becomes a



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 18:31:34 UTC 2011

Modified Files:
src/sys/dev/pci: if_hme_pci.c if_ral_pci.c machfb.c pci.c
pciide_common.c viaide.c

Log Message:
Stop abuse of PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED.  The flags
specifically tell a driver that bridges upstream forward PCI I/O (or
memory) transactions to the device.  Only bus drivers have any business
modifying these.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_hme_pci.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/if_ral_pci.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/machfb.c
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/pciide_common.c
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/viaide.c

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

Modified files:

Index: src/sys/dev/pci/if_hme_pci.c
diff -u src/sys/dev/pci/if_hme_pci.c:1.35 src/sys/dev/pci/if_hme_pci.c:1.36
--- src/sys/dev/pci/if_hme_pci.c:1.35	Tue Mar 23 21:54:23 2010
+++ src/sys/dev/pci/if_hme_pci.c	Tue May 10 18:31:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hme_pci.c,v 1.35 2010/03/23 21:54:23 dyoung Exp $	*/
+/*	$NetBSD: if_hme_pci.c,v 1.36 2011/05/10 18:31:33 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_hme_pci.c,v 1.35 2010/03/23 21:54:23 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_hme_pci.c,v 1.36 2011/05/10 18:31:33 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -155,12 +155,10 @@
 	 */
 	switch (type) {
 	case PCI_MAPREG_TYPE_MEM:
-		pa-pa_flags |= PCI_FLAGS_MEM_ENABLED;
 		csr |= PCI_COMMAND_MEM_ENABLE;
 		sc-sc_bustag = pa-pa_memt;
 		break;
 	case PCI_MAPREG_TYPE_IO:
-		pa-pa_flags |= PCI_FLAGS_IO_ENABLED;
 		csr |= PCI_COMMAND_IO_ENABLE;
 		sc-sc_bustag = pa-pa_iot;
 		break;

Index: src/sys/dev/pci/if_ral_pci.c
diff -u src/sys/dev/pci/if_ral_pci.c:1.15 src/sys/dev/pci/if_ral_pci.c:1.16
--- src/sys/dev/pci/if_ral_pci.c:1.15	Tue Jan 19 22:07:01 2010
+++ src/sys/dev/pci/if_ral_pci.c	Tue May 10 18:31:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_pci.c,v 1.15 2010/01/19 22:07:01 pooka Exp $	*/
+/*	$NetBSD: if_ral_pci.c,v 1.16 2011/05/10 18:31:33 dyoung Exp $	*/
 /*	$OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $  */
 
 /*-
@@ -22,7 +22,7 @@
  * PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ral_pci.c,v 1.15 2010/01/19 22:07:01 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ral_pci.c,v 1.16 2011/05/10 18:31:33 dyoung Exp $);
 
 
 #include sys/param.h
@@ -144,7 +144,6 @@
 	reg = pci_conf_read(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG);
 	reg |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
 	pci_conf_write(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG, reg);
-	pa-pa_flags |= PCI_FLAGS_MEM_ENABLED;
 
 	/* map control/status registers */
 	error = pci_mapreg_map(pa, RAL_PCI_BAR0, PCI_MAPREG_TYPE_MEM |

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.64 src/sys/dev/pci/machfb.c:1.65
--- src/sys/dev/pci/machfb.c:1.64	Wed May  4 23:36:21 2011
+++ src/sys/dev/pci/machfb.c	Tue May 10 18:31:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.64 2011/05/04 23:36:21 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.65 2011/05/10 18:31:33 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 __KERNEL_RCSID(0, 
-	$NetBSD: machfb.c,v 1.64 2011/05/04 23:36:21 macallan Exp $);
+	$NetBSD: machfb.c,v 1.65 2011/05/10 18:31:33 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -521,6 +521,7 @@
 	int setmode, width, height;
 	pcireg_t screg;
 	uint32_t reg;
+	const pcireg_t enables = PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_IO_ENABLE;
 
 	sc-sc_dev = self;
 	sc-sc_pc = pa-pa_pc;
@@ -543,9 +544,8 @@
 	
 	/* enable memory and disable IO access */
 	screg = pci_conf_read(sc-sc_pc, sc-sc_pcitag, PCI_COMMAND_STATUS_REG);
-	if ((screg  PCI_FLAGS_MEM_ENABLED) == 0) {
-		screg |= PCI_FLAGS_IO_ENABLED;
-		screg |= PCI_FLAGS_MEM_ENABLED;
+	if ((screg  enables) != enables) {
+		screg |= enables;
 		pci_conf_write(sc-sc_pc, sc-sc_pcitag,
 		PCI_COMMAND_STATUS_REG, screg);
 	}

Index: src/sys/dev/pci/pci.c
diff -u src/sys/dev/pci/pci.c:1.138 src/sys/dev/pci/pci.c:1.139
--- src/sys/dev/pci/pci.c:1.138	Tue Apr  5 23:10:52 2011
+++ src/sys/dev/pci/pci.c	Tue May 10 18:31:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.c,v 1.138 2011/04/05 23:10:52 dyoung Exp $	*/
+/*	$NetBSD: pci.c,v 1.139 2011/05/10 18:31:33 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci.c,v 1.138 2011/04/05 23:10:52 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci.c,v 1.139 2011/05/10 18:31:33 dyoung Exp $);
 
 #include opt_pci.h
 
@@ -370,10 +370,6 @@
 	 * as appropriate.
 	 

CVS commit: src/tests/usr.bin/unifdef

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 19:02:27 UTC 2011

Modified Files:
src/tests/usr.bin/unifdef: t_basic.sh

Log Message:
Add require.progs unifdef, to avoid failure if comp set is not
installed.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/unifdef/t_basic.sh

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

Modified files:

Index: src/tests/usr.bin/unifdef/t_basic.sh
diff -u src/tests/usr.bin/unifdef/t_basic.sh:1.2 src/tests/usr.bin/unifdef/t_basic.sh:1.3
--- src/tests/usr.bin/unifdef/t_basic.sh:1.2	Tue May  3 12:54:48 2011
+++ src/tests/usr.bin/unifdef/t_basic.sh	Tue May 10 19:02:27 2011
@@ -1,6 +1,6 @@
 #! /usr/bin/atf-sh
 #
-# $NetBSD: t_basic.sh,v 1.2 2011/05/03 12:54:48 jruoho Exp $
+# $NetBSD: t_basic.sh,v 1.3 2011/05/10 19:02:27 njoly Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,6 +33,7 @@
 atf_test_case basic
 basic_head() {
 	atf_set descr A basic test of unifdef(1)
+	atf_set require.progs unifdef
 }
 
 basic_body() {



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 19:18:19 UTC 2011

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Use the same conditional check from fenv.h to fix an immediate build error
pointed out by cliff@. (This does not however sound like a sane thing to
mandate from a C99 header.)


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

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

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.8 src/tests/lib/libc/stdlib/t_strtod.c:1.9
--- src/tests/lib/libc/stdlib/t_strtod.c:1.8	Tue May 10 15:20:19 2011
+++ src/tests/lib/libc/stdlib/t_strtod.c	Tue May 10 19:18:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.8 2011/05/10 15:20:19 jruoho Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.9 2011/05/10 19:18:19 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,10 +32,9 @@
 /* Public domain, Otto Moerbeek o...@drijf.net, 2006. */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strtod.c,v 1.8 2011/05/10 15:20:19 jruoho Exp $);
+__RCSID($NetBSD: t_strtod.c,v 1.9 2011/05/10 19:18:19 jruoho Exp $);
 
 #include errno.h
-#include fenv.h
 #include math.h
 #include stdio.h
 #include stdlib.h
@@ -44,6 +43,10 @@
 #include atf-c.h
 #include atf-c/config.h
 
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+#include fenv.h
+#endif
+
 ATF_TC(strtod_basic);
 ATF_TC_HEAD(strtod_basic, tc)
 {
@@ -133,7 +136,7 @@
 
 ATF_TC_BODY(strtod_round, tc)
 {
-#ifndef __vax__
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
 
 	const char *val;
 	double d1, d2;



CVS commit: src/share/misc

2011-05-10 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 10 23:33:07 UTC 2011

Modified Files:
src/share/misc: acronyms.comp

Log Message:
According to their home page, N of IANA is plural.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.124 src/share/misc/acronyms.comp:1.125
--- src/share/misc/acronyms.comp:1.124	Sat Mar 26 12:40:07 2011
+++ src/share/misc/acronyms.comp	Tue May 10 23:33:07 2011
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.124 2011/03/26 12:40:07 dholland Exp $
+$NetBSD: acronyms.comp,v 1.125 2011/05/10 23:33:07 enami Exp $
 
 3WHS	three-way handshake
 AA	anti-aliasing
@@ -456,7 +456,7 @@
 HZ	Hertz
 I2O	intelligent input/output
 IA	information assurance
-IANA	Internet assigned number authority
+IANA	Internet assigned numbers authority
 IBC	iterated block cipher
 IBM	International Business Machines
 IBS	instruction based sampling



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 23:48:33 UTC 2011

Modified Files:
src/sys/dev/pci: if_ral_pci.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_ral_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_ral_pci.c
diff -u src/sys/dev/pci/if_ral_pci.c:1.16 src/sys/dev/pci/if_ral_pci.c:1.17
--- src/sys/dev/pci/if_ral_pci.c:1.16	Tue May 10 18:31:33 2011
+++ src/sys/dev/pci/if_ral_pci.c	Tue May 10 23:48:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_pci.c,v 1.16 2011/05/10 18:31:33 dyoung Exp $	*/
+/*	$NetBSD: if_ral_pci.c,v 1.17 2011/05/10 23:48:33 dyoung Exp $	*/
 /*	$OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $  */
 
 /*-
@@ -22,7 +22,7 @@
  * PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ral_pci.c,v 1.16 2011/05/10 18:31:33 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ral_pci.c,v 1.17 2011/05/10 23:48:33 dyoung Exp $);
 
 
 #include sys/param.h
@@ -122,7 +122,7 @@
 {
 	struct ral_pci_softc *psc = device_private(self);
 	struct rt2560_softc *sc = psc-sc_sc;
-	struct pci_attach_args *pa = aux;
+	const struct pci_attach_args *pa = aux;
 	const char *intrstr;
 	char devinfo[256];
 	bus_addr_t base;



CVS commit: src/sys/arch/i386

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 23:58:25 UTC 2011

Modified Files:
src/sys/arch/i386: Makefile

Log Message:
Add to tags some assembly files in common/.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/Makefile

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

Modified files:

Index: src/sys/arch/i386/Makefile
diff -u src/sys/arch/i386/Makefile:1.40 src/sys/arch/i386/Makefile:1.41
--- src/sys/arch/i386/Makefile:1.40	Mon Apr  4 19:46:40 2011
+++ src/sys/arch/i386/Makefile	Tue May 10 23:58:25 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.40 2011/04/04 19:46:40 dyoung Exp $
+#	$NetBSD: Makefile,v 1.41 2011/05/10 23:58:25 dyoung Exp $
 
 # Makefile for i386 tags file and boot blocks
 
@@ -24,7 +24,8 @@
 	${SYSDIR}/arch/xen/xen/*.[ch] \
 	${SYSDIR}/arch/xen/xenbus/*.[ch] \
 	${SYSDIR}/arch/x86/pci/*.[ch]
-AI386=	${SYSDIR}/arch/i386/i386/*.S
+AI386=	${SYSDIR}/arch/i386/i386/*.S \
+	${SYSDIR}/../common/lib/libc/arch/i386/*/*.S
 
 # Directories in which to place tags links
 DI386=	i386 eisa isa include pci



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May 11 00:12:41 UTC 2011

Modified Files:
src/sys/dev/pci: chipsfb.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/chipsfb.c

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

Modified files:

Index: src/sys/dev/pci/chipsfb.c
diff -u src/sys/dev/pci/chipsfb.c:1.28 src/sys/dev/pci/chipsfb.c:1.29
--- src/sys/dev/pci/chipsfb.c:1.28	Tue Apr  5 23:25:00 2011
+++ src/sys/dev/pci/chipsfb.c	Wed May 11 00:12:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: chipsfb.c,v 1.28 2011/04/05 23:25:00 dyoung Exp $	*/
+/*	$NetBSD: chipsfb.c,v 1.29 2011/05/11 00:12:41 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: chipsfb.c,v 1.28 2011/04/05 23:25:00 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: chipsfb.c,v 1.29 2011/05/11 00:12:41 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -69,7 +69,7 @@
 static int
 chipsfb_pci_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct pci_attach_args *pa = (struct pci_attach_args *)aux;
+	const struct pci_attach_args *pa = (const struct pci_attach_args *)aux;
 
 	if (PCI_CLASS(pa-pa_class) != PCI_CLASS_DISPLAY ||
 	PCI_SUBCLASS(pa-pa_class) != PCI_SUBCLASS_DISPLAY_VGA)
@@ -88,7 +88,7 @@
 {
 	struct chipsfb_pci_softc *scp = device_private(self);
 	struct chipsfb_softc *sc = scp-sc_chips;
-	struct pci_attach_args *pa = aux;
+	const struct pci_attach_args *pa = aux;
 	char devinfo[256];
 	pcireg_t screg;
 



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May 11 00:17:55 UTC 2011

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.43 src/sys/dev/pci/radeonfb.c:1.44
--- src/sys/dev/pci/radeonfb.c:1.43	Fri Apr 15 21:47:39 2011
+++ src/sys/dev/pci/radeonfb.c	Wed May 11 00:17:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.43 2011/04/15 21:47:39 dyoung Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.44 2011/05/11 00:17:55 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.43 2011/04/15 21:47:39 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.44 2011/05/11 00:17:55 dyoung Exp $);
 
 #define RADEONFB_DEFAULT_DEPTH 8
 
@@ -107,7 +107,7 @@
 static paddr_t radeonfb_mmap(void *, void *, off_t, int);
 static int radeonfb_scratch_test(struct radeonfb_softc *, int, uint32_t);
 static void radeonfb_loadbios(struct radeonfb_softc *,
-struct pci_attach_args *);
+const struct pci_attach_args *);
 
 static uintmax_t radeonfb_getprop_num(struct radeonfb_softc *, const char *,
 uintmax_t);
@@ -416,7 +416,7 @@
 static int
 radeonfb_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct pci_attach_args	*pa = aux;
+	const struct pci_attach_args	*pa = aux;
 	int			i;
 
 	if (PCI_VENDOR(pa-pa_id) != PCI_VENDOR_ATI)
@@ -434,7 +434,7 @@
 radeonfb_attach(device_t parent, device_t dev, void *aux)
 {
 	struct radeonfb_softc	*sc = device_private(dev);
-	struct pci_attach_args	*pa = aux;
+	const struct pci_attach_args	*pa = aux;
 	const char		*mptr;
 	bus_size_t		bsz;
 	pcireg_t		screg;
@@ -1151,7 +1151,7 @@
 }
 
 static void
-radeonfb_loadbios(struct radeonfb_softc *sc, struct pci_attach_args *pa)
+radeonfb_loadbios(struct radeonfb_softc *sc, const struct pci_attach_args *pa)
 {
 	bus_space_tag_t		romt;
 	bus_space_handle_t	romh, biosh;



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-05-10 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Wed May 11 00:37:20 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c

Log Message:
simplify rmixl_com_initmap() a bit


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/arch/mips/rmi/rmixl_com.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.14 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.15
--- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.14	Fri May 21 23:33:52 2010
+++ src/sys/arch/mips/rmi/rmixl_com.c	Wed May 11 00:37:20 2011
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.1.2.14 2010/05/21 23:33:52 cliff Exp $ */
+/* $Id: rmixl_com.c,v 1.1.2.15 2011/05/11 00:37:20 cliff Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.14 2010/05/21 23:33:52 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.15 2011/05/11 00:37:20 cliff Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -300,14 +300,10 @@
 void
 rmixl_com_initmap(struct com_regs *regsp)
 {
-	int i;
-	int sz;
-
 	/*
 	 * map the 4 byte register stride
 	 */
-	sz = sizeof(regsp-cr_map) / sizeof(regsp-cr_map[0]);
-	for (i = 0; i  sz; i++)
+	for (int i = 0; i  __arraycount(regsp-cr_map); i++)
 		regsp-cr_map[i] = com_std_map[i] * 4;
 }
 



CVS commit: src/sys/arch/mips/rmi

2011-05-10 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Wed May 11 00:38:03 UTC 2011

Modified Files:
src/sys/arch/mips/rmi: rmixl_com.c

Log Message:
sync from matt-nb5-mips64 branch


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/rmi/rmixl_com.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.3 src/sys/arch/mips/rmi/rmixl_com.c:1.4
--- src/sys/arch/mips/rmi/rmixl_com.c:1.3	Sun Feb 20 07:48:37 2011
+++ src/sys/arch/mips/rmi/rmixl_com.c	Wed May 11 00:38:03 2011
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.3 2011/02/20 07:48:37 matt Exp $ */
+/* $Id: rmixl_com.c,v 1.4 2011/05/11 00:38:03 cliff Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.3 2011/02/20 07:48:37 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.4 2011/05/11 00:38:03 cliff Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -300,14 +300,10 @@
 void
 rmixl_com_initmap(struct com_regs *regsp)
 {
-	int i;
-	int sz;
-
 	/*
 	 * map the 4 byte register stride
 	 */
-	sz = sizeof(regsp-cr_map) / sizeof(regsp-cr_map[0]);
-	for (i = 0; i  sz; i++)
+	for (int i = 0; i  __arraycount(regsp-cr_map); i++)
 		regsp-cr_map[i] = com_std_map[i] * 4;
 }
 



CVS commit: src/usr.sbin/traceroute

2011-05-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 11 00:38:28 UTC 2011

Modified Files:
src/usr.sbin/traceroute: ifaddrlist.c ifaddrlist.h

Log Message:
Don't use a static buffer for ifaddrs (and not check for overflowing it!)
(speciallly if you are setuid!)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/traceroute/ifaddrlist.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/traceroute/ifaddrlist.h

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

Modified files:

Index: src/usr.sbin/traceroute/ifaddrlist.c
diff -u src/usr.sbin/traceroute/ifaddrlist.c:1.8 src/usr.sbin/traceroute/ifaddrlist.c:1.9
--- src/usr.sbin/traceroute/ifaddrlist.c:1.8	Mon May  9 21:52:49 2011
+++ src/usr.sbin/traceroute/ifaddrlist.c	Tue May 10 20:38:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifaddrlist.c,v 1.8 2011/05/10 01:52:49 christos Exp $	*/
+/*	$NetBSD: ifaddrlist.c,v 1.9 2011/05/11 00:38:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -39,7 +39,7 @@
 static const char rcsid[] =
 @(#) Header: ifaddrlist.c,v 1.2 97/04/22 13:31:05 leres Exp  (LBL);
 #else
-__RCSID($NetBSD: ifaddrlist.c,v 1.8 2011/05/10 01:52:49 christos Exp $);
+__RCSID($NetBSD: ifaddrlist.c,v 1.9 2011/05/11 00:38:28 christos Exp $);
 #endif
 #endif
 
@@ -82,29 +82,23 @@
 #define ISLOOPBACK(p) (strcmp((p)-ifa_name, lo0) == 0)
 #endif
 
-#define MAX_IPADDR 256
-
 /*
  * Return the interface list
  */
-int
-ifaddrlist(struct ifaddrlist **ipaddrp, char *errbuf, int buflen)
+ssize_t
+ifaddrlist(struct ifaddrlist **ipaddrp, char *errbuf, size_t buflen)
 {
-	int nipaddr;
 	struct sockaddr_in *sin;
-	struct ifaddrs *ifap, *ifa;
-	struct ifaddrlist *al;
-	static struct ifaddrlist xifaddrlist[MAX_IPADDR];
-
-	al = xifaddrlist;
-	nipaddr = 0;
-
-	if (getifaddrs(ifap) != 0) {
-		(void)snprintf(errbuf, buflen, getifaddrs: %s,
-		strerror(errno));
-		return (-1);
-	}
-
+	struct ifaddrs *ifap = NULL, *ifa;
+	struct ifaddrlist *al = NULL, *nal;
+	size_t i = 0, maxal = 10;
+
+	if (getifaddrs(ifap) != 0)
+		goto out;
+
+	if ((al = malloc(maxal * sizeof(*al))) == NULL)
+		goto out;
+		
 	for (ifa = ifap; ifa; ifa = ifa-ifa_next) {
 		if (ifa-ifa_addr-sa_family != AF_INET)
 			continue;
@@ -121,12 +115,31 @@
 			if (ntohl(sin-sin_addr.s_addr) == INADDR_LOOPBACK)
 continue;
 
-		al-addr = sin-sin_addr.s_addr;
-		al-device = strdup(ifa-ifa_name);
-		++al;
-		++nipaddr;
+		if (i == maxal) {
+			maxal = 1;
+			if ((nal = realloc(al, maxal * sizeof(*al))) == NULL)
+goto out;
+			al = nal;
+		}
+
+		al[i].addr = sin-sin_addr.s_addr;
+		if ((al[i].device = strdup(ifa-ifa_name)) == NULL)
+			goto out;
+		i++;
 	}
-	*ipaddrp = xifaddrlist;
+	if ((nal = realloc(al, i * sizeof(*al))) == NULL)
+		goto out;
 	freeifaddrs(ifap);
-	return (nipaddr);
+	*ipaddrp = nal;
+	return (ssize_t)i;
+out:
+	if (ifap)
+		freeifaddrs(ifap);
+	if (al) {
+		while (i  0)
+			free(al[--i].device);
+		free(al);
+	}
+	(void)snprintf(errbuf, buflen, %s: %s, __func__, strerror(errno));
+	return -1;
 }

Index: src/usr.sbin/traceroute/ifaddrlist.h
diff -u src/usr.sbin/traceroute/ifaddrlist.h:1.2 src/usr.sbin/traceroute/ifaddrlist.h:1.3
--- src/usr.sbin/traceroute/ifaddrlist.h:1.2	Sat Jul  4 16:47:24 1998
+++ src/usr.sbin/traceroute/ifaddrlist.h	Tue May 10 20:38:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifaddrlist.h,v 1.2 1998/07/04 20:47:24 mrg Exp $	*/
+/*	$NetBSD: ifaddrlist.h,v 1.3 2011/05/11 00:38:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -24,8 +24,8 @@
  */
 
 struct ifaddrlist {
-	u_int32_t addr;
+	uint32_t addr;
 	char *device;
 };
 
-int	ifaddrlist(struct ifaddrlist **, char *, int);
+ssize_t	ifaddrlist(struct ifaddrlist **, char *, size_t);



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 03:23:26 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c

Log Message:
convert parityLogDiskQueue.mutex to a kmutex/cv.

XXX: some splbio() usage to clean up here


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/raidframe/rf_paritylogging.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_paritylog.c
diff -u src/sys/dev/raidframe/rf_paritylog.c:1.14 src/sys/dev/raidframe/rf_paritylog.c:1.15
--- src/sys/dev/raidframe/rf_paritylog.c:1.14	Tue May 10 07:04:17 2011
+++ src/sys/dev/raidframe/rf_paritylog.c	Wed May 11 03:23:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.c,v 1.14 2011/05/10 07:04:17 mrg Exp $	*/
+/*	$NetBSD: rf_paritylog.c,v 1.15 2011/05/11 03:23:26 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.14 2011/05/10 07:04:17 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.15 2011/05/11 03:23:26 mrg Exp $);
 
 #include rf_archs.h
 
@@ -67,13 +67,13 @@
 	 * free list (rf_parityLogDiskQueue.freeCommonList).  If the free list
 	 * is empty, call RF_Malloc to create a new structure. NON-BLOCKING */
 
-	RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	if (raidPtr-parityLogDiskQueue.freeCommonList) {
 		common = raidPtr-parityLogDiskQueue.freeCommonList;
 		raidPtr-parityLogDiskQueue.freeCommonList = raidPtr-parityLogDiskQueue.freeCommonList-next;
-		RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+		rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	} else {
-		RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+		rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 		RF_Malloc(common, sizeof(RF_CommonLogData_t), (RF_CommonLogData_t *));
 		/* destroy is in rf_paritylogging.c */
 		rf_init_mutex2(common-mutex, IPL_VM);
@@ -92,10 +92,10 @@
 	 * NON-BLOCKING */
 
 	raidPtr = common-raidPtr;
-	RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	common-next = raidPtr-parityLogDiskQueue.freeCommonList;
 	raidPtr-parityLogDiskQueue.freeCommonList = common;
-	RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 }
 
 static RF_ParityLogData_t *
@@ -107,13 +107,13 @@
 	 * list (rf_parityLogDiskQueue.freeList).  If the free list is empty,
 	 * call RF_Malloc to create a new structure. NON-BLOCKING */
 
-	RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	if (raidPtr-parityLogDiskQueue.freeDataList) {
 		data = raidPtr-parityLogDiskQueue.freeDataList;
 		raidPtr-parityLogDiskQueue.freeDataList = raidPtr-parityLogDiskQueue.freeDataList-next;
-		RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+		rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	} else {
-		RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+		rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 		RF_Malloc(data, sizeof(RF_ParityLogData_t), (RF_ParityLogData_t *));
 	}
 	data-next = NULL;
@@ -133,14 +133,14 @@
 	 * NON-BLOCKING */
 
 	raidPtr = data-common-raidPtr;
-	RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	while (data) {
 		nextItem = data-next;
 		data-next = raidPtr-parityLogDiskQueue.freeDataList;
 		raidPtr-parityLogDiskQueue.freeDataList = data;
 		data = nextItem;
 	}
-	RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 }
 
 
@@ -160,7 +160,7 @@
 		printf([enqueueing parity log data, region %d, raidAddress %d, numSector %d]\n, data-regionID, (int) data-diskAddress.raidAddress, (int) data-diskAddress.numSector);
 	RF_ASSERT(data-prev == NULL);
 	RF_ASSERT(data-next == NULL);
-	RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	if (*head) {
 		/* insert into head of queue */
 		RF_ASSERT((*head)-prev == NULL);
@@ -177,7 +177,7 @@
 	}
 	RF_ASSERT((*head)-prev == NULL);
 	RF_ASSERT((*tail)-next == NULL);
-	RF_UNLOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+	rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 }
 
 static RF_ParityLogData_t *
@@ -194,7 +194,7 @@
 
 	/* remove from tail, preserving FIFO order */
 	if (!ignoreLocks)
-		RF_LOCK_MUTEX(raidPtr-parityLogDiskQueue.mutex);
+		rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	data = *tail;
 	if (data) {
 		if (*head == *tail) {
@@ -217,7 +217,7 @@
 		

CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 03:38:32 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c

Log Message:
convert reintMutex to a kmutex.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/raidframe/rf_paritylogging.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_paritylog.c
diff -u src/sys/dev/raidframe/rf_paritylog.c:1.15 src/sys/dev/raidframe/rf_paritylog.c:1.16
--- src/sys/dev/raidframe/rf_paritylog.c:1.15	Wed May 11 03:23:26 2011
+++ src/sys/dev/raidframe/rf_paritylog.c	Wed May 11 03:38:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.c,v 1.15 2011/05/11 03:23:26 mrg Exp $	*/
+/*	$NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.15 2011/05/11 03:23:26 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 mrg Exp $);
 
 #include rf_archs.h
 
@@ -548,7 +548,7 @@
 	 * specified region (regionID) to indicate that reintegration is in
 	 * progress for this region. NON-BLOCKING */
 
-	RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+	rf_lock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 	raidPtr-regionInfo[regionID].reintInProgress = RF_TRUE;	/* cleared when reint
 	 * complete */
 
@@ -558,7 +558,7 @@
 	rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 	log-next = raidPtr-parityLogDiskQueue.reintQueue;
 	raidPtr-parityLogDiskQueue.reintQueue = log;
-	RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+	rf_unlock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 	rf_signal_cond2(raidPtr-parityLogDiskQueue.cond);
 	rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 }
@@ -612,7 +612,7 @@
 	RF_ASSERT(log-next == NULL);
 
 	/* if reintegration is in progress, must queue work */
-	RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+	rf_lock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 	if (raidPtr-regionInfo[regionID].reintInProgress) {
 		/* Can not proceed since this region is currently being
 		 * reintegrated. We can not block, so queue remaining work and
@@ -625,10 +625,10 @@
 			RequeueParityLogData(logData, raidPtr-parityLogDiskQueue.reintBlockHead, raidPtr-parityLogDiskQueue.reintBlockTail);
 		else
 			EnqueueParityLogData(logData, raidPtr-parityLogDiskQueue.reintBlockHead, raidPtr-parityLogDiskQueue.reintBlockTail);
-		RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+		rf_unlock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 		return (1);	/* relenquish control of this thread */
 	}
-	RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+	rf_unlock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 	raidPtr-regionInfo[regionID].coreLog = NULL;
 	if ((raidPtr-regionInfo[regionID].diskCount)  raidPtr-regionInfo[regionID].capacity)
 		/* IMPORTANT!! this loop bound assumes region disk holds an
@@ -695,13 +695,13 @@
 	if (clearReintFlag) {
 		/* Enable flushing for this region.  Holding both locks
 		 * provides a synchronization barrier with DumpParityLogToDisk */
-		RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);
+		rf_lock_mutex2(raidPtr-regionInfo[regionID].reintMutex);
 		/* XXXmrg need this? */
 		rf_lock_mutex2(raidPtr-parityLogDiskQueue.mutex);
 		RF_ASSERT(raidPtr-regionInfo[regionID].reintInProgress == RF_TRUE);
 		raidPtr-regionInfo[regionID].diskCount = 0;
 		raidPtr-regionInfo[regionID].reintInProgress = RF_FALSE;
-		RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].reintMutex);	/* flushing is now
+		rf_unlock_mutex2(raidPtr-regionInfo[regionID].reintMutex);	/* flushing is now
 		 * enabled */
 		/* XXXmrg need this? */
 		rf_unlock_mutex2(raidPtr-parityLogDiskQueue.mutex);

Index: src/sys/dev/raidframe/rf_paritylog.h
diff -u src/sys/dev/raidframe/rf_paritylog.h:1.7 src/sys/dev/raidframe/rf_paritylog.h:1.8
--- src/sys/dev/raidframe/rf_paritylog.h:1.7	Wed May 11 03:23:26 2011
+++ src/sys/dev/raidframe/rf_paritylog.h	Wed May 11 03:38:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.h,v 1.7 2011/05/11 03:23:26 mrg Exp $	*/
+/*	$NetBSD: rf_paritylog.h,v 1.8 2011/05/11 03:38:32 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -146,7 +146,7 @@
 struct RF_RegionInfo_s {
 	RF_DECLARE_MUTEX(mutex)	/* protects: diskCount, diskMap,
  * loggingEnabled, coreLog */
-	RF_DECLARE_MUTEX(reintMutex)	/* protects: reintInProgress */
+	rf_declare_mutex2(reintMutex);	/* protects: reintInProgress */
 	int reintInProgress;/* flag 

CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 05:14:07 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c rf_threadstuff.h

Log Message:
convert regionInfo[regionID].mutex to a kmutex.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/raidframe/rf_paritylogging.c \
src/sys/dev/raidframe/rf_threadstuff.h

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

Modified files:

Index: src/sys/dev/raidframe/rf_paritylog.c
diff -u src/sys/dev/raidframe/rf_paritylog.c:1.16 src/sys/dev/raidframe/rf_paritylog.c:1.17
--- src/sys/dev/raidframe/rf_paritylog.c:1.16	Wed May 11 03:38:32 2011
+++ src/sys/dev/raidframe/rf_paritylog.c	Wed May 11 05:14:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 mrg Exp $	*/
+/*	$NetBSD: rf_paritylog.c,v 1.17 2011/05/11 05:14:07 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylog.c,v 1.17 2011/05/11 05:14:07 mrg Exp $);
 
 #include rf_archs.h
 
@@ -605,6 +605,8 @@
 	 *
 	 * NON-BLOCKING */
 
+	RF_ASSERT(rf_owned_mutex2(raidPtr-regionInfo[regionID].mutex));
+
 	if (rf_parityLogDebug)
 		printf([dumping parity log to disk, region %d]\n, regionID);
 	log = raidPtr-regionInfo[regionID].coreLog;
@@ -689,7 +691,7 @@
 	/* lock the region for the first item in logData */
 	RF_ASSERT(logData != NULL);
 	regionID = logData-regionID;
-	RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+	rf_lock_mutex2(raidPtr-regionInfo[regionID].mutex);
 	RF_ASSERT(raidPtr-regionInfo[regionID].loggingEnabled);
 
 	if (clearReintFlag) {
@@ -719,9 +721,9 @@
 
 		/* see if we moved to a new region */
 		if (regionID != item-regionID) {
-			RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+			rf_unlock_mutex2(raidPtr-regionInfo[regionID].mutex);
 			regionID = item-regionID;
-			RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+			rf_lock_mutex2(raidPtr-regionInfo[regionID].mutex);
 			RF_ASSERT(raidPtr-regionInfo[regionID].loggingEnabled);
 		}
 		punt = RF_FALSE;/* Set to RF_TRUE if work is blocked.  This
@@ -845,7 +847,7 @@
 FreeParityLogData(item);
 		}
 	}
-	RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+	rf_unlock_mutex2(raidPtr-regionInfo[regionID].mutex);
 	if (rf_parityLogDebug)
 		printf([exiting ParityLogAppend]\n);
 	return (0);
@@ -858,9 +860,9 @@
 	int regionID;
 
 	for (regionID = 0; regionID  rf_numParityRegions; regionID++) {
-		RF_LOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+		rf_lock_mutex2(raidPtr-regionInfo[regionID].mutex);
 		raidPtr-regionInfo[regionID].loggingEnabled = RF_TRUE;
-		RF_UNLOCK_MUTEX(raidPtr-regionInfo[regionID].mutex);
+		rf_unlock_mutex2(raidPtr-regionInfo[regionID].mutex);
 	}
 	if (rf_parityLogDebug)
 		printf([parity logging enabled]\n);

Index: src/sys/dev/raidframe/rf_paritylog.h
diff -u src/sys/dev/raidframe/rf_paritylog.h:1.8 src/sys/dev/raidframe/rf_paritylog.h:1.9
--- src/sys/dev/raidframe/rf_paritylog.h:1.8	Wed May 11 03:38:32 2011
+++ src/sys/dev/raidframe/rf_paritylog.h	Wed May 11 05:14:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylog.h,v 1.8 2011/05/11 03:38:32 mrg Exp $	*/
+/*	$NetBSD: rf_paritylog.h,v 1.9 2011/05/11 05:14:07 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -144,8 +144,8 @@
 };
 
 struct RF_RegionInfo_s {
-	RF_DECLARE_MUTEX(mutex)	/* protects: diskCount, diskMap,
- * loggingEnabled, coreLog */
+	rf_declare_mutex2(mutex);	/* protects: diskCount, diskMap,
+	 * loggingEnabled, coreLog */
 	rf_declare_mutex2(reintMutex);	/* protects: reintInProgress */
 	int reintInProgress;/* flag used to suspend flushing operations */
 	RF_SectorCount_t capacity;	/* capacity of this region in sectors */

Index: src/sys/dev/raidframe/rf_paritylogDiskMgr.c
diff -u src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.26 src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.27
--- src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.26	Wed May 11 03:38:32 2011
+++ src/sys/dev/raidframe/rf_paritylogDiskMgr.c	Wed May 11 05:14:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_paritylogDiskMgr.c,v 1.26 2011/05/11 03:38:32 mrg Exp $	*/
+/*	$NetBSD: rf_paritylogDiskMgr.c,v 1.27 2011/05/11 05:14:07 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritylogDiskMgr.c,v 1.26 2011/05/11 03:38:32 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritylogDiskMgr.c,v 1.27 2011/05/11 05:14:07 

CVS commit: src/lib/libm

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:38:33 UTC 2011

Modified Files:
src/lib/libm: Makefile
src/lib/libm/man: ieee.3
Added Files:
src/lib/libm/man: ilogb.3

Log Message:
Split out the ilogb(3) family out of ieee(3) and properly document it.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/lib/libm/Makefile
cvs rdiff -u -r1.24 -r1.25 src/lib/libm/man/ieee.3
cvs rdiff -u -r0 -r1.1 src/lib/libm/man/ilogb.3

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



CVS commit: src/share/man/man3

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:39:46 UTC 2011

Modified Files:
src/share/man/man3: ilog2.3

Log Message:
Xref ilogb(3).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man3/ilog2.3

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



CVS commit: othersrc/external/bsd/gensetlist

2011-05-10 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 10 06:41:26 UTC 2011

Modified Files:
othersrc/external/bsd/gensetlist: gensetlist.c

Log Message:
Occasional MAN definitions can hold multiple pages (see src/bin/pax for one
example).

Change the parsing of the contents of MAN definitions so that both single
and multiple definitions of man pages can be recognised.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/gensetlist/gensetlist.c

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



CVS commit: othersrc/external/bsd/gensetlist

2011-05-10 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 10 06:42:13 UTC 2011

Modified Files:
othersrc/external/bsd/gensetlist: Makefile bsd.setlist.mk

Log Message:
add license

set binary directory explicitly


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/gensetlist/Makefile
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/gensetlist/bsd.setlist.mk

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



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:55:27 UTC 2011

Modified Files:
src/tests/lib/libc/string: t_strerror.c

Log Message:
Fix typo.


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

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



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 06:58:17 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_alarm.c

Log Message:
Fix comment/string typos.


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

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



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 10 07:04:17 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h rf_paritylogging.c
rf_reconmap.c rf_reconmap.h rf_states.c

Log Message:
convert RF_CommonLogData_s/RF_ReconMap_s mutex to a kmutex/cv.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/raidframe/rf_paritylogging.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/raidframe/rf_reconmap.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/raidframe/rf_reconmap.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/raidframe/rf_states.c

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



CVS commit: src/sys/ufs/ufs

2011-05-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue May 10 08:29:32 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
Fix filesystem root leaked lock when using UFS_EXTATTR_AUTOSTART.
This way, statvfs(2) calls obtained by df(1) or umount(8) will no
longer sleep forever in the kernel to acquire the lock.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/ufs/ufs/ufs_extattr.c

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



CVS commit: src/lib/libm

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 09:07:51 UTC 2011

Modified Files:
src/lib/libm: Makefile

Log Message:
Remove trailing '\'.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/lib/libm/Makefile

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



CVS commit: src/share/man/man3

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 12:09:00 UTC 2011

Modified Files:
src/share/man/man3: fast_divide32.3

Log Message:
Xref div(3) and remainder(3).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3/fast_divide32.3

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



CVS commit: src/lib/libperfuse

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 12:14:37 UTC 2011

Modified Files:
src/lib/libperfuse: libperfuse.3

Log Message:
Small typo in macro (Xd - Xr).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libperfuse/libperfuse.3

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



CVS commit: src/usr.sbin/perfused

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 12:16:19 UTC 2011

Modified Files:
src/usr.sbin/perfused: perfused.8

Log Message:
Fix prologue macros order.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/perfused/perfused.8

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



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 12:43:42 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_raise.c

Log Message:
Add also a simplistic stress unit test.


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

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



CVS commit: src

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 13:03:06 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/gen: Makefile
Added Files:
src/tests/lib/libc/gen: t_pause.c

Log Message:
Few naive tests for pause(3).


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/t_pause.c

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



CVS commit: src/sys/arch/hp300/hp300

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:38:08 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: autoconf.c machdep.c

Log Message:
Move intr_init() call from early hp300_init() to cpu_configure(9)
since interrupt functions would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/hp300/hp300/machdep.c

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



CVS commit: src/sys/arch/news68k/news68k

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:41:55 UTC 2011

Modified Files:
src/sys/arch/news68k/news68k: autoconf.c machdep.c

Log Message:
Move isrinit() call from early news68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/news68k/news68k/autoconf.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/news68k/news68k/machdep.c

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



CVS commit: src/sys/arch/next68k/next68k

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:45:28 UTC 2011

Modified Files:
src/sys/arch/next68k/next68k: autoconf.c machdep.c

Log Message:
Move isrinit() call from early next68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/next68k/autoconf.c
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/next68k/next68k/machdep.c

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



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 15:20:19 UTC 2011

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Verify that strtod(3) honors the current rounding mode set by fesetround(3).
Passes on amd64. Prompted by a bug in the GNU C library.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/stdlib/t_strtod.c

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



CVS commit: src/share/man/man7

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 17:00:44 UTC 2011

Modified Files:
src/share/man/man7: sticky.7

Log Message:
Use .Ss.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man7/sticky.7

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



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 18:31:34 UTC 2011

Modified Files:
src/sys/dev/pci: if_hme_pci.c if_ral_pci.c machfb.c pci.c
pciide_common.c viaide.c

Log Message:
Stop abuse of PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED.  The flags
specifically tell a driver that bridges upstream forward PCI I/O (or
memory) transactions to the device.  Only bus drivers have any business
modifying these.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_hme_pci.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/if_ral_pci.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/machfb.c
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/pciide_common.c
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/viaide.c

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



CVS commit: src/tests/usr.bin/unifdef

2011-05-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue May 10 19:02:27 UTC 2011

Modified Files:
src/tests/usr.bin/unifdef: t_basic.sh

Log Message:
Add require.progs unifdef, to avoid failure if comp set is not
installed.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/unifdef/t_basic.sh

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



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

2011-05-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May 10 19:18:19 UTC 2011

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Use the same conditional check from fenv.h to fix an immediate build error
pointed out by cliff@. (This does not however sound like a sane thing to
mandate from a C99 header.)


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

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



CVS commit: src/share/misc

2011-05-10 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 10 23:33:07 UTC 2011

Modified Files:
src/share/misc: acronyms.comp

Log Message:
According to their home page, N of IANA is plural.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/share/misc/acronyms.comp

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



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 23:48:33 UTC 2011

Modified Files:
src/sys/dev/pci: if_ral_pci.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_ral_pci.c

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



CVS commit: src/sys/arch/i386

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May 10 23:58:25 UTC 2011

Modified Files:
src/sys/arch/i386: Makefile

Log Message:
Add to tags some assembly files in common/.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/Makefile

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



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May 11 00:12:41 UTC 2011

Modified Files:
src/sys/dev/pci: chipsfb.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/chipsfb.c

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



CVS commit: src/sys/dev/pci

2011-05-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May 11 00:17:55 UTC 2011

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
Constify pci_attach_args.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/radeonfb.c

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



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-05-10 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Wed May 11 00:37:20 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c

Log Message:
simplify rmixl_com_initmap() a bit


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/arch/mips/rmi/rmixl_com.c

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



CVS commit: src/sys/arch/mips/rmi

2011-05-10 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Wed May 11 00:38:03 UTC 2011

Modified Files:
src/sys/arch/mips/rmi: rmixl_com.c

Log Message:
sync from matt-nb5-mips64 branch


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/rmi/rmixl_com.c

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



CVS commit: src/usr.sbin/traceroute

2011-05-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 11 00:38:28 UTC 2011

Modified Files:
src/usr.sbin/traceroute: ifaddrlist.c ifaddrlist.h

Log Message:
Don't use a static buffer for ifaddrs (and not check for overflowing it!)
(speciallly if you are setuid!)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/traceroute/ifaddrlist.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/traceroute/ifaddrlist.h

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



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 03:23:26 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c

Log Message:
convert parityLogDiskQueue.mutex to a kmutex/cv.

XXX: some splbio() usage to clean up here


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/raidframe/rf_paritylogging.c

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



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 03:38:32 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c

Log Message:
convert reintMutex to a kmutex.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/raidframe/rf_paritylogging.c

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



CVS commit: src/sys/dev/raidframe

2011-05-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 11 05:14:07 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h
rf_paritylogDiskMgr.c rf_paritylogging.c rf_threadstuff.h

Log Message:
convert regionInfo[regionID].mutex to a kmutex.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/raidframe/rf_paritylog.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/raidframe/rf_paritylog.h
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/raidframe/rf_paritylogDiskMgr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/raidframe/rf_paritylogging.c \
src/sys/dev/raidframe/rf_threadstuff.h

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