diff options
Diffstat (limited to 'dep/ACE_wrappers/ace/Process.inl')
-rw-r--r-- | dep/ACE_wrappers/ace/Process.inl | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Process.inl b/dep/ACE_wrappers/ace/Process.inl index 648f47ecfa2..9723ebc8c44 100644 --- a/dep/ACE_wrappers/ace/Process.inl +++ b/dep/ACE_wrappers/ace/Process.inl @@ -1,19 +1,24 @@ // -*- C++ -*- // // $Id: Process.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/ACE.h" #include "ace/OS_NS_sys_wait.h" #include "ace/OS_NS_signal.h" #include "ace/OS_NS_pwd.h" #include "ace/OS_NS_string.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL + #if defined (ACE_WIN32) + ACE_INLINE PROCESS_INFORMATION ACE_Process::process_info (void) { return process_info_; } #endif /* ACE_WIN32 */ + ACE_INLINE ACE_HANDLE ACE_Process::gethandle (void) const { @@ -23,6 +28,7 @@ ACE_Process::gethandle (void) const return ACE_HANDLE (child_id_); #endif /* ACE_WIN32 */ } + ACE_INLINE pid_t ACE_Process::getpid (void) const @@ -33,6 +39,7 @@ ACE_Process::getpid (void) return child_id_; #endif /* ACE_WIN32 */ } + ACE_INLINE pid_t ACE_Process::wait (ACE_exitcode *status, int wait_options) @@ -47,8 +54,10 @@ ACE_Process::wait (ACE_exitcode *status, ); if (status != 0) *status = this->exit_code_; + return retv; } + ACE_INLINE int ACE_Process::kill (int signum) { @@ -57,6 +66,7 @@ ACE_Process::kill (int signum) else return -1; } + ACE_INLINE int ACE_Process::terminate (void) { @@ -65,6 +75,7 @@ ACE_Process::terminate (void) else return -1; } + ACE_INLINE int ACE_Process::return_value (void) const { @@ -74,16 +85,19 @@ ACE_Process::return_value (void) const return WEXITSTATUS (this->exit_code_); #endif /* ACE_WIN32 */ } + ACE_INLINE ACE_exitcode ACE_Process::exit_code (void) const { return this->exit_code_; } + ACE_INLINE void ACE_Process::exit_code (ACE_exitcode code) { this->exit_code_ = code; } + ACE_INLINE u_long ACE_Process_Options::creation_flags (void) const { @@ -93,16 +107,19 @@ ACE_Process_Options::creation_flags (void) const return creation_flags_; #endif /* ACE_USES_WCHAR */ } + ACE_INLINE void ACE_Process_Options::creation_flags (u_long cf) { creation_flags_ = cf; } + ACE_INLINE pid_t ACE_Process_Options::getgroup (void) const { return process_group_; } + ACE_INLINE pid_t ACE_Process_Options::setgroup (pid_t pgrp) { @@ -110,6 +127,7 @@ ACE_Process_Options::setgroup (pid_t pgrp) process_group_ = pgrp; return old; } + ACE_INLINE int ACE_Process_Options::handle_inheritence (void) { @@ -119,6 +137,7 @@ ACE_Process_Options::handle_inheritence (void) ACE_NOTSUP_RETURN (0); // This is a benign error. #endif /* ACE_WIN32 && ! ACE_HAS_WINCE */ } + ACE_INLINE void ACE_Process_Options::handle_inheritence (int hi) { @@ -129,6 +148,7 @@ ACE_Process_Options::handle_inheritence (int hi) ACE_NOTSUP; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE int ACE_Process_Options::avoid_zombies (void) { @@ -139,7 +159,9 @@ ACE_Process_Options::avoid_zombies (int avoid_zombies) { avoid_zombies_ = avoid_zombies; } + #if defined (ACE_WIN32) + ACE_INLINE ACE_TEXT_STARTUPINFO * ACE_Process_Options::startup_info (void) { @@ -149,6 +171,7 @@ ACE_Process_Options::startup_info (void) return 0; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE LPSECURITY_ATTRIBUTES ACE_Process_Options::get_process_attributes (void) const { @@ -158,6 +181,7 @@ ACE_Process_Options::get_process_attributes (void) const return 0; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE LPSECURITY_ATTRIBUTES ACE_Process_Options::set_process_attributes (void) { @@ -168,6 +192,7 @@ ACE_Process_Options::set_process_attributes (void) return 0; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE LPSECURITY_ATTRIBUTES ACE_Process_Options::get_thread_attributes (void) const { @@ -177,6 +202,7 @@ ACE_Process_Options::get_thread_attributes (void) const return 0; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE LPSECURITY_ATTRIBUTES ACE_Process_Options::set_thread_attributes (void) { @@ -187,37 +213,45 @@ ACE_Process_Options::set_thread_attributes (void) return 0; #endif /* !ACE_HAS_WINCE */ } + #else /* !defined (ACE_WIN32) */ + ACE_INLINE ACE_HANDLE ACE_Process_Options::get_stdin (void) const { return stdin_; } + ACE_INLINE ACE_HANDLE ACE_Process_Options::get_stdout (void) const { return stdout_; } + ACE_INLINE ACE_HANDLE ACE_Process_Options::get_stderr (void) const { return stderr_; } + ACE_INLINE bool ACE_Process_Options::inherit_environment (void) const { return inherit_environment_; } + ACE_INLINE void ACE_Process_Options::inherit_environment (bool nv) { inherit_environment_ = nv; } + ACE_INLINE int ACE_Process_Options::setreugid (const ACE_TCHAR* user) { #if !defined (ACE_LACKS_PWD_FUNCTIONS) struct passwd *ent = ACE_OS::getpwnam (ACE_TEXT_ALWAYS_CHAR (user)); + if (ent != 0) { this->euid_ = ent->pw_uid; @@ -233,47 +267,56 @@ ACE_Process_Options::setreugid (const ACE_TCHAR* user) ACE_NOTSUP_RETURN (-1); #endif /* ACE_LACKS_PWD_FUNCTIONS */ } + ACE_INLINE void ACE_Process_Options::setruid (uid_t id) { this->ruid_ = id; } + ACE_INLINE void ACE_Process_Options::seteuid (uid_t id) { this->euid_ = id; } + ACE_INLINE void ACE_Process_Options::setrgid (uid_t id) { this->rgid_ = id; } + ACE_INLINE void ACE_Process_Options::setegid (uid_t id) { this->egid_ = id; } + ACE_INLINE uid_t ACE_Process_Options::getruid (void) const { return this->ruid_; } + ACE_INLINE uid_t ACE_Process_Options::geteuid (void) const { return this->euid_; } + ACE_INLINE uid_t ACE_Process_Options::getrgid (void) const { return this->rgid_; } + ACE_INLINE uid_t ACE_Process_Options::getegid (void) const { return this->egid_; } #endif /* ACE_WIN32 */ + ACE_INLINE ACE_TCHAR * ACE_Process_Options::command_line_buf (int *max_lenp) { @@ -281,6 +324,7 @@ ACE_Process_Options::command_line_buf (int *max_lenp) *max_lenp = this->command_line_buf_len_; return this->command_line_buf_; } + ACE_INLINE ACE_TCHAR * ACE_Process_Options::working_directory (void) { @@ -293,6 +337,7 @@ ACE_Process_Options::working_directory (void) return 0; #endif /* !ACE_HAS_WINCE */ } + ACE_INLINE void ACE_Process_Options::working_directory (const char *wd) { @@ -302,6 +347,7 @@ ACE_Process_Options::working_directory (const char *wd) ACE_UNUSED_ARG (wd); #endif /* !ACE_HAS_WINCE */ } + #if defined (ACE_HAS_WCHAR) ACE_INLINE void ACE_Process_Options::working_directory (const wchar_t *wd) @@ -313,31 +359,38 @@ ACE_Process_Options::working_directory (const wchar_t *wd) #endif /* !ACE_HAS_WINCE */ } #endif /* ACE_HAS_WCHAR */ + ACE_INLINE void ACE_Process_Options::process_name (const ACE_TCHAR *p) { ACE_OS::strcpy (this->process_name_, p); } + ACE_INLINE const ACE_TCHAR * ACE_Process_Options::process_name (void) { if (process_name_[0] == '\0') this->process_name (this->command_line_argv ()[0]); + return this->process_name_; } + #if defined (ACE_HAS_WINCE) // Here is a collection of inline functions which are defined only // under CE. They are not empty on most other platforms. + ACE_INLINE int ACE_Process_Options::setenv (ACE_TCHAR * /* envp */[]) { return -1; } + ACE_INLINE int ACE_Process_Options::setenv (const ACE_TCHAR * /* format */, ...) { return -1; } + ACE_INLINE int ACE_Process_Options::setenv (const ACE_TCHAR * /* variable_name */, const ACE_TCHAR * /* format */, @@ -345,6 +398,7 @@ ACE_Process_Options::setenv (const ACE_TCHAR * /* variable_name */, { return -1; } + ACE_INLINE int ACE_Process_Options::set_handles (ACE_HANDLE /* std_in */, ACE_HANDLE /* std_out */, @@ -352,5 +406,7 @@ ACE_Process_Options::set_handles (ACE_HANDLE /* std_in */, { return -1; } + #endif /* ACE_HAS_WINCE */ + ACE_END_VERSIONED_NAMESPACE_DECL |