Module Name: src Committed By: jruoho Date: Wed Apr 6 05:40:19 UTC 2011
Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: KASSERT.9 Makefile Log Message: Note also KASSERTMSG(). Small markup changes. To generate a diff of this commit: cvs rdiff -u -r1.1608 -r1.1609 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/KASSERT.9 cvs rdiff -u -r1.345 -r1.346 src/share/man/man9/Makefile 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/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1608 src/distrib/sets/lists/comp/mi:1.1609 --- src/distrib/sets/lists/comp/mi:1.1608 Mon Apr 4 11:32:25 2011 +++ src/distrib/sets/lists/comp/mi Wed Apr 6 05:40:18 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1608 2011/04/04 11:32:25 blymn Exp $ +# $NetBSD: mi,v 1.1609 2011/04/06 05:40:18 jruoho Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -8914,6 +8914,7 @@ ./usr/share/man/cat9/HOLDRELE.0 comp-obsolete obsolete ./usr/share/man/cat9/ISSET.0 comp-sys-catman .cat ./usr/share/man/cat9/KASSERT.0 comp-sys-catman .cat +./usr/share/man/cat9/KASSERTMSG.0 comp-sys-catman .cat ./usr/share/man/cat9/KDASSERT.0 comp-sys-catman .cat ./usr/share/man/cat9/KNOTE.0 comp-sys-catman .cat ./usr/share/man/cat9/LWP_CACHE_CREDS.0 comp-sys-catman .cat @@ -14906,6 +14907,7 @@ ./usr/share/man/html9/HOLDRELE.html comp-obsolete obsolete ./usr/share/man/html9/ISSET.html comp-sys-htmlman html ./usr/share/man/html9/KASSERT.html comp-sys-htmlman html +./usr/share/man/html9/KASSERTMSG.html comp-sys-htmlman html ./usr/share/man/html9/KDASSERT.html comp-sys-htmlman html ./usr/share/man/html9/KNOTE.html comp-sys-htmlman html ./usr/share/man/html9/LWP_CACHE_CREDS.html comp-sys-htmlman html @@ -20983,6 +20985,7 @@ ./usr/share/man/man9/HOLDRELE.9 comp-obsolete obsolete ./usr/share/man/man9/ISSET.9 comp-sys-man .man ./usr/share/man/man9/KASSERT.9 comp-sys-man .man +./usr/share/man/man9/KASSERTMSG.9 comp-sys-man .man ./usr/share/man/man9/KDASSERT.9 comp-sys-man .man ./usr/share/man/man9/KNOTE.9 comp-sys-man .man ./usr/share/man/man9/LWP_CACHE_CREDS.9 comp-sys-man .man Index: src/share/man/man9/KASSERT.9 diff -u src/share/man/man9/KASSERT.9:1.11 src/share/man/man9/KASSERT.9:1.12 --- src/share/man/man9/KASSERT.9:1.11 Wed Jan 26 09:53:20 2011 +++ src/share/man/man9/KASSERT.9 Wed Apr 6 05:40:19 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: KASSERT.9,v 1.11 2011/01/26 09:53:20 wiz Exp $ +.\" $NetBSD: KASSERT.9,v 1.12 2011/04/06 05:40:19 jruoho Exp $ .\" .\" Copyright (c) 2006 Igor Sobrado .\" All rights reserved. @@ -24,17 +24,20 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 26, 2011 +.Dd April 6, 2011 .Dt KASSERT 9 .Os .Sh NAME .Nm KASSERT , +.Nm KASSERTMSG , .Nm KDASSERT .Nd kernel expression verification macros .Sh SYNOPSIS .Ft void .Fn KASSERT expression .Ft void +.Fn KASSERTMSG expression message +.Ft void .Fn KDASSERT expression .Sh DESCRIPTION These machine independent assertion-checking macros cause a kernel @@ -42,32 +45,40 @@ if the given .Ar expression evaluates to false. -.Pp +Two compile-time +.Xr options 4 +define the behavior of the checks. +.Bl -enum -offset 2n +.It +The .Fn KASSERT +and +.Fn KASSERTMSG tests are included only in kernels compiled with the .Dv DIAGNOSTIC configuration option. -In a kernel that does not have this configuration option, the -.Fn KASSERT -macro is defined to be a no-op. -.Pp +In a kernel that does not have this configuration option, +the macros are defined to be no-ops. +.It +The .Fn KDASSERT tests are included only in kernels compiled with the .Dv DEBUG configuration option. +The .Fn KDASSERT and .Fn KASSERT -are identical except for the controlling option +macros are identical except for the controlling option .Pf ( Dv DEBUG vs .Dv DIAGNOSTIC ) . -.Pp Basically, .Fn KASSERT should be used for light-weight checks and .Fn KDASSERT should be used for heavier ones. +.El .Pp Callers should not rely on the side effects of .Ar expression @@ -78,6 +89,13 @@ The panic message will display the style of assertion (debugging vs. diagnostic), the expression that failed and the filename, and line number the failure happened on. +The +.Fn KASSERTMSG +macro appends additional +.Fa message +to the +.Xr panic 9 +format string. .Sh SEE ALSO .Xr config 1 , .Xr options 4 , Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.345 src/share/man/man9/Makefile:1.346 --- src/share/man/man9/Makefile:1.345 Sat Feb 26 18:07:17 2011 +++ src/share/man/man9/Makefile Wed Apr 6 05:40:19 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.345 2011/02/26 18:07:17 ahoka Exp $ +# $NetBSD: Makefile,v 1.346 2011/04/06 05:40:19 jruoho Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -80,7 +80,8 @@ MAN+= CTASSERT.9 MAN+= KASSERT.9 -MLINKS+=KASSERT.9 KDASSERT.9 +MLINKS+=KASSERT.9 KASSERTMSG.9 \ + KASSERT.9 KDASSERT.9 MLINKS+=accept_filter.9 accept_filt_add.9 MLINKS+=accept_filter.9 accept_filt_del.9