summaryrefslogtreecommitdiff
path: root/include/apr_thread_proc.h
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-02-06 18:50:30 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-02-06 18:50:30 +0000
commit6c24107afad9f9daab8e2d169158f3dfb058302e (patch)
tree9ac24e21d682e1a04d2d6583e8f9d8bb3b1f442f /include/apr_thread_proc.h
parent258b05d7442a92daf7ecd55eeb39025300b0c216 (diff)
downloadlibapr-6c24107afad9f9daab8e2d169158f3dfb058302e.tar.gz
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
Diffstat (limited to 'include/apr_thread_proc.h')
-rw-r--r--include/apr_thread_proc.h25
1 files changed, 25 insertions, 0 deletions
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