ASSERT(D3)ASSERT(D3)NAMEASSERT - verify assertion
SYNOPSIS
#include <sys/debug.h>
#include <sys/ddi.h>
void ASSERT(int expression);
Arguments
expression
Expression to be evaluated.
DESCRIPTIONASSERT is a debugging interface for verifying program invariants within
code that is compiled with the DEBUG compilation option defined.
Return Values
If expression evaluates to non-zero, ASSERT returns no value. If
expression evaluates to zero, ASSERT panics the system.
USAGE
expression is a boolean expression that the caller expects to evaluate to
non-zero (that is, the caller is asserting that the expression has a
non-zero value). If expression evaluates to non-zero, the ASSERT call
has no effect. If expression evaluates to zero, ASSERT causes the system
to panic with the following message:
PANIC: assertion failed: expression, file: filename, line: lineno
where filename is the name of the source file in which the failed
assertion appears and lineno is the line number of the ASSERT call within
the file.
When the DEBUG compilation option is not defined, ASSERT calls are not
compiled into the code, and therefore have no effect, including the fact
that expression is not evaluated.
Level
Initialization, Base or Interrupt.
Synchronization Constraints
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held
across calls to this function.
REFERENCEScmn_err(D3)
Page 1