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.

35 lines
845 B

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
  15. daemonize(void);
  16. #endif
  17. /* writepidfile()
  18. * write the pid to a file */
  19. int
  20. writepidfile(const char * fname, int pid);
  21. /* checkforrunning()
  22. * check for another instance running
  23. * returns: 0 only instance
  24. * -1 invalid filename
  25. * -2 another instance running */
  26. int
  27. checkforrunning(const char * fname);
  28. #endif