aboutsummaryrefslogtreecommitdiff
path: root/src/potd-init.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-09-09 21:52:37 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-09-09 21:52:37 +0200
commitb15b11245cd774b0ef83718ac20b9eb8ff1c3d82 (patch)
treece98d0c72b13db62cffe0d38d587a51ba2d9ea1a /src/potd-init.c
parentf4953726c2ec31c720605f733b921bed32a88f4c (diff)
fake /sbin/init skeleton
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/potd-init.c')
-rw-r--r--src/potd-init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/potd-init.c b/src/potd-init.c
new file mode 100644
index 0000000..8cfb347
--- /dev/null
+++ b/src/potd-init.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#define APP_NAME "init"
+
+int main(void)
+{
+ if (getppid() != 0 || getpid() != 1) {
+ fprintf(stderr, "%s: must be started as PID 1\n", APP_NAME);
+ return 1;
+ }
+
+ return 0;
+}