#include <signal.h>#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <sys/type.h>#include <syslog.h>#include <unistd.h>
pid_t fork_proc() {
/* Fork off the parent. */
pid_t pid = fork();
/* The process id is non zero, so it must be the parent process. */if (pid) {
/* Exit with EXIT_FAILURE if the parent's pid is * negative, otherwise exit with EXIT_SUCCESS. */
exit((pid < 0) ? EXIT_FAILURE : EXIT_SUCCESS);
}
return pid;
}