diff options
author | ajs <ajs> | 2004-11-26 19:11:14 +0100 |
---|---|---|
committer | ajs <ajs> | 2004-11-26 19:11:14 +0100 |
commit | 063ee52af64472474af2fa4b3cb2ba9ced746b9f (patch) | |
tree | d9d0f9dac723159cefd21d350195fabe286032e5 /lib/log.h | |
parent | 2004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff) | |
download | frr-063ee52af64472474af2fa4b3cb2ba9ced746b9f.tar.xz frr-063ee52af64472474af2fa4b3cb2ba9ced746b9f.zip |
2004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* log.c: (zlog_backtrace) New function to log a backtrace.
(zlog_backtrace_safe) Log a backtrace in an async-signal-safe way.
Unfortunately, this function does not support syslog logging yet.
(zlog_signal) Move backtrace code into separate function
zlog_backtrace_safe.
(_zlog_assert_failed) Call zlog_backtrace before aborting.
* log.h: Declare new functions zlog_backtrace and zlog_backtrace_safe.
* memory.c: (zerror) Call zlog_backtrace before aborting.
Diffstat (limited to 'lib/log.h')
-rw-r--r-- | lib/log.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -125,4 +125,13 @@ extern const char *safe_strerror(int errnum); /* To be called when a fatal signal is caught. */ extern void zlog_signal(int signo, const char *action); +/* Log a backtrace. */ +extern void zlog_backtrace(int priority); + +/* Log a backtrace, but in an async-signal-safe way. Should not be + called unless the program is about to exit or abort, since it messes + up the state of zlog file pointers. This function needs to be enhanced + to support syslog logging. */ +extern void zlog_backtrace_safe(int priority); + #endif /* _ZEBRA_LOG_H */ |