55 lines
1.9 KiB
C
55 lines
1.9 KiB
C
#pragma once
|
|
|
|
#define SIG_DFL -1
|
|
#define SIG_IGN 0
|
|
|
|
enum {
|
|
SIGABRT, // Abort signal from abort(3)
|
|
SIGALRM, // Timer signal from alarm(2)
|
|
SIGBUS, // Bus error (bad memory access)
|
|
SIGCHLD, // Child stopped or terminated
|
|
SIGCLD, // A synonym for SIGCHLD
|
|
SIGCONT, // Continue if stopped
|
|
SIGEMT, // Emulator trap
|
|
SIGFPE, // Floating-point exception
|
|
SIGHUP, // Hangup detected on controlling terminal or death of
|
|
// controlling process
|
|
SIGILL, // Illegal Instruction
|
|
SIGINFO, // A synonym for SIGPWR
|
|
SIGINT, // Interrupt from keyboard
|
|
SIGIO, // I/O now possible (4.2BSD)
|
|
SIGIOT, // IOT trap. A synonym for SIGABRT
|
|
SIGKILL, // Kill signal
|
|
SIGLOST, // File lock lost (unused)
|
|
SIGPIPE, // Broken pipe: write to pipe with no readers; see pipe(7)
|
|
SIGPOLL, // Pollable event (Sys V); synonym for SIGIO
|
|
SIGPROF, // Profiling timer expired
|
|
SIGPWR, // Power failure (System V)
|
|
SIGQUIT, // Quit from keyboard
|
|
SIGSEGV, // Invalid memory reference
|
|
SIGSTKFLT, // Stack fault on coprocessor (unused)
|
|
SIGSTOP, // Stop process
|
|
SIGTSTP, // Stop typed at terminal
|
|
SIGSYS, // Bad system call (SVr4); see also seccomp(2)
|
|
SIGTERM, // Termination signal
|
|
SIGTRAP, // Trace/breakpoint trap
|
|
SIGTTIN, // Terminal input for background process
|
|
SIGTTOU, // Terminal output for background process
|
|
SIGUNUSED, // Synonymous with SIGSYS
|
|
SIGURG, // Urgent condition on socket (4.2BSD)
|
|
SIGUSR1, // User-defined signal 1
|
|
SIGUSR2, // User-defined signal 2
|
|
SIGVTALRM, // Virtual alarm clock (4.2BSD)
|
|
SIGXCPU, // CPU time limit exceeded (4.2BSD); see setrlimit(2)
|
|
SIGXFSZ, // File size limit exceeded (4.2BSD); see setrlimit(2)
|
|
SIGWINCH, // Window resize signal (4.3BSD, Sun)
|
|
SIG_INT, // Interrupt from keyboard
|
|
};
|
|
|
|
typedef void (*sighandler_t)(int);
|
|
|
|
struct signal {
|
|
int signum;
|
|
sighandler_t handler;
|
|
};
|