waitpid.h 912 B

1234567891011121314151617181920212223242526272829
  1. /* Copyright (c) 2011-2019, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file waitpid.h
  5. * \brief Headers for waitpid.c
  6. **/
  7. #ifndef TOR_WAITPID_H
  8. #define TOR_WAITPID_H
  9. #ifndef _WIN32
  10. #ifdef HAVE_SYS_TYPES_H
  11. #include <sys/types.h>
  12. #endif
  13. /** A callback structure waiting for us to get a SIGCHLD informing us that a
  14. * PID has been closed. Created by set_waitpid_callback. Cancelled or cleaned-
  15. * up from clear_waitpid_callback(). Do not access outside of the main thread;
  16. * do not access from inside a signal handler. */
  17. typedef struct waitpid_callback_t waitpid_callback_t;
  18. waitpid_callback_t *set_waitpid_callback(pid_t pid,
  19. void (*fn)(int, void *), void *arg);
  20. void clear_waitpid_callback(waitpid_callback_t *ent);
  21. void notify_pending_waitpid_callbacks(void);
  22. #endif /* !defined(_WIN32) */
  23. #endif /* !defined(TOR_WAITPID_H) */