KASSERT (9)
Leading comments
Copyright (c) 2000 Jonathan M. Bresler All rights reserved. This program is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following discl...
NAME
KASSERT - kernel expression verification macroSYNOPSIS
options INVARIANTSIn sys/param.h In sys/systm.h Fn KASSERT expression msg
DESCRIPTION
In a kernel compiled with options INVARIANTS the Fn KASSERT macro tests the given Fa expression and if it is false, calls the panic(9) function, terminating the running system.In a kernel that does not have options INVARIANTS the Fn 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 Fn 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")); ... }