aboutsummaryrefslogtreecommitdiff
path: root/man/man3/assert.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/man3/assert.3')
-rw-r--r--man/man3/assert.325
1 files changed, 25 insertions, 0 deletions
diff --git a/man/man3/assert.3 b/man/man3/assert.3
new file mode 100644
index 00000000..135560f5
--- /dev/null
+++ b/man/man3/assert.3
@@ -0,0 +1,25 @@
+.TH ASSERT 3
+.SH NAME
+assert \- check program invariants
+.SH SYNOPSIS
+.B #include <u.h>
+.br
+.B #include <libc.h>
+.PP
+.B
+#define assert if(cond);else _assert("cond")
+.PP
+.B
+void _assert(int cond)
+.SH DESCRIPTION
+.I Assert
+is a preprocessor macro that
+(via
+.IR _assert )
+prints a message and calls
+.I abort
+when
+.I cond
+is false.
+.SH SOURCE
+.B /sys/src/libc/port/_assert.c