:man| Alphabetical   Categories   About us 
 
KASSERT (9) | Kernel routines | Unix Manual Pages | :man

NAME

KASSERT - kernel expression verification macro

CONTENTS

Synopsis
Description
Examples
See Also
Authors

SYNOPSIS


.Cd "options INVARIANTS"


.In sys/param.h
.In sys/systm.h KASSERT expression msg

DESCRIPTION

In a kernel compiled with
.Cd "options INVARIANTS" , the KASSERT macro tests the given expression and if it is false, calls the panic(9) function, terminating the running system.

In a kernel that does not have
.Cd "options INVARIANTS" , the KASSERT macro is defined to be a no-op. The second argument is a printf(9) format string and its arguments, enclosed in parentheses.

EXAMPLES

The kernel function vput must not be called with a NULL pointer.
void
vput(vp)
struct vnode *vp;
{
struct proc *p = curproc;
KASSERT(vp != NULL, ("vput: null vp"));
...
}

SEE ALSO

config(8), panic(9)

AUTHORS


Share this page

     Follow us

Facebook Twitter Google+ LinkedIn


 
Created by Blin Media, 2008-2013