diff options
Diffstat (limited to 'threadproc/unix')
-rw-r--r-- | threadproc/unix/proc.c | 145 | ||||
-rw-r--r-- | threadproc/unix/procsup.c | 22 | ||||
-rw-r--r-- | threadproc/unix/signals.c | 6 | ||||
-rw-r--r-- | threadproc/unix/thread.c | 76 | ||||
-rw-r--r-- | threadproc/unix/threadpriv.c | 59 |
5 files changed, 0 insertions, 308 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 8f81b1242..5c3e9cc8f 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -55,12 +55,6 @@ #include "threadproc.h" #include "apr_portable.h" -/* ***APRDOC******************************************************** - * ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont) - * Create and initialize a new procattr variable - * arg 1) The newly created procattr. - * arg 2) The context to use - */ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont) { (*new) = (ap_procattr_t *)ap_palloc(cont, @@ -82,16 +76,6 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - * ap_int32_t *out, ap_int32_t err) - * Determine if any of stdin, stdout, or stderr should be linked - * to pipes when starting a child process. - * arg 1) The procattr we care about. - * arg 2) Should stdin be a pipe bnack to the parent? - * arg 3) Should stdout be a pipe bnack to the parent? - * arg 4) Should stderr be a pipe bnack to the parent? - */ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { @@ -145,20 +129,6 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - * ap_file_t *parent_in) - * Set the child_in and/or parent_in values to existing ap_file_t - * values. This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple - * process invocations - such as a log file. You can save some - * extra function calls by not creating your own pipe since this - * creates one in the process space for you. - * arg 1) The procattr we care about. - * arg 2) ap_file_t value to use as child_in. Must be a valid file. - * arg 3) ap_file_t value to use as parent_in. Must be a valid file. - */ ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in) { @@ -175,19 +145,6 @@ ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, - * ap_file_t *child_out, - * ap_file_t *parent_out) - * Set the child_out and parent_out values to existing ap_file_t - * values. This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple - * process invocations - such as a log file. - * arg 1) The procattr we care about. - * arg 2) ap_file_t value to use as child_out. Must be a valid file. - * arg 3) ap_file_t value to use as parent_out. Must be a valid file. - */ ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) { @@ -204,19 +161,6 @@ ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, - * ap_file_t *child_err, - * ap_file_t *parent_err) - * Set the child_err and parent_err values to existing ap_file_t - * values. This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple - * process invocations - such as a log file. - * arg 1) The procattr we care about. - * arg 2) ap_file_t value to use as child_err. Must be a valid file. - * arg 3) ap_file_t value to use as parent_err. Must be a valid file. - */ ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err) { @@ -233,14 +177,6 @@ ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, constchar *dir) - * Set which directory the child process should start executing in. - * arg 1) The procattr we care about. - * arg 2) Which dir to start in. By default, this is the same dir as - * the parent currently resides in, when the createprocess call - * is made. - */ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir) { @@ -251,14 +187,6 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, return APR_ENOMEM; } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd) - * Set what type of command the child process will call. - * arg 1) The procattr we care about. - * arg 2) The type of command. One of: - * APR_SHELLCMD -- Shell script - * APR_PROGRAM -- Executable program (default) - */ ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd) { @@ -266,25 +194,12 @@ ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) - * Determine if the chlid should start in detached state. - * arg 1) The procattr we care about. - * arg 2) Should the child start in detached state? Default is no. - */ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont) - * This is currently the only non-portable call in APR. This executes - * a standard unix fork. - * arg 1) The resulting process handle. - * arg 2) The context to use. - */ ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont) { int pid; @@ -304,21 +219,6 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont) return APR_INPARENT; } -/* ***APRDOC******************************************************** - * ap_status_t ap_create_process(ap_proc_t **new, const char *progname, - * char *const args[], char **env, - * ap_procattr_t *attr, ap_context_t *cont) - * Create a new process and execute a new program within that process. - * arg 1) The resulting process handle. - * arg 2) The program to run - * arg 3) the arguments to pass to the new program. The first one should - * be the program name. - * arg 4) The new environment ap_table_t for the new process. This should be a - * list of NULL-terminated strings. - * arg 5) the procattr we should use to determine how to create the new - * process - * arg 6) The context to use. - */ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_context_t *cont) @@ -411,55 +311,24 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) - * Get the file handle that is assocaited with a child's stdin. - * arg 1) The returned file handle. - * arg 2) The process handle that corresponds to the desired child process - */ ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) { (*new) = proc->attr->parent_in; return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) - * Get the file handle that is assocaited with a child's stdout. - * arg 1) The returned file handle. - * arg 2) The process handle that corresponds to the desired child process - */ ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) { (*new) = proc->attr->parent_out; return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) - * Get the file handle that is assocaited with a child's stderr. - * arg 1) The returned file handle. - * arg 2) The process handle that corresponds to the desired child process - */ ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) { (*new) = proc->attr->parent_err; return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how waithow) - * Wait for a child process to die - * arg 1) The process handle that corresponds to the desired child process - * arg 2) How should we wait. One of: - * APR_WAIT -- block until the child process dies. - * APR_NOWAIT -- return immediately regardless of if the - * child is dead or not. - * NOTE: The childs status is in the return code to this process. It is - * one of: - * APR_CHILD_DONE -- child is no longer running. - * APR_CHILD_NOTDONE -- child is still running. - */ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow) { @@ -484,12 +353,6 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return errno; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) - * convert the proc from os specific type to apr type. - * arg 1) The os specific proc we are converting to - * arg 2) The apr proc we are converting - */ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) { if (proc == NULL) { @@ -499,14 +362,6 @@ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_put_os_proc(ap_proc_t *proc, ap_os_proc_t *theproc, - * ap_context_t *cont) - * convert the proc from os specific type to apr type. - * arg 1) The apr proc we are converting to. - * arg 2) The os specific proc to convert - * arg 3) The context to use if it is needed. - */ ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, ap_context_t *cont) { diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index a4ac1b642..d1bff1f09 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,12 +54,6 @@ #include "threadproc.h" -/* ***APRDOC******************************************************** - * ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont) - * Detach the process from the controlling terminal. - * arg 1) The new process handler - * arg 2) The context to use if it is needed. - */ ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont) { int x; @@ -124,13 +118,6 @@ ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) - * Return the context associated with the current proc. - * arg 1) The key associated with the data to retreive. - * arg 2) The user data associated with the proc. - * arg 3) The currently open proc. - */ ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) { if (proc != NULL) { @@ -142,15 +129,6 @@ ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_procdata(void *data, char *key, - * ap_status_t (*cleanup) (void *), ap_proc_t *proc) - * Return the context associated with the current proc. - * arg 2) The user data to associate with the file. - * arg 3) The key to use for assocaiteing data with the file. - * arg 4) The cleanup routine to use when the file is destroyed. - * arg 1) The current process. -*/ ap_status_t ap_set_procdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_proc_t *proc) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index bd4a6c0de..d31edd324 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -58,12 +58,6 @@ #include "../beos/threadproc.h" #endif -/* ***APRDOC******************************************************** - * ap_status_t ap_kill(ap_proc_t *proc, int sig) - * Terminate a process. - * arg 1) The process to terminate. - * arg 2) How to kill the process. - */ ap_status_t ap_kill(ap_proc_t *proc, int sig) { if (kill(proc->pid, sig) == -1) { diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index f62b925de..99f3ab1cf 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -58,12 +58,6 @@ #if APR_HAS_THREADS #ifdef HAVE_PTHREAD_H -/* ***APRDOC******************************************************** - * ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont) - * Create and initialize a new threadattr variable - * arg 1) The newly created threadattr. - * arg 2) The context to use - */ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont) { ap_status_t stat; @@ -86,12 +80,6 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont) return stat; } -/* ***APRDOC******************************************************** - * ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) - * Set if newly created threads should be created in detach mode. - * arg 1) The threadattr to affect - * arg 2) Thread detach state on or off - */ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) { ap_status_t stat; @@ -103,11 +91,6 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) - * Get the detach mode for this threadattr. - * arg 1) The threadattr to reference - */ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) { int state; @@ -118,17 +101,6 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) return APR_NOTDETACH; } -/* ***APRDOC******************************************************** - * ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - * ap_thread_start_t func, void *data, - * ap_context_t *cont) - * Create a new thread of execution - * arg 1) The newly created thread handle. - * arg 2) The threadattr to use to determine how to create the thread - * arg 3) The function to start the new thread in - * arg 4) Any data to be passed to the starting function - * arg 5) The context to use - */ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_context_t *cont) @@ -168,12 +140,6 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, } } -/* ***APRDOC******************************************************** - * ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) - * stop the current thread - * arg 1) The thread to stop - * arg 2) The return value to pass back to any thread that cares - */ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) { ap_destroy_pool(thd->cntxt); @@ -181,12 +147,6 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) - * block until the desired thread stops executing. - * arg 1) The return value from the dead thread. - * arg 2) The thread to join - */ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) { ap_status_t stat; @@ -199,11 +159,6 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_thread_detach(ap_thread_t *thd) - * detach a thread - * arg 1) The thread to detach - */ ap_status_t ap_thread_detach(ap_thread_t *thd) { ap_status_t stat; @@ -216,13 +171,6 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) - * Return the context associated with the current thread. - * arg 1) The user data associated with the thread. - * arg 2) The key to associate with the data - * arg 3) The currently open thread. - */ ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) { if (thread != NULL) { @@ -234,16 +182,6 @@ ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_threaddata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread) - * Return the context associated with the current thread. - * arg 1) The user data to associate with the thread. - * arg 2) The key to use for associating the data with the tread - * arg 3) The cleanup routine to use when the thread is destroyed. - * arg 4) The currently open thread. - */ ap_status_t ap_set_threaddata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) @@ -257,12 +195,6 @@ ap_status_t ap_set_threaddata(void *data, char *key, } } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_os_thread(ap_thread_t *thethd, ap_os_thread_t *thd) - * convert the thread to os specific type from apr type. - * arg 1) The apr thread to convert - * arg 2) The os specific thread we are converting to - */ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) { if (thd == NULL) { @@ -272,14 +204,6 @@ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_put_os_thread(ap_thread_t *thd, ap_os_thread_t *thethd, - * ap_context_t *cont) - * convert the thread from os specific type to apr type. - * arg 1) The apr thread we are converting to. - * arg 2) The os specific thread to convert - * arg 3) The context to use if it is needed. - */ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, ap_context_t *cont) { diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 232ab2f89..e57cb8424 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -58,15 +58,6 @@ #if APR_HAS_THREADS #ifdef HAVE_PTHREAD_H -/* ***APRDOC******************************************************** - * ap_status_t ap_create_thread_private(ap_threadkey_t **key, - * void (*dest)(void *), - * ap_context_t *cont) - * Create and initialize a new thread private address space - * arg 1) The thread private handle. - * arg 2) The destructor to use when freeing the private memory. - * arg 3) The context to use - */ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_context_t *cont) { @@ -85,24 +76,12 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return stat; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) - * Get a pointer to the thread private memory - * arg 1) The data stored in private memory - * arg 2) The handle for the desired thread private memory - */ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) { (*new) = pthread_getspecific(key->key); return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) - * Set the data to be stored in thread private memory - * arg 1) The data to be stored in private memory - * arg 2) The handle for the desired thread private memory - */ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) { ap_status_t stat; @@ -114,11 +93,6 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_delete_thread_private(ap_threadkey_t *key) - * Free the thread private memory - * arg 1) The handle for the desired thread private memory - */ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) { ap_status_t stat; @@ -128,14 +102,6 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) return stat; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_threadkeydata(void **data, char *key, - * ap_threadkey_t *threadkey) - * Return the context associated with the current threadkey. - * arg 1) The user data associated with the threadkey. - * arg 2) The key associated with the data - * arg 3) The currently open threadkey. - */ ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey) { if (threadkey != NULL) { @@ -147,16 +113,6 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadk } } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_threadkeydata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey) - * Return the context associated with the current threadkey. - * arg 1) The data to set. - * arg 1) The key to associate with the data. - * arg 2) The user data to associate with the threadkey. - * arg 1) The currently open threadkey. - */ ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) @@ -170,13 +126,6 @@ ap_status_t ap_set_threadkeydata(void *data, } } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_os_threadkey(ap_threadkey_t *thekey, ap_os_threadkey_t *key) - * convert the thread private memory key to os specific type - * from an apr type. - * arg 1) The apr handle we are converting from. - * arg 2) The os specific handle we are converting to. - */ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) { if (key == NULL) { @@ -186,14 +135,6 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_put_os_threadkey(ap_threadkey_t *key, ap_os_threadkey_t *thekey, - * ap_context_t *cont) - * convert the thread private memory key from os specific type to apr type. - * arg 1) The apr handle we are converting to. - * arg 2) The os specific handle to convert - * arg 3) The context to use if it is needed. - */ ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey, ap_context_t *cont) { |