File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / minissdpd / daemonize.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Sep 27 11:25:11 2023 UTC (14 months, 4 weeks ago) by misho
Branches: miniupnpd, MAIN
CVS tags: v2_3_3p0, HEAD
Version 2.3.3p0

    1: /* $Id: daemonize.h,v 1.1.1.1 2023/09/27 11:25:11 misho Exp $ */
    2: /* MiniUPnP project
    3:  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    4:  * (c) 2006 Thomas Bernard
    5:  * This software is subject to the conditions detailed
    6:  * in the LICENCE file provided within the distribution */
    7: 
    8: #ifndef DAEMONIZE_H_INCLUDED
    9: #define DAEMONIZE_H_INCLUDED
   10: 
   11: #include "config.h"
   12: 
   13: #ifndef USE_DAEMON
   14: /* daemonize()
   15:  * "fork" to background, detach from terminal, etc...
   16:  * returns: pid of the daemon, exits upon failure */
   17: int
   18: daemonize(void);
   19: #endif
   20: 
   21: /* writepidfile()
   22:  * write the pid to a file */
   23: int
   24: writepidfile(const char * fname, int pid);
   25: 
   26: /* checkforrunning()
   27:  * check for another instance running
   28:  * returns: 0 only instance
   29:  *          -1 invalid filename
   30:  *          -2 another instance running  */
   31: int
   32: checkforrunning(const char * fname);
   33: 
   34: #endif
   35: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>