summaryrefslogtreecommitdiffstats
path: root/lib/log.h
diff options
context:
space:
mode:
authorajs <ajs>2004-11-26 18:11:14 +0000
committerajs <ajs>2004-11-26 18:11:14 +0000
commit937c85d41b340152e548ba72c8f32fb8c62e3872 (patch)
tree0e7b7f85d45c378c517533e079438fa1d95436d8 /lib/log.h
parent5d45c81605ef1a51bf35a4cbfbbd7f1749534374 (diff)
downloadquagga-937c85d41b340152e548ba72c8f32fb8c62e3872.tar.bz2
quagga-937c85d41b340152e548ba72c8f32fb8c62e3872.tar.xz
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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/log.h b/lib/log.h
index 1fd4fe0c..0df75e73 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -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 */