xref: /freebsd/share/man/man9/KASSERT.9 (revision f16b3c0de48d0b845357e7cca843f645bc3117e3)
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
38f16b3c0dSChad David.In sys/param.h
39f16b3c0dSChad David.In sys/systm.h
40eb2630afSJeroen Ruigrok van der Werven.Cd options INVARIANTS
41f16b3c0dSChad David.Fn KASSERT expression msg
426fc639dcSJonathan M. Bresler.Sh DESCRIPTION
436fc639dcSJonathan M. BreslerIn a kernel compiled with "options INVARIANTS",
446fc639dcSJonathan M. Breslerthe
456fc639dcSJonathan M. Bresler.Fn KASSERT
466fc639dcSJonathan M. Breslermacro tests the given
476fc639dcSJonathan M. Bresler.Ar expression
486fc639dcSJonathan M. Breslerand if it is false,
496fc639dcSJonathan M. Breslercalls the
506fc639dcSJonathan M. Bresler.Fn panic
516fc639dcSJonathan M. Breslersyscall, terminating the running system.
526fc639dcSJonathan M. Bresler.Pp
536fc639dcSJonathan M. BreslerIn a kernel that does not have "options INVARIANTS",
546fc639dcSJonathan M. Breslerthe
556fc639dcSJonathan M. Bresler.Fn KASSERT
56eb2630afSJeroen Ruigrok van der Wervenmacro is defined to be a no-op.
5725216c5cSJeroen Ruigrok van der Werven.Sh EXAMPLES
586fc639dcSJonathan M. BreslerThe kernel function
596fc639dcSJonathan M. Bresler.Fn vput
606fc639dcSJonathan M. Breslermust not be called with a NULL pointer.
616fc639dcSJonathan M. Bresler.Bd -literal -offset indent
626fc639dcSJonathan M. Breslervoid
636fc639dcSJonathan M. Breslervput(vp)
646fc639dcSJonathan M. Bresler        struct vnode *vp;
656fc639dcSJonathan M. Bresler{
666fc639dcSJonathan M. Bresler	struct proc *p = curproc;
676fc639dcSJonathan M. Bresler	KASSERT(vp != NULL, ("vput: null vp"));
686fc639dcSJonathan M. Bresler	...
696fc639dcSJonathan M. Bresler}
706fc639dcSJonathan M. Bresler.Ed
71f16b3c0dSChad David.Sh NOTES
72f16b3c0dSChad David.Fa msg
73f16b3c0dSChad Davidmust be enclosed in brackets.
746fc639dcSJonathan M. Bresler.Sh SEE ALSO
756fc639dcSJonathan M. Bresler.Xr config 8 ,
768abb3721SJeroen Ruigrok van der Werven.Xr panic 9
776fc639dcSJonathan M. Bresler.Sh AUTHORS
78eb2630afSJeroen Ruigrok van der WervenThis manual page was written by
79eb2630afSJeroen Ruigrok van der Werven.An Jonathan M. Bresler
80d905b0b6SMike Pritchard.Aq jmb@FreeBSD.org .
81