blob: 2cabfd004fee834dfc14b624d5cf4030145b6f5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#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
|