aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
blob: da5be321d1a5b5348c5796747bc897f10248db28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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 change_user_group(const char *user, const char *group);

#endif