daemonize.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /*
  19. *
  20. * History:
  21. * --------
  22. * 2004-02-20 created by andrei
  23. * 2007-06-07 added mem_lock_pages() (andrei)
  24. * 2010-08-19 send status via pipe code derived from 9167c1 (ibc) (andrei)
  25. */
  26. #ifndef _daemonize_h
  27. #define _daemonize_h
  28. int daemonize(char* name, int daemon_status_fd_input);
  29. int do_suid(void);
  30. int increase_open_fds(int target);
  31. int set_core_dump(int enable, long unsigned int size);
  32. int mem_lock_pages(void);
  33. int set_rt_prio(int prio, int policy);
  34. void daemon_status_init(void);
  35. void daemon_status_on_fork_cleanup(void);
  36. int daemon_status_send(char status);
  37. void daemon_status_no_wait(void);
  38. void daemon_status_on_fork_cleanup(void);
  39. #endif /*_daemonize_h */
  40. /* vi: set ts=4 sw=4 tw=79:ai:cindent: */