diff options
Diffstat (limited to 'src/potd-init.c')
-rw-r--r-- | src/potd-init.c | 16 |
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; +} |