diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-16 22:57:54 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-16 22:57:54 +0000 |
commit | 123ac5fd646cb7a0ed3b7055cda609db93c20487 (patch) | |
tree | 6dea5b8c8d8bb81a47195b75172db608ff217382 /include | |
parent | 752f6681b1ea748a1acef2a55e17c4c564715fde (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/app.h | 9 | ||||
-rw-r--r-- | include/asterisk/logger.h | 3 |
2 files changed, 12 insertions, 0 deletions
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 diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index d76aa932f..5ea81aca8 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -78,6 +78,9 @@ void ast_queue_log(const char *queuename, const char *callid, const char *agent, void ast_verbose(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void ast_child_verbose(int level, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); + int ast_register_verbose(void (*verboser)(const char *string)); int ast_unregister_verbose(void (*verboser)(const char *string)); |