ACE_Process_Options Class ReferenceProcess Options. More...
Collaboration diagram for ACE_Process_Options:
![]()
Detailed DescriptionProcess Options.This class controls the options passed to <CreateProcess> (or <fork> and <exec>). Notice that on Windows CE, creating a process merely means instantiating a new process. You can't set the handles (since there's no stdin, stdout and stderr,) specify process/thread options, set environment,... So, basically, this class only set the command line and nothing else. Notice that on UNIX platforms, if the <setenv> is used, the <spawn> is using the <execve> system call. It means that the <command_line> should include a full path to the program file (<execve> does not search the PATH). If <setenv> is not used then, the <spawn> is using the <execvp> which searches for the program file in the PATH variable. Member Enumeration Documentation
Constructor & Destructor Documentation
If inherit_environment == true, the new process will inherit the environment of the current process. command_line_buf_len is the max strlen for command-line arguments.
Destructor.
Member Function Documentation
Set the standard handles of the new process to the respective handles. If you want to affect a subset of the handles, make sure to set the others to ACE_INVALID_HANDLE. Returns 0 on success, -1 on failure.
Release the standard handles previously set with set_handles;.
Set a single environment variable, variable_name. Since different platforms separate each environment variable differently, you must call this method once for each variable. <format> can be any printf format string. So options->setenv ("FOO","one + two = %s", "three") will result in "FOO=one + two = three".
Same as above with argv format. envp must be null terminated.
Set the working directory for the process. strlen of wd must be <= MAXPATHLEN.
wchar_t version of working_directory
Set the command-line arguments. format can use any printf formats. The first token in format should be the path to the application. This can either be a full path, relative path, or just an executable name. If an executable name is used, we rely on the platform's support for searching paths. Since we need a path to run a process, this method *must* be called! Returns 0 on success, -1 on failure.
Anti-TChar version of command_line ().
Same as above in argv format. argv must be null terminated.
Specify the full path or relative path, or just the executable name for the process. If this is set, then name will be used to create the process instead of argv[0] set in the command line. This is here so that you can supply something other than executable name as argv[0].
Return the process_name. If the <process_name(name)> set method is not called, this method will return argv[0].
Get the creation flags.
Set the creation flags to affect how a new process is spawned. The only ACE-defined flag is
On Windows, the value of creation_flags is passed to the
Current working directory. Returns "" if nothing has been set.
Buffer of command-line options. Returns a pointer to a buffer that contains the list of command line options. Prior to a call to command_line_argv(), this is a single string of space separated arguments independent of which form of command_line() was used to create it. After a call to command_line_argv(), this is a list of strings each terminated by ''. [Note: spawn() will call command_line_argv().] The total length of all these strings is the same as the single string in the prior case and can be obtained by providing max_len.
argv-style command-line options. Parses and modifies the string created from <command_line_>. All spaces not in quotes ("" or '') are replaced with null () bytes. An argv array is built and returned with each entry pointing to the start of null-terminated string. Returns { 0 } if nothing has been set.
Null-terminated buffer of null terminated strings. Each string is an environment assignment "VARIABLE=value". This buffer should end with two null characters.
Get the process group. On UNIX, these methods are used by the ACE_Process_Manager to manage groups of processes. Set the process group. On UNIX, these methods are used by the ACE_Process_Manager to manage groups of processes.
Allows disabling of handle inheritence, default is TRUE.
Cause the specified handle to be passed to a child process when it runs a new program image. The specified handle value will be included in the spawned process's command line as
Get a copy of the handles the ACE_Process_Options duplicated for the spawned process. Any handles created through duplication of those passed into
Get a copy of the handles passed to the spawned process. This will be the set of handles previously passed to
Set value for avoid_zombies (has no real effect except on *nix).
Get current value for avoid_zombies.
Enable the use of a Unicode environment. This only makes sense for Win32 when ACE_USES_WCHAR is not defined.
Disable the use of a Unicode environment.
Return the unicode environment status.
Used for setting and getting.
Get the process_attributes. Returns NULL if set_process_attributes has not been set.
If this is called, a non-null process attributes is sent to CreateProcess.
Get the thread_attributes. Returns NULL if set_thread_attributes has not been set.
If this is called, a non-null thread attributes is sent to CreateProcess.
Add assignment to environment_buf_ and adjust environment_argv_. len is the strlen of assignment.
Helper function to grab win32 environment and stick it in environment_buf_ using this->setenv_i.
Member Data Documentation
Whether the child process inherits the current process environment.
Default 0.
Avoid zombies for spawned processes.
Ensures once only call to inherit environment.
Default TRUE.
Pointer to security_buf1_.
Pointer to security_buf2_.
Data for process_attributes_.
Data for thread_attributes_.
Is 1 if stdhandles was called.
Pointer into environment_buf_. This should point to the next free spot.
Pointer to environment_argv_.
Pointer to buffer of the environment settings.
Size of the environment buffer. Configurable.
Pointers into environment_buf_.
Maximum number of environment variables. Configurable.
Maximum index of environment_argv_ buffer.
The current working directory.
Ensures command_line_argv is only calculated once.
Pointer to buffer of command-line arguments. E.g., "-f foo -b bar".
Pointer to copy of command-line arguments, which is needed when converting a command-line string into a command-line argv.
Max length of command_line_buf_.
Argv-style command-line arguments.
Process-group on Unix; unused on Win32.
Set of handles that were passed in pass_handle ().
Results of duplicating handles passed in pass_handle ().
Pathname for the process. Relative path or absolute path or just the program name.
Indicate if a Unicode environment should be used.
The documentation for this class was generated from the following files: Generated on Mon Sep 15 07:16:15 2008 for ACE by ![]() |