xref: /freebsd/share/man/man9/KASSERT.9 (revision 0cf729409250f9bc985dc5fef24caeddbc177e75)
16fc639dcSJonathan M. Bresler.\" -*- nroff -*-
26fc639dcSJonathan M. Bresler.\"
3eb2630afSJeroen Ruigrok van der Werven.\" Copyright (c) 2000 Jonathan M. Bresler
46fc639dcSJonathan M. Bresler.\"
56fc639dcSJonathan M. Bresler.\" All rights reserved.
66fc639dcSJonathan M. Bresler.\"
76fc639dcSJonathan M. Bresler.\" This program is free software.
86fc639dcSJonathan M. Bresler.\"
96fc639dcSJonathan M. Bresler.\" Redistribution and use in source and binary forms, with or without
106fc639dcSJonathan M. Bresler.\" modification, are permitted provided that the following conditions
116fc639dcSJonathan M. Bresler.\" are met:
126fc639dcSJonathan M. Bresler.\" 1. Redistributions of source code must retain the above copyright
136fc639dcSJonathan M. Bresler.\"    notice, this list of conditions and the following disclaimer.
146fc639dcSJonathan M. Bresler.\" 2. Redistributions in binary form must reproduce the above copyright
156fc639dcSJonathan M. Bresler.\"    notice, this list of conditions and the following disclaimer in the
166fc639dcSJonathan M. Bresler.\"    documentation and/or other materials provided with the distribution.
176fc639dcSJonathan M. Bresler.\"
186fc639dcSJonathan M. Bresler.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
196fc639dcSJonathan M. Bresler.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
206fc639dcSJonathan M. Bresler.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
216fc639dcSJonathan M. Bresler.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
226fc639dcSJonathan M. Bresler.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
236fc639dcSJonathan M. Bresler.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246fc639dcSJonathan M. Bresler.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256fc639dcSJonathan M. Bresler.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266fc639dcSJonathan M. Bresler.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
276fc639dcSJonathan M. Bresler.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286fc639dcSJonathan M. Bresler.\"
296fc639dcSJonathan M. Bresler.\" $FreeBSD$
306fc639dcSJonathan M. Bresler.\"
316fc639dcSJonathan M. Bresler.Dd January 14, 2000
326fc639dcSJonathan M. Bresler.Os
336fc639dcSJonathan M. Bresler.Dt KASSERT 9
346fc639dcSJonathan M. Bresler.Sh NAME
356fc639dcSJonathan M. Bresler.Nm KASSERT
366fc639dcSJonathan M. Bresler.Nd kernel expression verification macro
376fc639dcSJonathan M. Bresler.Sh SYNOPSIS
380cf72940SRuslan Ermilov.Cd "options INVARIANTS"
390cf72940SRuslan Ermilov.Pp
40f16b3c0dSChad David.In sys/param.h
41f16b3c0dSChad David.In sys/systm.h
42f16b3c0dSChad David.Fn KASSERT expression msg
436fc639dcSJonathan M. Bresler.Sh DESCRIPTION
440cf72940SRuslan ErmilovIn a kernel compiled with
450cf72940SRuslan Ermilov.Cd "options INVARIANTS" ,
466fc639dcSJonathan M. Breslerthe
476fc639dcSJonathan M. Bresler.Fn KASSERT
486fc639dcSJonathan M. Breslermacro tests the given
490cf72940SRuslan Ermilov.Fa expression
506fc639dcSJonathan M. Breslerand if it is false,
516fc639dcSJonathan M. Breslercalls the
520cf72940SRuslan Ermilov.Xr panic 9
530cf72940SRuslan Ermilovfunction, terminating the running system.
546fc639dcSJonathan M. Bresler.Pp
550cf72940SRuslan ErmilovIn a kernel that does not have
560cf72940SRuslan Ermilov.Cd "options INVARIANTS" ,
576fc639dcSJonathan M. Breslerthe
586fc639dcSJonathan M. Bresler.Fn KASSERT
59eb2630afSJeroen Ruigrok van der Wervenmacro is defined to be a no-op.
6025216c5cSJeroen Ruigrok van der Werven.Sh EXAMPLES
616fc639dcSJonathan M. BreslerThe kernel function
626fc639dcSJonathan M. Bresler.Fn vput
630cf72940SRuslan Ermilovmust not be called with a
640cf72940SRuslan Ermilov.Dv NULL
650cf72940SRuslan Ermilovpointer.
666fc639dcSJonathan M. Bresler.Bd -literal -offset indent
676fc639dcSJonathan M. Breslervoid
686fc639dcSJonathan M. Breslervput(vp)
696fc639dcSJonathan M. Bresler        struct vnode *vp;
706fc639dcSJonathan M. Bresler{
716fc639dcSJonathan M. Bresler	struct proc *p = curproc;
726fc639dcSJonathan M. Bresler	KASSERT(vp != NULL, ("vput: null vp"));
736fc639dcSJonathan M. Bresler	...
746fc639dcSJonathan M. Bresler}
756fc639dcSJonathan M. Bresler.Ed
76f16b3c0dSChad David.Sh NOTES
77f16b3c0dSChad David.Fa msg
780cf72940SRuslan Ermilovmust be enclosed in parentheses.
796fc639dcSJonathan M. Bresler.Sh SEE ALSO
806fc639dcSJonathan M. Bresler.Xr config 8 ,
818abb3721SJeroen Ruigrok van der Werven.Xr panic 9
826fc639dcSJonathan M. Bresler.Sh AUTHORS
83eb2630afSJeroen Ruigrok van der WervenThis manual page was written by
84eb2630afSJeroen Ruigrok van der Werven.An Jonathan M. Bresler
85d905b0b6SMike Pritchard.Aq jmb@FreeBSD.org .
86