diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-09 17:25:30 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-10 19:08:44 +0100 |
commit | 68e576e9f92e94e27123d47ce27c56426eb06193 (patch) | |
tree | e9b705a3c8579d17ba95891884f05717003b24f9 | |
parent | 8ee559bd63e782571123b3299525a25949eaa964 (diff) | |
download | tor-68e576e9f92e94e27123d47ce27c56426eb06193.tar.gz tor-68e576e9f92e94e27123d47ce27c56426eb06193.zip |
Update documentation for tor_spawn_background
- Include description of stdout_read, stderr_read, and argv
-rw-r--r-- | src/common/util.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/common/util.c b/src/common/util.c index ae18cd5525..402cfbf78e 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2960,11 +2960,18 @@ format_helper_exit_status(unsigned char child_state, int saved_errno, #define SPAWN_ERROR_MESSAGE "ERR: Failed to spawn background process - code " -/** Start a program in the background. If <b>filename</b> contains a '/', then - * it will be treated as an absolute or relative path. Otherwise the system - * path will be searched for <b>filename</b>. Returns pid on success, otherwise - * returns -1. - * Some parts of this code are based on the POSIX subprocess module from Python +/** Start a program in the background. If <b>filename</b> contains a '/', + * then it will be treated as an absolute or relative path. Otherwise the + * system path will be searched for <b>filename</b>. The strings in + * <b>argv</b> will be passed as the command line arguments of the child + * program (following convention, argv[0] should normally be the filename of + * the executable). The last element of argv must be NULL. If the child + * program is launched, the PID will be returned and <b>stdout_read</b> and + * <b>stdout_err</b> will be set to file descriptors from which the stdout + * and stderr, respectively, output of the child program can be read, and the + * stdin of the child process shall be set to /dev/null. Otherwise returns + * -1. Some parts of this code are based on the POSIX subprocess module from + * Python. */ static int tor_spawn_background(const char *const filename, int *stdout_read, |