summaryrefslogtreecommitdiff
path: root/initd/init.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-15 13:21:34 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-15 13:24:13 +0200
commit2cb64e48fcd664067f4bd87e8f46fad694c3c979 (patch)
treeebec8a79b361a0f0b5eb05da1f52f56ee974b368 /initd/init.h
parent6e839a4ad544218317ceebd85e83ab5a8a8e21cc (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.h25
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 */