|
Apache HTTPD
|
Modules | |
| Other Child Flags | |
Classes | |
| struct | apr_proc_t |
Macros | |
| #define | APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) |
| #define | APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL) |
| #define | APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE) |
| #define | APR_NO_PIPE 0 |
| #define | APR_FULL_BLOCK 1 |
| #define | APR_FULL_NONBLOCK 2 |
| #define | APR_PARENT_BLOCK 3 |
| #define | APR_CHILD_BLOCK 4 |
| #define | APR_NO_FILE 8 |
| #define | APR_NO_FILE 8 |
| #define | APR_READ_BLOCK 3 |
| #define | APR_WRITE_BLOCK 4 |
| #define | APR_LIMIT_CPU 0 |
| #define | APR_LIMIT_MEM 1 |
| #define | APR_LIMIT_NPROC 2 |
| #define | APR_LIMIT_NOFILE 3 |
| #define | APR_PROC_DETACH_FOREGROUND 0 |
| #define | APR_PROC_DETACH_DAEMONIZE 1 |
Enumerations | |
| enum | apr_cmdtype_e { APR_SHELLCMD , APR_PROGRAM , APR_PROGRAM_ENV , APR_PROGRAM_PATH , APR_SHELLCMD_ENV } |
| enum | apr_wait_how_e { APR_WAIT , APR_NOWAIT } |
| enum | apr_exit_why_e { APR_PROC_EXIT = 1 , APR_PROC_SIGNAL = 2 , APR_PROC_SIGNAL_CORE = 4 } |
| enum | apr_kill_conditions_e { APR_KILL_NEVER , APR_KILL_ALWAYS , APR_KILL_AFTER_TIMEOUT , APR_JUST_WAIT , APR_KILL_ONLY_ONCE } |
Functions | |
| APR_DECLARE (apr_status_t) apr_procattr_create(apr_procattr_t **new_attr | |
| APR_DECLARE (void) apr_proc_other_child_register(apr_proc_t *proc | |
| #define APR_CHILD_BLOCK 4 |
Definition at line 88 of file apr_thread_proc.h.
| #define APR_FULL_BLOCK 1 |
Definition at line 82 of file apr_thread_proc.h.
| #define APR_FULL_NONBLOCK 2 |
Definition at line 84 of file apr_thread_proc.h.
| #define APR_LIMIT_CPU 0 |
Definition at line 103 of file apr_thread_proc.h.
| #define APR_LIMIT_MEM 1 |
Definition at line 105 of file apr_thread_proc.h.
| #define APR_LIMIT_NOFILE 3 |
Definition at line 109 of file apr_thread_proc.h.
| #define APR_LIMIT_NPROC 2 |
Definition at line 107 of file apr_thread_proc.h.
| #define APR_NO_FILE 8 |
Definition at line 90 of file apr_thread_proc.h.
| #define APR_NO_FILE 8 |
Definition at line 90 of file apr_thread_proc.h.
| #define APR_NO_PIPE 0 |
Definition at line 80 of file apr_thread_proc.h.
| #define APR_PARENT_BLOCK 3 |
Definition at line 86 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 77 of file apr_thread_proc.h.
| #define APR_PROC_CHECK_EXIT | ( | x | ) | (x & APR_PROC_EXIT) |
did we exit the process
Definition at line 73 of file apr_thread_proc.h.
| #define APR_PROC_CHECK_SIGNALED | ( | x | ) | (x & APR_PROC_SIGNAL) |
did we get a signal
Definition at line 75 of file apr_thread_proc.h.
| #define APR_PROC_DETACH_DAEMONIZE 1 |
Detach
Definition at line 693 of file apr_thread_proc.h.
| #define APR_PROC_DETACH_FOREGROUND 0 |
Do not detach
Definition at line 692 of file apr_thread_proc.h.
| #define APR_READ_BLOCK 3 |
Definition at line 93 of file apr_thread_proc.h.
| #define APR_WRITE_BLOCK 4 |
Definition at line 95 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 174 of file apr_thread_proc.h.
Opaque record of child process.
Definition at line 193 of file apr_thread_proc.h.
The APR process type
Opaque Process attributes structure.
Definition at line 184 of file apr_thread_proc.h.
Opaque control variable for one-time atomic variables.
Definition at line 187 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 198 of file apr_thread_proc.h.
Opaque Thread structure.
Definition at line 178 of file apr_thread_proc.h.
Opaque Thread attributes structure.
Definition at line 181 of file apr_thread_proc.h.
Opaque thread private address space.
Definition at line 190 of file apr_thread_proc.h.
Definition at line 46 of file apr_thread_proc.h.
| Enumerator | |
|---|---|
| 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 66 of file apr_thread_proc.h.
| Enumerator | |
|---|---|
| APR_KILL_NEVER | process is never killed (i.e., never sent any signals), but it will be reaped if it exits before the pool is cleaned up |
| 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 |
Definition at line 200 of file apr_thread_proc.h.
| Enumerator | |
|---|---|
| APR_WAIT | wait for the specified process to finish |
| APR_NOWAIT | do not wait – just see if it has finished |
Definition at line 56 of file apr_thread_proc.h.
| APR_DECLARE | ( | apr_status_t | ) |
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 |
Register permission set function
| attr | The procattr we care about. |
| perms_set_fn | Permission set callback |
| data | Data to pass to permission callback function |
| perms | Permissions to set |
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. |
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< ->name in proper case
< ->name in proper case
< Access Time
< Create the file if not there
< Open the file for reading
< Open the file for writing
< Delete the file after close
< Open should fail if APR_FOPEN_CREATE and file exists.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Read by user
<
< Write by user
<
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< ->name in proper case
< Modification Time
< Access Time
< Creation or inode-changed time
< Type
< Size of the file
< Storage size consumed by the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< ->name in proper case
< ->name in proper case
< Type
< all protections
< ->name in proper case
< ->name in proper case
< File is read-only
< File is hidden
< File is read-only
< File is read-only
< File is hidden
< File is hidden
< Platform dependent flag to enable * non blocking file io
< Open the file for reading
< Open the file for writing
< Open the file for reading
< Open the file for writing
< Open the file for buffered I/O
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open the file and truncate to 0 length
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Open the file and truncate to 0 length
< Append to the end of the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Delete the file after close
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Append to the end of the file
< an atomic unix apr_stat()
< Open the file for writing
< Create the file if not there
< Open the file and truncate to 0 length
< Open the file for writing
< Create the file if not there
< Append to the end of the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Access Time
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< Create the file if not there
< Open the file for reading
< Open the file for writing
< Open should fail if APR_FOPEN_CREATE and file exists.
< Delete the file after close
< Open the file for reading
< Open the file for writing
< Open the file for reading
< Open the file for writing
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Append to the end of the file
< Open the file and truncate to 0 length
< Platform dependent flag to enable * non blocking file io
< use OS's default permissions
<
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Open the file for buffered I/O
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
The problem with trying to output the entire iovec is that we cannot maintain the behaviour that a real writev would have. If we iterate over the iovec one at a time, we lose the atomic properties of writev(). The other option is to combine the entire iovec into one buffer that we could then send in one call to write(). This is not reasonable since we do not know how much data an iovec could contain.
The only reasonable option, that maintains the semantics of a real writev(), is to only write the first iovec. Callers of file_writev() must deal with partial writes as they normally would. If you want to ensure an entire iovec is written, use apr_file_writev_full().
< ->name in proper case
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Size of the file
< Size of the file
< dev and inode
< Number of links
< ->name in proper case
< Type
< Type
< ->name in proper case
< File is read-only
< File is hidden
< File is read-only
< File is read-only
< File is hidden
< File is hidden
< Open the file for reading
< use OS's default permissions
<
< Platform dependent flag to enable * non blocking file io
< Open the file for reading
< Open the file for writing
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open the file and truncate to 0 length
< Open the file and truncate to 0 length
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Delete the file after close
< Open the file for reading
< Open the file for writing
< Platform dependent tag to open the file for use across multiple threads
< Append to the end of the file
< Open the file for buffered I/O
< Platform dependent flag to enable * sparse file support, see WARNING below
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Append to the end of the file
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Size of the file
< Platform dependent tag to open the file for use across multiple threads
< Size of the file
Definition at line 74 of file apr_atomic.c.
| 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
|
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
Definition at line 224 of file apr_pools.h.
| apr_int32_t addrspace |
Definition at line 560 of file apr_thread_proc.h.
Definition at line 627 of file apr_thread_proc.h.
| apr_file_t* child_err |
Definition at line 470 of file apr_thread_proc.h.
| apr_file_t* child_in |
Definition at line 436 of file apr_thread_proc.h.
| apr_file_t* child_out |
Definition at line 453 of file apr_thread_proc.h.
| apr_int32_t chk |
Definition at line 550 of file apr_thread_proc.h.
| apr_cmdtype_e cmd |
Definition at line 495 of file apr_thread_proc.h.
| apr_pool_t* cont |
Definition at line 400 of file apr_thread_proc.h.
| void(*) void data) |
Definition at line 592 of file apr_thread_proc.h.
| apr_int32_t detach |
Definition at line 503 of file apr_thread_proc.h.
Definition at line 481 of file apr_thread_proc.h.
Definition at line 626 of file apr_thread_proc.h.
Definition at line 418 of file apr_thread_proc.h.
| apr_child_errfn_t* errfn |
Definition at line 535 of file apr_thread_proc.h.
| int * exitcode |
Definition at line 657 of file apr_thread_proc.h.
| int apr_exit_why_e * exitwhy |
Definition at line 657 of file apr_thread_proc.h.
Definition at line 580 of file apr_thread_proc.h.
Definition at line 801 of file apr_thread_proc.h.
| apr_int32_t in |
Definition at line 417 of file apr_thread_proc.h.
Definition at line 721 of file apr_thread_proc.h.
Definition at line 417 of file apr_thread_proc.h.
| void(*) void apr_file_t apr_pool_t p) |
Definition at line 690 of file apr_thread_proc.h.
| apr_file_t apr_file_t* parent_err |
Definition at line 471 of file apr_thread_proc.h.
| apr_file_t apr_file_t* parent_in |
Definition at line 437 of file apr_thread_proc.h.
| apr_file_t apr_file_t* parent_out |
Definition at line 454 of file apr_thread_proc.h.
| apr_perms_setfn_t void apr_fileperms_t perms |
Definition at line 593 of file apr_thread_proc.h.
| apr_perms_setfn_t* perms_set_fn |
Definition at line 591 of file apr_thread_proc.h.
| const char const char* const const char* const apr_procattr_t apr_pool_t* pool |
Definition at line 628 of file apr_thread_proc.h.
| apr_proc_t* proc |
Definition at line 800 of file apr_thread_proc.h.
Definition at line 624 of file apr_thread_proc.h.
| int reason |
Definition at line 759 of file apr_thread_proc.h.
| int sig |
Definition at line 785 of file apr_thread_proc.h.
Definition at line 760 of file apr_thread_proc.h.
Definition at line 571 of file apr_thread_proc.h.
| int apr_exit_why_e apr_wait_how_e waithow |
Definition at line 658 of file apr_thread_proc.h.
| void(*) void apr_file_t write_fd) |
Definition at line 724 of file apr_thread_proc.h.