#ifndef POTD_UTILS_H #define POTD_UTILS_H 1 #ifndef SIZEOF #define SIZEOF(arr) (sizeof(arr)/sizeof(arr[0])) #endif extern char *arg0; int set_child_sighandler(void); void set_procname(const char *new_arg0); pid_t daemonize(int stay_foreground); int close_fds_except(int fd, ...); int redirect_devnull_to(int fds, ...); int change_user_group(const char *user, const char *group); int safe_chroot(const char *newroot); #endif