From 123ac5fd646cb7a0ed3b7055cda609db93c20487 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 16 Apr 2008 22:57:54 +0000 Subject: Standardized routines for forking processes (keeps all the specialized code in one place). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/app.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/asterisk/app.h') diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 7c66d47a1..12d41d7dd 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -480,6 +480,15 @@ int ast_record_review(struct ast_channel *chan, const char *playfile, const char /*! \brief Decode an encoded control or extended ASCII character */ int ast_get_encoded_char(const char *stream, char *result, size_t *consumed); +/*! \brief Common routine for child processes, to close all fds prior to exec(2) */ +void ast_close_fds_above_n(int n); + +/*! \brief Common routine to safely fork without a chance of a signal handler firing badly in the child */ +int ast_safe_fork(int stop_reaper); + +/*! \brief Common routine to cleanup after fork'ed process is complete (if reaping was stopped) */ +void ast_safe_fork_cleanup(void); + #if defined(__cplusplus) || defined(c_plusplus) } #endif -- cgit v1.2.3