summaryrefslogtreecommitdiff
path: root/src/libc/include/signal.h
diff options
context:
space:
mode:
authordzwdz2023-08-14 18:51:07 +0200
committerdzwdz2023-08-14 18:51:07 +0200
commit642b5fb0007b64c77d186fcb018d571152ee1d47 (patch)
tree1c466461f3602d306be309a053edae558ef2568e /src/libc/include/signal.h
parent8050069c57b729c18c19b1a03ab6e4bf63b4735e (diff)
reorganization: first steps
Diffstat (limited to 'src/libc/include/signal.h')
-rw-r--r--src/libc/include/signal.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/libc/include/signal.h b/src/libc/include/signal.h
new file mode 100644
index 0000000..012481e
--- /dev/null
+++ b/src/libc/include/signal.h
@@ -0,0 +1,54 @@
+#pragma once
+#include <bits/panic.h>
+#include <sys/types.h>
+#include <errno.h> // only for ENOSYS
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGQUIT 3
+#define SIGILL 4
+#define SIGTRAP 5
+#define SIGABRT 6
+#define SIGFPE 8
+#define SIGKILL 9
+#define SIGSEGV 11
+#define SIGPIPE 13
+#define SIGALRM 14
+#define SIGTERM 15
+
+#define SIGCONT 16
+#define SIGPIPE 17
+#define SIGTSTP 18
+#define SIGTTIN 19
+#define SIGTTOU 20
+#define SIGWINCH 21
+#define SIGCHLD 22
+
+#define NSIG 32
+
+#define SIG_DFL 0
+#define SIG_ERR 0
+#define SIG_IGN 0
+#define SIG_SETMASK 0
+
+typedef int sig_atomic_t;
+typedef struct {} sigset_t;
+typedef struct {} siginfo_t;
+extern const char *const sys_siglist[];
+
+struct sigaction {
+ void (*sa_handler)(int);
+ void (*sa_sigaction)(int, siginfo_t *, void *);
+ sigset_t sa_mask;
+ int sa_flags;
+ void (*sa_restorer)(void);
+};
+
+int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact);
+int sigemptyset(sigset_t *set);
+int sigfillset(sigset_t *set);
+int sigprocmask(int how, const sigset_t *set, const sigset_t *oldset);
+int sigsuspend(const sigset_t *mask);
+int signal(int sig, void (*func)(int));
+int kill(pid_t pid, int sig);
+int raise(int sig);