Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[20bb1d]: daemonize.h Maximize Restore History

Download this file

daemonize.h    35 lines (27 with data), 775 Bytes

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