00001 #ifndef foodaemonforkhfoo 00002 #define foodaemonforkhfoo 00003 00004 /* $Id: dfork.h 116 2007-06-11 15:16:09Z lennart $ */ 00005 00006 /* 00007 * This file is part of libdaemon. 00008 * 00009 * libdaemon is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU Lesser General Public License as 00011 * published by the Free Software Foundation; either version 2.1 of 00012 * the License, or (at your option) any later version. 00013 * 00014 * libdaemon is distributed in the hope that it will be useful, but 00015 * WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with libdaemon; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00022 * 02110-1301 USA 00023 */ 00024 00025 #include <sys/types.h> 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00064 pid_t daemon_fork(void); 00065 00072 int daemon_retval_init(void); 00073 00081 void daemon_retval_done(void); 00082 00092 int daemon_retval_wait(int timeout); 00093 00101 int daemon_retval_send(int s); 00102 00105 int daemon_close_all(int except_fd, ...); 00106 00108 int daemon_close_allv(const int except_fds[]); 00109 00110 #ifdef __cplusplus 00111 } 00112 #endif 00113 00114 #endif