Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Note also KASSERTMSG(). Small markup changes.
details: https://anonhg.NetBSD.org/src/rev/ceb1a1b5f682
branches: trunk
changeset: 763880:ceb1a1b5f682
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Apr 06 05:40:18 2011 +0000
description:
Note also KASSERTMSG(). Small markup changes.
diffstat:
distrib/sets/lists/comp/mi | 5 ++++-
share/man/man9/KASSERT.9 | 36 +++++++++++++++++++++++++++---------
share/man/man9/Makefile | 5 +++--
3 files changed, 34 insertions(+), 12 deletions(-)
diffs (145 lines):
diff -r a6b8d3e79f14 -r ceb1a1b5f682 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Wed Apr 06 05:39:51 2011 +0000
+++ b/distrib/sets/lists/comp/mi Wed Apr 06 05:40:18 2011 +0000
@@ -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
diff -r a6b8d3e79f14 -r ceb1a1b5f682 share/man/man9/KASSERT.9
--- a/share/man/man9/KASSERT.9 Wed Apr 06 05:39:51 2011 +0000
+++ b/share/man/man9/KASSERT.9 Wed Apr 06 05:40:18 2011 +0000
@@ -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 ,
diff -r a6b8d3e79f14 -r ceb1a1b5f682 share/man/man9/Makefile
--- a/share/man/man9/Makefile Wed Apr 06 05:39:51 2011 +0000
+++ b/share/man/man9/Makefile Wed Apr 06 05:40:18 2011 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index