aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index eb8b2f620..873ab8798 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -274,9 +274,32 @@ char *xrealloc_getcwd_or_warn(char *cwd);
274 274
275char *xmalloc_follow_symlinks(const char *path); 275char *xmalloc_follow_symlinks(const char *path);
276 276
277//enum { 277enum {
278// BB_SIGS_FATAL = , 278 /* bb_signals(BB_SIGS_FATAL, handler) catches all signals which
279//}; 279 * otherwise would kill us, except for those resulting from bugs:
280 * SIGSEGV, SIGILL, SIGFPE.
281 * Other fatal signals not included (TODO?):
282 * SIGBUS Bus error (bad memory access)
283 * SIGPOLL Pollable event. Synonym of SIGIO
284 * SIGPROF Profiling timer expired
285 * SIGSYS Bad argument to routine
286 * SIGTRAP Trace/breakpoint trap
287 */
288 BB_SIGS_FATAL = 0
289 + (1 << SIGHUP)
290 + (1 << SIGINT)
291 + (1 << SIGTERM)
292 + (1 << SIGPIPE) // Write to pipe with no readers
293 + (1 << SIGQUIT) // Quit from keyboard
294 + (1 << SIGABRT) // Abort signal from abort(3)
295 + (1 << SIGALRM) // Timer signal from alarm(2)
296 + (1 << SIGVTALRM) // Virtual alarm clock
297 + (1 << SIGXCPU) // CPU time limit exceeded
298 + (1 << SIGXFSZ) // File size limit exceeded
299 + (1 << SIGUSR1) // Yes kids, these are also fatal!
300 + (1 << SIGUSR2)
301 + 0,
302};
280void bb_signals(int sigs, void (*f)(int)); 303void bb_signals(int sigs, void (*f)(int));
281/* Unlike signal() and bb_signals, sets handler with sigaction() 304/* Unlike signal() and bb_signals, sets handler with sigaction()
282 * and in a way that while signal handler is run, no other signals 305 * and in a way that while signal handler is run, no other signals