From 6c24107afad9f9daab8e2d169158f3dfb058302e Mon Sep 17 00:00:00 2001 From: trawick Date: Thu, 6 Feb 2003 18:50:30 +0000 Subject: Allow apr_proc_create() to call an app-provided error reporting function when apr_proc_create() fails in the new child process after fork(). The app-provided error reporting function will only be called on platforms where apr_proc_create() first calls fork() to create the new process. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64330 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/apr_thread_proc.h') diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f64d13435..0e4b514a6 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -177,6 +177,19 @@ struct apr_proc_t { #endif }; +/** + * The prototype for APR child errfn functions. (See the description + * of apr_procattr_child_errfn_set() for more information.) + * It is passed the following parameters: + * @param pool Pool associated with the apr_proc_t. If your child + * error function needs user data, associate it with this + * pool. + * @param err APR error code describing the error + * @param description Text description of type of processing which failed + */ +typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, + const char *description); + /** Opaque Thread structure. */ typedef struct apr_thread_t apr_thread_t; /** Opaque Thread attributes structure. */ @@ -487,6 +500,18 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, struct rlimit *limit); #endif +/** + * Specify an error function to be called in the child process if APR + * encounters an error in the child prior to running the specified program. + * @param child_errfn The function to call in the child process. + * @param userdata Parameter to be passed to errfn. + * @remark At the present time, it will only be called from apr_proc_create() + * on platforms where fork() is used. It will never be called on other + * platforms. + */ +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes -- cgit v1.2.1