diff options
Diffstat (limited to 'userland/libc/include')
-rw-r--r-- | userland/libc/include/signal.h | 45 | ||||
-rw-r--r-- | userland/libc/include/syscall.h | 2 |
2 files changed, 46 insertions, 1 deletions
diff --git a/userland/libc/include/signal.h b/userland/libc/include/signal.h index 2e6566d..621710b 100644 --- a/userland/libc/include/signal.h +++ b/userland/libc/include/signal.h @@ -1,9 +1,52 @@ #ifndef SIGNAL_H #define SIGNAL_H +#include <sys/types.h> #define SIGHUP 0 #define SIGINT 1 #define SIGWINCH 2 #define SIGQUIT 3 #define SIG_IGN 4 -typedef int sig_atomic_t; +#define SIGSEGV 5 +#define SIGILL 6 +#define SIGABRT 7 +#define SIGBUS 8 +#define SIGKILL 9 +#define SIGFPE 10 + +typedef int pid_t; +typedef int sigset_t; + +union sigval { + int sival_int; // Integer signal value. + void *sival_ptr; // Pointer signal value. +}; + +struct siginfo { + int si_signo; // Signal number. + int si_code; // Signal code. + int si_errno; // If non-zero, an errno value associated with + // this signal, as described in <errno.h>. + pid_t si_pid; // Sending process ID. + uid_t si_uid; // Real user ID of sending process. + void *si_addr; // Address of faulting instruction. + int si_status; // Exit value or signal. + long si_band; // Band event for SIGPOL9 + union sigval si_value; // Signal value. +}; + +typedef struct siginfo siginfo_t; + +int kill(pid_t pid, int sig); + +struct sigaction { + void (*sa_handler)(int); // Pointer to a signal-catching function or one of + // the macros SIG_IGN or SIG_DFL. + sigset_t sa_mask; // Additional set of signals to be blocked during execution + // of signal-catching function. + int sa_flags; // Special flags to affect behavior of signal. + void (*sa_sigaction)(int, siginfo_t *, + void *); // Pointer to a signal-catching function. +}; + +int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); #endif // SIGNAL_H diff --git a/userland/libc/include/syscall.h b/userland/libc/include/syscall.h index 3af425d..3faafbf 100644 --- a/userland/libc/include/syscall.h +++ b/userland/libc/include/syscall.h @@ -34,6 +34,8 @@ #define SYS_MKDIR 26 #define SYS_RECVFROM 27 #define SYS_SENDTO 28 +#define SYS_KILL 29 +#define SYS_SIGACTION 30 int syscall(uint32_t eax, uint32_t ebx, uint32_t ecx, uint32_t edx, uint32_t esi, uint32_t edi); |