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 38eb2630afSJeroen Ruigrok van der Werven.Cd options INVARIANTS 39eb2630afSJeroen Ruigrok van der Werven.Fn KASSERT "int expression, const char *msg" 406fc639dcSJonathan M. Bresler.Sh DESCRIPTION 416fc639dcSJonathan M. BreslerIn a kernel compiled with "options INVARIANTS", 426fc639dcSJonathan M. Breslerthe 436fc639dcSJonathan M. Bresler.Fn KASSERT 446fc639dcSJonathan M. Breslermacro tests the given 456fc639dcSJonathan M. Bresler.Ar expression 466fc639dcSJonathan M. Breslerand if it is false, 476fc639dcSJonathan M. Breslercalls the 486fc639dcSJonathan M. Bresler.Fn panic 496fc639dcSJonathan M. Breslersyscall, terminating the running system. 506fc639dcSJonathan M. Bresler.Pp 516fc639dcSJonathan M. BreslerIn a kernel that does not have "options INVARIANTS", 526fc639dcSJonathan M. Breslerthe 536fc639dcSJonathan M. Bresler.Fn KASSERT 54eb2630afSJeroen Ruigrok van der Wervenmacro is defined to be a no-op. 5525216c5cSJeroen Ruigrok van der Werven.Sh EXAMPLES 566fc639dcSJonathan M. BreslerThe kernel function 576fc639dcSJonathan M. Bresler.Fn vput 586fc639dcSJonathan M. Breslermust not be called with a NULL pointer. 596fc639dcSJonathan M. Bresler.Bd -literal -offset indent 606fc639dcSJonathan M. Breslervoid 616fc639dcSJonathan M. Breslervput(vp) 626fc639dcSJonathan M. Bresler struct vnode *vp; 636fc639dcSJonathan M. Bresler{ 646fc639dcSJonathan M. Bresler struct proc *p = curproc; 656fc639dcSJonathan M. Bresler KASSERT(vp != NULL, ("vput: null vp")); 666fc639dcSJonathan M. Bresler ... 676fc639dcSJonathan M. Bresler} 686fc639dcSJonathan M. Bresler.Ed 696fc639dcSJonathan M. Bresler.Sh SEE ALSO 706fc639dcSJonathan M. Bresler.Xr config 8 , 7125216c5cSJeroen Ruigrok van der Werven.Xr CONDSPLASSERT.9 , 7225216c5cSJeroen Ruigrok van der Werven.Xr panic 9 , 7325216c5cSJeroen Ruigrok van der Werven.Xr SPLASSERT.9 746fc639dcSJonathan M. Bresler.Sh AUTHORS 75eb2630afSJeroen Ruigrok van der WervenThis manual page was written by 76eb2630afSJeroen Ruigrok van der Werven.An Jonathan M. Bresler 77eb2630afSJeroen Ruigrok van der Werven.Aq jmb@freebsd.org . 78