summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2005-09-21 22:17:35 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2005-09-21 22:17:35 +0000
commitcc7e151cd517e31f5ee1af0820ab182f7ff356ae (patch)
tree40f9ca625fcc34f55bfd9fdb613f11567602a59d
parent9400151eaad8d8f908c70981e1ed7aff076f8c82 (diff)
downloadlibapr-cc7e151cd517e31f5ee1af0820ab182f7ff356ae.tar.gz
Backport the apr_procattr_addrspace_set() API to allow a platform to specify which address space the process should be started in.
Reviewed by: jjclar, bnicholes, trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@290849 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_thread_proc.h10
-rw-r--r--include/arch/netware/apr_arch_threadproc.h1
-rw-r--r--threadproc/beos/proc.c7
-rw-r--r--threadproc/netware/proc.c13
-rw-r--r--threadproc/os2/proc.c7
-rw-r--r--threadproc/unix/proc.c7
-rw-r--r--threadproc/win32/proc.c7
7 files changed, 48 insertions, 4 deletions
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index c5efe7026..484d057a2 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -505,6 +505,16 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
apr_int32_t chk);
+/**
+ * Determine if the child should start in its own address space or using the
+ * current one from its parent
+ * @param attr The procattr we care about.
+ * @param addrspace Should the child start in its own address space? Default
+ * is no on NetWare and yes on other platforms.
+ */
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace);
+
#if APR_HAS_FORK
/**
* This is currently the only non-portable call in APR. This executes
diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h
index f6bb8526b..b30d6f6e3 100644
--- a/include/arch/netware/apr_arch_threadproc.h
+++ b/include/arch/netware/apr_arch_threadproc.h
@@ -61,6 +61,7 @@ struct apr_procattr_t {
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
+ apr_int32_t addrspace;
};
struct apr_thread_once_t {
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
index e66336cc5..799dd1b92 100644
--- a/threadproc/beos/proc.c
+++ b/threadproc/beos/proc.c
@@ -177,6 +177,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace)
+{
+ /* won't ever be used on this platform, so don't save the flag */
+ return APR_SUCCESS;
+}
+
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
const char * const *args,
const char * const *env,
diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
index 2f7631e79..11038f1a1 100644
--- a/threadproc/netware/proc.c
+++ b/threadproc/netware/proc.c
@@ -174,9 +174,7 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
apr_cmdtype_e cmd)
{
- if ((cmd != APR_PROGRAM) && (cmd != APR_PROGRAM_ENV))
- return APR_ENOTIMPL;
- attr->cmdtype = cmd;
+ /* won't ever be called on this platform, so don't save the flag */
return APR_SUCCESS;
}
@@ -268,6 +266,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace)
+{
+ attr->addrspace = addrspace;
+ return APR_SUCCESS;
+}
+
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
const char *progname,
const char * const *args,
@@ -289,7 +294,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
/* attr->detached and PROC_DETACHED do not mean the same thing. attr->detached means
* start the NLM in a separate address space. PROC_DETACHED means don't wait for the
* NLM to unload by calling wait() or waitpid(), just clean up */
- addr_space = PROC_LOAD_SILENT | ((attr->cmdtype == APR_PROGRAM_ENV) ? 0 : PROC_CURRENT_SPACE);
+ addr_space = PROC_LOAD_SILENT | (attr->addrspace ? 0 : PROC_CURRENT_SPACE);
addr_space |= (attr->detached ? PROC_DETACHED : 0);
if (attr->currdir) {
diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
index 686b800fe..30b774ece 100644
--- a/threadproc/os2/proc.c
+++ b/threadproc/os2/proc.c
@@ -256,6 +256,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace)
+{
+ /* won't ever be used on this platform, so don't save the flag */
+ return APR_SUCCESS;
+}
+
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname,
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index c88e97ddf..2ea75dd5f 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -277,6 +277,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace)
+{
+ /* won't ever be used on this platform, so don't save the flag */
+ return APR_SUCCESS;
+}
+
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
const char *progname,
const char * const *args,
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
index ca2648cd8..6b04deed7 100644
--- a/threadproc/win32/proc.c
+++ b/threadproc/win32/proc.c
@@ -257,6 +257,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
+ apr_int32_t addrspace)
+{
+ /* won't ever be used on this platform, so don't save the flag */
+ return APR_SUCCESS;
+}
+
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
const char *progname,
const char * const *args,