aboutsummaryrefslogtreecommitdiff
path: root/poweroff.c
diff options
context:
space:
mode:
Diffstat (limited to 'poweroff.c')
-rw-r--r--poweroff.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/poweroff.c b/poweroff.c
new file mode 100644
index 0000000..5379c4f
--- /dev/null
+++ b/poweroff.c
@@ -0,0 +1,15 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include <errno.h>
+#include <signal.h>
+
+int
+main(void)
+{
+ if (kill(1, SIGUSR1) == -1) {
+ perror("kill");
+ return errno;
+ }
+
+ return 0;
+}