GME
13
|
#define APR_CHILD_BLOCK 4 |
Definition at line 87 of file apr_thread_proc.h.
#define APR_FULL_BLOCK 1 |
Definition at line 81 of file apr_thread_proc.h.
#define APR_FULL_NONBLOCK 2 |
Definition at line 83 of file apr_thread_proc.h.
#define APR_LIMIT_CPU 0 |
Definition at line 102 of file apr_thread_proc.h.
#define APR_LIMIT_MEM 1 |
Definition at line 104 of file apr_thread_proc.h.
#define APR_LIMIT_NOFILE 3 |
Definition at line 108 of file apr_thread_proc.h.
#define APR_LIMIT_NPROC 2 |
Definition at line 106 of file apr_thread_proc.h.
#define APR_NO_FILE 8 |
Definition at line 99 of file apr_thread_proc.h.
#define APR_NO_FILE 8 |
Definition at line 99 of file apr_thread_proc.h.
#define APR_NO_PIPE 0 |
Definition at line 79 of file apr_thread_proc.h.
#define APR_PARENT_BLOCK 3 |
Definition at line 85 of file apr_thread_proc.h.
#define APR_PROC_CHECK_CORE_DUMP | ( | x | ) | (x & APR_PROC_SIGNAL_CORE) |
did we get core
Definition at line 76 of file apr_thread_proc.h.
#define APR_PROC_CHECK_EXIT | ( | x | ) | (x & APR_PROC_EXIT) |
did we exit the process
Definition at line 72 of file apr_thread_proc.h.
#define APR_PROC_CHECK_SIGNALED | ( | x | ) | (x & APR_PROC_SIGNAL) |
did we get a signal
Definition at line 74 of file apr_thread_proc.h.
#define APR_PROC_DETACH_DAEMONIZE 1 |
Detach
Definition at line 678 of file apr_thread_proc.h.
#define APR_PROC_DETACH_FOREGROUND 0 |
Do not detach
Definition at line 677 of file apr_thread_proc.h.
#define APR_READ_BLOCK 3 |
Definition at line 92 of file apr_thread_proc.h.
#define APR_WRITE_BLOCK 4 |
Definition at line 94 of file apr_thread_proc.h.
typedef void( apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, const char *description) |
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:
pool | Pool associated with the apr_proc_t. If your child error function needs user data, associate it with this pool. |
err | APR error code describing the error |
description | Text description of type of processing which failed |
Definition at line 173 of file apr_thread_proc.h.
typedef struct apr_other_child_rec_t apr_other_child_rec_t |
Opaque record of child process.
Definition at line 192 of file apr_thread_proc.h.
typedef struct apr_proc_t apr_proc_t |
The APR process type
typedef struct apr_procattr_t apr_procattr_t |
Opaque Process attributes structure.
Definition at line 183 of file apr_thread_proc.h.
typedef struct apr_thread_once_t apr_thread_once_t |
Opaque control variable for one-time atomic variables.
Definition at line 186 of file apr_thread_proc.h.
typedef void*(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *) |
The prototype for any APR thread worker functions.
Definition at line 197 of file apr_thread_proc.h.
typedef struct apr_thread_t apr_thread_t |
Opaque Thread structure.
Definition at line 177 of file apr_thread_proc.h.
typedef struct apr_threadattr_t apr_threadattr_t |
Opaque Thread attributes structure.
Definition at line 180 of file apr_thread_proc.h.
typedef struct apr_threadkey_t apr_threadkey_t |
Opaque thread private address space.
Definition at line 189 of file apr_thread_proc.h.
enum apr_cmdtype_e |
Definition at line 45 of file apr_thread_proc.h.
enum apr_exit_why_e |
APR_PROC_EXIT |
process exited normally |
APR_PROC_SIGNAL |
process exited due to a signal |
APR_PROC_SIGNAL_CORE |
process exited and dumped a core file |
Definition at line 65 of file apr_thread_proc.h.
Definition at line 199 of file apr_thread_proc.h.
enum apr_wait_how_e |
APR_WAIT |
wait for the specified process to finish |
APR_NOWAIT |
do not wait -- just see if it has finished |
Definition at line 55 of file apr_thread_proc.h.
Create and initialize a new procattr variable
new_attr | The newly created procattr. |
cont | The pool to use |
Determine if any of stdin, stdout, or stderr should be linked to pipes when starting a child process.
attr | The procattr we care about. |
in | Should stdin be a pipe back to the parent? |
out | Should stdout be a pipe back to the parent? |
err | Should stderr be a pipe back to the parent? |
Set the child_in and/or parent_in values to existing apr_file_t values.
attr | The procattr we care about. |
child_in | apr_file_t value to use as child_in. Must be a valid file. |
parent_in | apr_file_t value to use as parent_in. Must be a valid file. |
Set the child_out and parent_out values to existing apr_file_t values.
attr | The procattr we care about. |
child_out | apr_file_t value to use as child_out. Must be a valid file. |
parent_out | apr_file_t value to use as parent_out. Must be a valid file. |
Set the child_err and parent_err values to existing apr_file_t values.
attr | The procattr we care about. |
child_err | apr_file_t value to use as child_err. Must be a valid file. |
parent_err | apr_file_t value to use as parent_err. Must be a valid file. |
Set which directory the child process should start executing in.
attr | The procattr we care about. |
dir | Which dir to start in. By default, this is the same dir as the parent currently resides in, when the createprocess call is made. |
Set what type of command the child process will call.
attr | The procattr we care about. |
cmd | The type of command. One of: APR_SHELLCMD -- Anything that the shell can handle APR_PROGRAM -- Executable program (default) APR_PROGRAM_ENV -- Executable program, copy environment APR_PROGRAM_PATH -- Executable program on PATH, copy env |
Determine if the child should start in detached state.
attr | The procattr we care about. |
detach | Should the child start in detached state? Default is no. |
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.
attr | The procattr describing the child process to be created. |
errfn | The function to call in the child process. |
Specify that apr_proc_create() should do whatever it can to report failures to the caller of apr_proc_create(), rather than find out in the child.
attr | The procattr describing the child process to be created. |
chk | Flag to indicate whether or not extra work should be done to try to report failures to the caller. |
Determine if the child should start in its own address space or using the current one from its parent
attr | The procattr we care about. |
addrspace | Should the child start in its own address space? Default is no on NetWare and yes on other platforms. |
Set the username used for running process
attr | The procattr we care about. |
username | The username used |
password | User password if needed. Password is needed on WIN32 or any other platform having APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set. |
Set the group used for running process
attr | The procattr we care about. |
groupname | The group name used |
Create a new process and execute a new program within that process.
new_proc | The resulting process handle. |
progname | The program to run |
args | the arguments to pass to the new program. The first one should be the program name. |
env | The new environment table for the new process. This should be a list of NULL-terminated strings. This argument is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and APR_SHELLCMD_ENV types of commands. |
attr | the procattr we should use to determine how to create the new process |
pool | The pool to use. |
Wait for a child process to die
proc | The process handle that corresponds to the desired child process |
exitcode | The returned exit status of the child, if a child process dies, or the signal that caused the child to die. On platforms that don't support obtaining this information, the status parameter will be returned as APR_ENOTIMPL. |
exitwhy | Why the child died, the bitwise or of: APR_PROC_EXIT -- process terminated normally APR_PROC_SIGNAL -- process was killed by a signal APR_PROC_SIGNAL_CORE -- process was killed by a signal, and generated a core dump. |
waithow | 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. |
APR_CHILD_DONE -- child is no longer running. APR_CHILD_NOTDONE -- child is still running.
Wait for any current child process to die and return information about that child.
proc | Pointer to NULL on entry, will be filled out with child's information |
exitcode | The returned exit status of the child, if a child process dies, or the signal that caused the child to die. On platforms that don't support obtaining this information, the status parameter will be returned as APR_ENOTIMPL. |
exitwhy | Why the child died, the bitwise or of: APR_PROC_EXIT -- process terminated normally APR_PROC_SIGNAL -- process was killed by a signal APR_PROC_SIGNAL_CORE -- process was killed by a signal, and generated a core dump. |
waithow | 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. |
p | Pool to allocate child information out of. |
Detach the process from the controlling terminal.
daemonize | set to non-zero if the process should daemonize and become a background process, else it will stay in the foreground. |
Notify the maintenance callback of a registered other child process that application has detected an event, such as death.
proc | The process to check |
reason | The reason code to pass to the maintenance function |
status | The status to pass to the maintenance function |
rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p); if (APR_STATUS_IS_CHILD_DONE(rv)) { #if APR_HAS_OTHER_CHILD if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status) == APR_SUCCESS) { ; (already handled) } else #endif [... handling non-otherchild processes death ...]
Terminate a process.
proc | The process to terminate. |
sig | How to kill the process. |
APR_DECLARE | ( | void | ) |
Register an other_child -- a child associated to its registered maintence callback. This callback is invoked when the process dies, is disconnected or disappears.
proc | The child process to register. |
maintenance | maintenance is a function that is invoked with a reason and the data pointer passed here. |
data | Opaque context data passed to the maintenance function. |
write_fd | An fd that is probed for writing. If it is ever unwritable then the maintenance is invoked with reason OC_REASON_UNWRITABLE. |
p | The pool to use for allocating memory. |
write_fd duplicates the proc->out stream, it's really redundant and should be replaced in the APR 1.0 API with a bitflag of which proc->in/out/err handles should be health checked.
no platform currently tests the pipes health.
Stop watching the specified other child.
data | The data to pass to the maintenance function. This is used to find the process to unregister. |
Test one specific other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy.
ocr | The registered other child |
reason | The reason code (e.g. APR_OC_REASON_RESTART) if still running |
Test all registered other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy.
reason | The reason code (e.g. APR_OC_REASON_RESTART) to running processes |
Register a process to be killed when a pool dies.
a | The pool to use to define the processes lifetime |
proc | The process to register |
how | How to kill the process, one of: APR_KILL_NEVER -- process is never sent any signals APR_KILL_ALWAYS -- process is sent SIGKILL on apr_pool_t cleanup APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL APR_JUST_WAIT -- wait forever for the process to complete APR_KILL_ONLY_ONCE -- send SIGTERM and then wait |
apr_int32_t addrspace |
Definition at line 557 of file apr_thread_proc.h.
apr_pool_t apr_dbd_t apr_dbd_results_t apr_dbd_prepared_t int const void ** args |
Definition at line 609 of file apr_thread_proc.h.
const char const char* const const char* const apr_procattr_t* attr |
Definition at line 609 of file apr_thread_proc.h.
Definition at line 467 of file apr_thread_proc.h.
Definition at line 433 of file apr_thread_proc.h.
Definition at line 450 of file apr_thread_proc.h.
apr_int32_t chk |
Definition at line 547 of file apr_thread_proc.h.
Definition at line 492 of file apr_thread_proc.h.
Definition at line 397 of file apr_thread_proc.h.
void(*) void data) |
Definition at line 709 of file apr_thread_proc.h.
apr_int32_t detach |
Definition at line 500 of file apr_thread_proc.h.
const char* dir |
Definition at line 478 of file apr_thread_proc.h.
const char const char* const const char* const* env |
Definition at line 609 of file apr_thread_proc.h.
apr_int32_t apr_int32_t apr_int32_t err |
Definition at line 414 of file apr_thread_proc.h.
Definition at line 532 of file apr_thread_proc.h.
Definition at line 642 of file apr_thread_proc.h.
Definition at line 642 of file apr_thread_proc.h.
const char* groupname |
Definition at line 577 of file apr_thread_proc.h.
Definition at line 785 of file apr_thread_proc.h.
apr_int32_t in |
Definition at line 414 of file apr_thread_proc.h.
void(* maintenance)(int reason, void *, int status) |
Definition at line 706 of file apr_thread_proc.h.
apr_int32_t apr_int32_t out |
Definition at line 414 of file apr_thread_proc.h.
void(*) void apr_file_t apr_pool_t p) |
Definition at line 672 of file apr_thread_proc.h.
Definition at line 467 of file apr_thread_proc.h.
Definition at line 433 of file apr_thread_proc.h.
Definition at line 450 of file apr_thread_proc.h.
const char const char* password |
Definition at line 568 of file apr_thread_proc.h.
const char const char* const const char* const apr_procattr_t apr_pool_t* pool |
Definition at line 609 of file apr_thread_proc.h.
Definition at line 785 of file apr_thread_proc.h.
const char* progname |
Definition at line 609 of file apr_thread_proc.h.
Definition at line 744 of file apr_thread_proc.h.
Definition at line 770 of file apr_thread_proc.h.
Definition at line 744 of file apr_thread_proc.h.
const char* username |
Definition at line 568 of file apr_thread_proc.h.
Definition at line 642 of file apr_thread_proc.h.
void(*) void apr_file_t write_fd) |
Definition at line 709 of file apr_thread_proc.h.