You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
844 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
7 years ago
​
​
​
​
​
7 years ago
​
  1. /* $Id: daemonize.h,v 1.8 2012/09/27 16:00:44 nanard 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. #ifndef DAEMONIZE_H_INCLUDED
  8. #define DAEMONIZE_H_INCLUDED
  9. #include "config.h"
  10. #ifndef USE_DAEMON
  11. /* daemonize()
  12. * "fork" to background, detach from terminal, etc...
  13. * returns: pid of the daemon, exits upon failure */
  14. int daemonize(void);
  15. #endif
  16. /* writepidfile()
  17. * write the pid to a file */
  18. int writepidfile(const char * fname, int pid);
  19. /* checkforrunning()
  20. * check for another instance running
  21. * returns: 0 only instance
  22. * -1 invalid filename
  23. * -2 another instance running */
  24. int checkforrunning(const char * fname);
  25. #endif