00001 #ifndef foodaemonforkhfoo
00002 #define foodaemonforkhfoo
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <sys/types.h>
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00063 pid_t daemon_fork(void);
00064
00071 int daemon_retval_init(void);
00072
00080 void daemon_retval_done(void);
00081
00091 int daemon_retval_wait(int timeout);
00092
00100 int daemon_retval_send(int s);
00101
00106 #define DAEMON_CLOSE_ALL_AVAILABLE 1
00107
00112 int daemon_close_all(int except_fd, ...);
00113
00118 int daemon_close_allv(const int except_fds[]);
00119
00124 #define DAEMON_UNBLOCK_SIGS_AVAILABLE 1
00125
00130 int daemon_unblock_sigs(int except, ...);
00131
00136 int daemon_unblock_sigsv(const int except[]);
00137
00142 #define DAEMON_RESET_SIGS_AVAILABLE 1
00143
00148 int daemon_reset_sigs(int except, ...);
00149
00154 int daemon_reset_sigsv(const int except[]);
00155
00156 #ifdef __cplusplus
00157 }
00158 #endif
00159
00160 #endif