1 #ifndef foodaemonforkhfoo
2 #define foodaemonforkhfoo
24 #include <sys/types.h>
106 #define DAEMON_CLOSE_ALL_AVAILABLE 1
124 #define DAEMON_UNBLOCK_SIGS_AVAILABLE 1
142 #define DAEMON_RESET_SIGS_AVAILABLE 1
pid_t daemon_fork(void)
Does a daemonizing fork().
int daemon_reset_sigs(int except,...)
Reset all signal handlers except those passed.
int daemon_unblock_sigsv(const int except[])
Same as daemon_unblock_sigs() but takes an array of signals, terminated by -1.
int daemon_close_all(int except_fd,...)
Close all file descriptors except those passed.
int daemon_close_allv(const int except_fds[])
Same as daemon_close_all but takes an array of fds, terminated by -1.
int daemon_reset_sigsv(const int except[])
Same as daemon_reset_sigs() but takes an array of signals, terminated by -1.
int daemon_unblock_sigs(int except,...)
Unblock all signals except those passed.
void daemon_retval_done(void)
Frees the resources allocated by daemon_retval_init().
int daemon_retval_init(void)
Allocate and initialize resources required by the daemon_retval_xxx() functions.
int daemon_retval_wait(int timeout)
Return the value sent by the child via the daemon_retval_send() function, but wait only the specified...
int daemon_retval_send(int s)
Send the specified integer to the parent process.