diff options
author | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-04-15 13:21:34 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-04-15 13:24:13 +0200 |
commit | 2cb64e48fcd664067f4bd87e8f46fad694c3c979 (patch) | |
tree | ebec8a79b361a0f0b5eb05da1f52f56ee974b368 /initd/init.h | |
parent | 6e839a4ad544218317ceebd85e83ab5a8a8e21cc (diff) |
Move initd signal setup to platform specific file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'initd/init.h')
-rw-r--r-- | initd/init.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/initd/init.h b/initd/init.h index a43b3f1..3510073 100644 --- a/initd/init.h +++ b/initd/init.h @@ -19,7 +19,9 @@ #define INIT_H #include <linux/reboot.h> +#include <sys/signalfd.h> #include <sys/reboot.h> +#include <signal.h> #include "service.h" #include "telinit.h" @@ -117,5 +119,28 @@ service_t *svclist_remove(pid_t pid); */ int initenv(void); +/********** signal_<platform>.c **********/ + +/* + Setup signal handling. Returns -1 on error, a file descriptor on + success. + + The returned file descriptor can be polled and becomes readable + when a signal arrives. Reading from it returns a signalfd_siginfo + structure. + + The returned file descriptor has the close on exec flag set. + + The kernel is also told to send us SIGINT signals if a user presses + the local equivalent of CTRL+ALT+DEL. +*/ +int sigsetup(void); + +/* + Undo everything that sigsetup() changed about signal handling and + restore the default. +*/ +void sigreset(void); + #endif /* INIT_H */ |