summaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/debug.h
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1999-12-27 04:44:04 +0000
committerJohn Polstra <jdp@FreeBSD.org>1999-12-27 04:44:04 +0000
commitd3980376e8c139e07958914c5184ab37463e4818 (patch)
tree606182fa01badd88b4cbbb7961dabdce2d484c9d /libexec/rtld-elf/debug.h
parentfdba49eb7e1ae8f4835266f8c51329a5da027da3 (diff)
Notes
Diffstat (limited to 'libexec/rtld-elf/debug.h')
-rw-r--r--libexec/rtld-elf/debug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libexec/rtld-elf/debug.h b/libexec/rtld-elf/debug.h
index b3563386eaff..2600651997e8 100644
--- a/libexec/rtld-elf/debug.h
+++ b/libexec/rtld-elf/debug.h
@@ -38,6 +38,9 @@
#include <sys/cdefs.h>
+#include <string.h>
+#include <unistd.h>
+
extern void debug_printf(const char *, ...) __printflike(1, 2);
extern int debug;
@@ -47,4 +50,10 @@ extern int debug;
#define dbg(format, args...) ((void) 0)
#endif
+#define assert(cond) ((cond) ? (void) 0 : \
+ (msg("ld-elf.so.1: assert failed: " __FILE__ ":" \
+ __XSTRING(__LINE__) "\n"), abort()))
+#define msg(s) write(1, s, strlen(s))
+#define trace() msg("ld-elf.so.1: " __XSTRING(__LINE__) "\n")
+
#endif /* DEBUG_H */