aboutsummaryrefslogtreecommitdiff
path: root/threadproc/unix/proc.c
Commit message (Collapse)AuthorAge
...
* added support for changing the limit on file descriptors per processBrian Pane2002-07-09
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63591 13f79535-47bb-0310-9956-ffa450edef68
* Style Police writes some more tickets...Sander Striker2002-03-19
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63159 13f79535-47bb-0310-9956-ffa450edef68
* Rename all the "cntxt" members of the thread and proc structures toSander Striker2002-03-19
| | | | | | | "pool". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63158 13f79535-47bb-0310-9956-ffa450edef68
* Update our copyright for this year.Roy T. Fielding2002-03-13
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
* Change apr_proc_detach to take a parameter that can enable/disable automaticAaron Bannert2002-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | forking (aka, to "daemonize"). Detailed explanation: If we are only interested in detaching from the controlling terminal, then we are only interested in creating a new process group (or creating a new session, which implicitly creates a new process group). In order to do so, we must _NOT_ already be a process group leader. The only way to ensure that is true, we normally will call fork() and allow the parent to exit, ensuring that the child is at least a child of a process group leader (and not one itself). Doing this by default prevents some process-watching tools from working with Apache. Therefore, when calling apr_proc_detach with APR_PROC_DETACH_FOREGROUND, the caller is taking responsibility for _NOT_ being a process group leader, which is guaranteed by such process management tools. [A similiar patch was originally submitted Jos and later modifed by Aaron.] Obtained from: Jos Backus <josb@cncdsl.com> Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63044 13f79535-47bb-0310-9956-ffa450edef68
* Add a couple new command types to process creation:Greg Stein2002-01-28
| | | | | | | | | | | | | | | | | | APR_PROGRAM_ENV: start the program using the caller's environment APR_PROGRAM_PATH: search PATH for the program, use caller's env (the normal APR_PROGRAM isolates the env and does not use PATH) The BeOS, OS/2, and Win32 implementations are incomplete. These two new forms just default back to APR_PROGRAM for now. (although BeOS doesn't even distinguish between APR_SHELLCMD and APR_PROGRAM!) On Unix and Netware, these map into execv() and execvp() calls. Also clarified some doc for the enums in apr_thread_proc.h a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62840 13f79535-47bb-0310-9956-ffa450edef68
* Fix leakage with fds with respect to pipes. dup2() should close the oldJustin Erenkrantz2002-01-25
| | | | | | | file descriptor and this new one will be closed when we clean up the pipe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62829 13f79535-47bb-0310-9956-ffa450edef68
* Fix some file cleanup problems in apr_proc_create() which couldJeff Trawick2001-11-11
| | | | | | | | result in the pipes for stdin/stdout/stderr being closed immediately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62497 13f79535-47bb-0310-9956-ffa450edef68
* back out previous change so that mod_cgid works again; addJeff Trawick2001-10-27
| | | | | | | | | | comment with a litte information about the problem with file cleanup conflicting with our pipe setup Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62466 13f79535-47bb-0310-9956-ffa450edef68
* apr_proc_create():Jeff Trawick2001-10-26
| | | | | | | | | | do exec cleanup before duping pipes to fds 0-2; otherwise, any files cleaned up with those fds will hose our pipes; typical symptom is APR_EOF in the parent when trying to read child output git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62465 13f79535-47bb-0310-9956-ffa450edef68
* Fix the reporting for child processes that die. This removesRyan Bloom2001-10-23
| | | | | | | | | all of the non-portable W* macros from Apache. Submitted by: Jeff Trawick and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62455 13f79535-47bb-0310-9956-ffa450edef68
* Simplify apr_proc_wait_all_procs and consolidate apr_proc_wait.Justin Erenkrantz2001-09-21
| | | | | | | | | | | | | (I had a similar version in my tree. Kevin's wins out because of the WIF macros. Are there any platforms that don't have this? The Solaris man page seems to indicate that they must be called, so it seems correct. Please check on your favorite platform.) Submitted by: Kevin Pilch-Bisson <kevin@pilch-bisson.net> Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62358 13f79535-47bb-0310-9956-ffa450edef68
* Return the exit code from apr_proc_wait(). This is a combination of a patchGreg Stein2001-09-20
| | | | | | | | | | | from Justin and Bill, plus a few additional tweaks. Submitted by: Justin Erenkrantz <jerenkrantz@ebuilt.com>, Bill Tutt <billtut@microsoft.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62350 13f79535-47bb-0310-9956-ffa450edef68
* Wrap all APR functions in APR_DECLARE macro.Ryan Bloom2001-08-10
| | | | | | | Submitted by: Sterling Hughes <sterling@designmultimedia.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62139 13f79535-47bb-0310-9956-ffa450edef68
* get rid of a parameter check in apr_proc_wait(); better to segfaultJeff Trawick2001-04-03
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61451 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright to 2001Roy T. Fielding2001-02-16
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61235 13f79535-47bb-0310-9956-ffa450edef68
* *) include "apr_signal.h" when neededGreg Stein2001-02-11
| | | | | | | *) some other minor include tweaks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61208 13f79535-47bb-0310-9956-ffa450edef68
* renaming various functions for consistency sakeDoug MacEachern2001-02-08
| | | | | | | | | | | see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61194 13f79535-47bb-0310-9956-ffa450edef68
* Move apr_private.h.in from the include directory to the arch/unixRyan Bloom2000-12-08
| | | | | | | | | | | directory. This removes all temptation to include apr_private.h from outside of APR, because it just isn't available. This also highlighted a bunch of holes in our header file setup. Basically, just directories that were never migrated to the curret setup. Submitted by: Will Rowe and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60919 13f79535-47bb-0310-9956-ffa450edef68
* The arguments to apr_create_process() should be "const" since we aren'tGreg Stein2000-11-26
| | | | | | | | | | going to change them. It is also quite possible that args are constant strings (thus, we *definitely* better not change them). "env" got the same treatment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60795 13f79535-47bb-0310-9956-ffa450edef68
* Move all of the threadproc private header files to an arch directory underRyan Bloom2000-11-09
| | | | | | | | | the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60660 13f79535-47bb-0310-9956-ffa450edef68
* Fix piped logs in 2.0. This basically:Ryan Bloom2000-10-18
| | | | | | | | | | | | 1) cleans up an annoying type that was getting in my way while I was trying to fix things. 2) Makes some of the allocations pcalloc instead of palloc 3) The arg array passed to create_process is a const *char *, not const *char []. PR: 6642 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60599 13f79535-47bb-0310-9956-ffa450edef68
* Fix a bug in apr_create_process() for Unix. The NULL signifyingJeff Trawick2000-09-15
| | | | | | | | | | the end of the parameters to execve() was stored in the wrong location, overlaying the storage beyond the newargs[] array and also passing uninitialized storage to execve(), which would sometimes fail with EFAULT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60532 13f79535-47bb-0310-9956-ffa450edef68
* We need to test specifically for setrlimit/getrlimit instead ofJim Jagielski2000-08-23
| | | | | | | | | | | | | just the structure or the RLIMIT_* defines. Also, we should make the API function unixd_set_rlimit() ``available'' even if it doesn't do anything. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60512 13f79535-47bb-0310-9956-ffa450edef68
* Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation...William A. Rowe Jr2000-08-06
| | | | | | | | | | | | | see src/lib/apr/apr_compat.h for most details. Also a few minor nits to get Win32 to build. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60481 13f79535-47bb-0310-9956-ffa450edef68
* prefix libapr functions and types with apr_Doug MacEachern2000-08-02
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60470 13f79535-47bb-0310-9956-ffa450edef68
* ap_setprocattr_limit() was broken due to missing break statements.Jeff Trawick2000-07-29
| | | | | | | | | The caller could get APR_ENOTIMPL when the limit was set; the limit argument could be used for more than what the caller specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60456 13f79535-47bb-0310-9956-ffa450edef68
* Move all APR functions related to strings to their own directory, andRyan Bloom2000-07-21
| | | | | | | | | create a new header for those functions. This is the first step to removing the apr/lib directory completely, and moving those files/functions to descriptive directories. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60398 13f79535-47bb-0310-9956-ffa450edef68
* ap_create_pipe was changed to return a pipe with both handlesJeff Trawick2000-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocking (previously, both handles were non-blocking). ap_set_pipe_timeout() is now the only way to manipulate the blocking state of the pipe. Pass -1 for timeout to make it blocking; pass 0 for timeout to make it non-blocking. ap_block_pipe() is gone. A few minor bugs were fixed along the way. OS-specific notes: non-Unix in general: Only Unix/BeOS currently has the optimization to keep track of the blocking state. This is used to avoid syscalls as well as to handle ap_put_os_file(), which is a case where we don't know the blocking state of the handle we are given. OS/2: ap_set_pipe_timeout() with timeout value > 0: The code didn't play with the blocking state before and it doesn't still. I did add logic for special timeout values 0 and -1 to play with the blocking state. ap_create_pipe(): old logic didn't do anything with the blocking state of the second handle; it still doesn't; hopefully it is blocking pre-BONE BEOS: old code to make a pipe non-blocking was a no-op; now it returns APR_ENOTIMPL BONE: old code to make a pipe non-blocking; it passed &zero as the parm to FIONBIO instead of &one; this bug was fixed Win32: The pipe was always created blocking before; no change previously, ap_setprocattr_io() ignored the blocking flag; now it respects it like other platforms and calls ap_set_pipe_timeout(p,0) on appropriate pipe handles (Bill Stoddard was just working in ap_set_pipe_timeout(), so I presume this is golden) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60235 13f79535-47bb-0310-9956-ffa450edef68
* Remove unixd_detach function, because it is provided by APR as ap_detach.Ryan Bloom2000-06-20
| | | | | | | | This also modifies the ap_detach function to look like unixd_detach. Finally all calls to unixd_detach are changed to ap_detach. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60234 13f79535-47bb-0310-9956-ffa450edef68
* Add the resource limiting code back to Apache 2.0. This only works onRyan Bloom2000-06-06
| | | | | | | | | | Unix because I can't find any other platforms with rlimit. If there are other platforms that need this code, then some of the code needs to move. This has just barely been tested, so it could probably use some good testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60147 13f79535-47bb-0310-9956-ffa450edef68
* Rename stdin, stdout, stderr from new ap_proc_t to in, out, and err becauseRyan Bloom2000-05-24
| | | | | | | Windows was having problems with the original names. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60088 13f79535-47bb-0310-9956-ffa450edef68
* Convert ap_proc_t to a complete type. This lets us access the pid directly.Ryan Bloom2000-05-23
| | | | | | | | Only the prefork MPM has been ported so far, the rest of the Unix MPM's are coming later today. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60087 13f79535-47bb-0310-9956-ffa450edef68
* Fix problem where the Unix mpms had an unitialized variable forJeff Trawick2000-05-18
| | | | | | | | | | | | | | | | | | | | child exit status by adding an exit status parameter to ap_wait_all_procs(); with this change, the mpms use ap_wait_all_procs() more like they previously used waitpid(). With the introduction of the exit status parameter, the definition of ap_wait_t was moved from Apache to APR. There was some handling of union wait for the type of the exit status parameter to waitpid() which I retained (but cannot test). For WIN32, ap_wait_t was defined as int (in apr.hw). No current Windows code uses ap_wait_t, but a type is required so that references to ap_wait_t in apr_thread_proc.h can compile on Windows. Note: There is still a storage leak in the way that the Unix mpms call ap_wait_all_procs()... this will be resolved at some later time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60064 13f79535-47bb-0310-9956-ffa450edef68
* Add a new function to APR, ap_wait_all_procs. This waits for any currentRyan Bloom2000-05-04
| | | | | | | child process to die, and then returns that child's information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60022 13f79535-47bb-0310-9956-ffa450edef68
* Use ap_pcalloc instead of ap_palloc where it makes sense.Ryan Bloom2000-04-30
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60005 13f79535-47bb-0310-9956-ffa450edef68
* APR_ENOCONT doesn't make any sense without contexts. Replaced them all withRyan Bloom2000-04-19
| | | | | | | APR_ENOPOOL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59892 13f79535-47bb-0310-9956-ffa450edef68
* Add a pool to dupfile. There is no reason that when we duplicate a file, ↵Ryan Bloom2000-04-17
| | | | | | | | | | | | | | we would want to use the same pool for the duplicated file as we used for the original file. This should solve a problem we were having with dieing quietly on startup, because we are no longer closing stderr in the original process and then opening the config file as file descriptor 2. The original problem report can be found in the message <20000311232812.A1066@sanguine.linuxcare.com.au> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59873 13f79535-47bb-0310-9956-ffa450edef68
* Change ap_context_t to ap_pool_t. This compiles, runs, and serves pagesRyan Bloom2000-04-14
| | | | | | | on Linux, but probably breaks somewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59856 13f79535-47bb-0310-9956-ffa450edef68
* more documentation movementdgaudet2000-04-14
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59841 13f79535-47bb-0310-9956-ffa450edef68
* Finish the APR naming cleanup. This removes the struct's fromRyan Bloom2000-04-03
| | | | | | | | apr_variable declarations. This works on Unix, but a test compile on other platforms would be a good idea. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59773 13f79535-47bb-0310-9956-ffa450edef68
* fix the rest of the struct foo_t to struct ap_foo_t. Next is removing theRyan Bloom2000-04-03
| | | | | | | struct's where possible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59769 13f79535-47bb-0310-9956-ffa450edef68
* Update to Apache Software License version 1.1Roy T. Fielding2000-03-31
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59754 13f79535-47bb-0310-9956-ffa450edef68
* Last doc update.Ryan Bloom2000-03-15
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59713 13f79535-47bb-0310-9956-ffa450edef68
* Fix all the License issues. Including:Ryan Bloom2000-03-10
| | | | | | | | | s/Apache Group/Apache Software Foundation/ s/1999/2000/ s/Sascha's license/ASF license git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59688 13f79535-47bb-0310-9956-ffa450edef68
* Fix more funky indentingBill Stoddard2000-01-28
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59628 13f79535-47bb-0310-9956-ffa450edef68
* Use always ap_signal() in APR to avoid redefining the system call signal()Sascha Schumann1999-12-31
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59564 13f79535-47bb-0310-9956-ffa450edef68
* Fix the logic in blocking vs non-blocking pipes to children. It onlyRyan Bloom1999-12-03
| | | | | | | | makes sense to change the blocking attributes of a pipe if we actually are successful in creating the pipe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59501 13f79535-47bb-0310-9956-ffa450edef68
* Helps to switch on the right variable.Ryan Bloom1999-12-02
| | | | | | | Submitted by: Paul Reder git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59500 13f79535-47bb-0310-9956-ffa450edef68
* We may not always want to make the pipes between processes non-blocking.Ryan Bloom1999-12-02
| | | | | | | | | | This patch allows us to set if both sides of the pipes are nonblocking, both sides are blocking, just the parent side blocks, or just the child side blocks for all three of the pipes created during create_process. I have also modified Apache to take advantage of this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59499 13f79535-47bb-0310-9956-ffa450edef68