diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-19 17:59:57 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-19 17:59:57 +0000 |
| commit | 4fea306f5ef2a1fd9b004ef654f03cb1a61afdf0 (patch) | |
| tree | b424da85ddc42da5895b622c3fd3fb084517c842 | |
| parent | 8d3bdca1b404fec117ea7efd6fce0c4e6a2adc1d (diff) | |
| download | bcm5719-llvm-4fea306f5ef2a1fd9b004ef654f03cb1a61afdf0.tar.gz bcm5719-llvm-4fea306f5ef2a1fd9b004ef654f03cb1a61afdf0.zip | |
For PR351:
Incorporate the abilities of RunPRogramWithTimeout into
sys::Program::ExecuteAndWait so that redirection and a timeout are optionally
supported.
llvm-svn: 19039
| -rw-r--r-- | llvm/include/llvm/System/Program.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/include/llvm/System/Program.h b/llvm/include/llvm/System/Program.h index 45fb9500cdf..6528d6804ea 100644 --- a/llvm/include/llvm/System/Program.h +++ b/llvm/include/llvm/System/Program.h @@ -56,15 +56,26 @@ namespace sys { /// @brief Executes the program with the given set of \p args. static int ExecuteAndWait( const Path& path, ///< The path to the program to execute - const std::vector<std::string>& args, + const char** args, ///< A vector of strings that are passed to the program. - ///< The first element should *not* be the name of the program. - const char ** env = 0 + ///< The first element should be the name of the program. The list + ///< *must* be terminated by a null char* entry. + const char ** env = 0, ///< An optional vector of strings to use for the program's ///< environment. If not provided, the current program's environment ///< will be used. + const sys::Path** redirects = 0, + ///< An optional array of pointers to Paths. If the array is null, + ///< no redirection is done. The array should have a size of at least + ///< three. If the pointer in the array are not null, then the + ///< inferior process's stdin(0), stdout(1), and stderr(2) will be + ///< redirected to the corresponding Paths. + unsigned secondsToWait = 0 + ///< If non-zero, this specifies the amount of time to wait for the + ///< child process to exit. If the time expires, the child is killed + ///< and this call returns. If zero, this function will wait until + ///< the child finishes or forever if it doesn't. ); - /// @} }; } } |

