You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bn...@apache.org on 2005/09/22 00:17:45 UTC
svn commit: r290849 - in /apr/apr/branches/0.9.x: include/apr_thread_proc.h
include/arch/netware/apr_arch_threadproc.h threadproc/beos/proc.c
threadproc/netware/proc.c threadproc/os2/proc.c threadproc/unix/proc.c
threadproc/win32/proc.c
Author: bnicholes
Date: Wed Sep 21 15:17:35 2005
New Revision: 290849
URL: http://svn.apache.org/viewcvs?rev=290849&view=rev
Log:
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
Modified:
apr/apr/branches/0.9.x/include/apr_thread_proc.h
apr/apr/branches/0.9.x/include/arch/netware/apr_arch_threadproc.h
apr/apr/branches/0.9.x/threadproc/beos/proc.c
apr/apr/branches/0.9.x/threadproc/netware/proc.c
apr/apr/branches/0.9.x/threadproc/os2/proc.c
apr/apr/branches/0.9.x/threadproc/unix/proc.c
apr/apr/branches/0.9.x/threadproc/win32/proc.c
Modified: apr/apr/branches/0.9.x/include/apr_thread_proc.h
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/include/apr_thread_proc.h?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/include/apr_thread_proc.h (original)
+++ apr/apr/branches/0.9.x/include/apr_thread_proc.h Wed Sep 21 15:17:35 2005
@@ -505,6 +505,16 @@
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
Modified: apr/apr/branches/0.9.x/include/arch/netware/apr_arch_threadproc.h
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/include/arch/netware/apr_arch_threadproc.h?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/include/arch/netware/apr_arch_threadproc.h (original)
+++ apr/apr/branches/0.9.x/include/arch/netware/apr_arch_threadproc.h Wed Sep 21 15:17:35 2005
@@ -61,6 +61,7 @@
char *currdir;
apr_int32_t cmdtype;
apr_int32_t detached;
+ apr_int32_t addrspace;
};
struct apr_thread_once_t {
Modified: apr/apr/branches/0.9.x/threadproc/beos/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/beos/proc.c?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/beos/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/beos/proc.c Wed Sep 21 15:17:35 2005
@@ -177,6 +177,13 @@
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,
Modified: apr/apr/branches/0.9.x/threadproc/netware/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/netware/proc.c?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/netware/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/netware/proc.c Wed Sep 21 15:17:35 2005
@@ -174,9 +174,7 @@
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 @@
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 @@
/* 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) {
Modified: apr/apr/branches/0.9.x/threadproc/os2/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/os2/proc.c?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/os2/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/os2/proc.c Wed Sep 21 15:17:35 2005
@@ -256,6 +256,13 @@
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,
Modified: apr/apr/branches/0.9.x/threadproc/unix/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/unix/proc.c?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/unix/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/unix/proc.c Wed Sep 21 15:17:35 2005
@@ -277,6 +277,13 @@
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,
Modified: apr/apr/branches/0.9.x/threadproc/win32/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/win32/proc.c?rev=290849&r1=290848&r2=290849&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/win32/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/win32/proc.c Wed Sep 21 15:17:35 2005
@@ -257,6 +257,13 @@
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,