diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2005-12-31 21:40:44 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2005-12-31 21:40:44 +0000 |
commit | d3c5214856c5c2a7e9a9d83047d07592e3a560db (patch) | |
tree | 36817b13c5a8ff3644ede042c3e8a8d172cc2bf8 /lib/librthread/rthread.h | |
parent | 73ed0e5c02f4909688a40974d9bb8086b01f22c5 (diff) |
Add "print debug foo" function safe to use in signal handlers, example:
_rthread_debug(3, "foo = %s", foo);
where output is to stderr and will only be printed if the current
debug level is >= 3. Messages with a debug level of 0 are always
printed. The level can be set from the environment (not enabled yet)
or with gdb by modifying variable _rthread_debug_level.
"Fine with me" -Otto
Diffstat (limited to 'lib/librthread/rthread.h')
-rw-r--r-- | lib/librthread/rthread.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/librthread/rthread.h b/lib/librthread/rthread.h index 7bf10dacf6c..792b9259a19 100644 --- a/lib/librthread/rthread.h +++ b/lib/librthread/rthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.h,v 1.13 2005/12/31 08:51:20 otto Exp $ */ +/* $OpenBSD: rthread.h,v 1.14 2005/12/31 21:40:43 marc Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -135,6 +135,8 @@ int _sem_wakeup(sem_t); int _sem_wakeall(sem_t); void _rthread_tls_destructors(pthread_t); +void _rthread_debug(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); int _atomic_lock(register volatile _spinlock_lock_t *); |