From a9bf571972ac2c5eee629ef061437f5a41090fde Mon Sep 17 00:00:00 2001 From: schmidt Date: Sun, 11 Oct 1998 00:45:19 +0000 Subject: . --- ace/Process.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ace/Process.cpp') diff --git a/ace/Process.cpp b/ace/Process.cpp index 82b54091e8b..226bf1755c7 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -52,6 +52,33 @@ ACE_Process::spawn (ACE_Process_Options &options) else // CreateProcess failed. return -1; +#elif defined (CHORUS) + // This only works if we exec. Chorus does not really support + // forking + if (ACE_BIT_ENABLED (options.creation_flags (), + ACE_Process_Options::NO_EXEC)) + ACE_NOTSUP_RETURN (-1); + + // These are all currently unsupported. + if (options.get_stdin () != ACE_INVALID_HANDLE) + ACE_NOTSUP_RETURN (-1); + if (options.get_stdout () != ACE_INVALID_HANDLE) + ACE_NOTSUP_RETURN (-1); + if (options.get_stderr () != ACE_INVALID_HANDLE) + ACE_NOTSUP_RETURN (-1); + if (options.working_directory () != 0) + ACE_NOTSUP_RETURN (-1); + + if (options.env_argv ()[0] == 0) + // command-line args + this->child_id_ = ACE_OS::execvp (options.command_line_argv ()[0], + options.command_line_argv ()); + else + // Command-line args and environment variables + this->child_id_ = ACE_OS::execve (options.command_line_argv ()[0], + options.command_line_argv (), + options.env_argv ()); + return this->child_id_; #else /* ACE_WIN32 */ // Fork the new process. this->child_id_ = ACE_OS::fork (options.command_line_argv ()[0]); -- cgit v1.2.1