diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 13:56:48 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 13:56:48 +0000 |
commit | c4078c377d74290ebe4e66da0b4975da91732376 (patch) | |
tree | 1816ef391e42a07929304908ac0e21f4c2f6cb7b /ACE/ace/OS_NS_sys_wait.inl | |
parent | 700d1c1a6be348c6c70a2085e559baeb8f4a62ea (diff) | |
download | ATCD-c4078c377d74290ebe4e66da0b4975da91732376.tar.gz |
swap in externals for ACE and TAO
Diffstat (limited to 'ACE/ace/OS_NS_sys_wait.inl')
-rw-r--r-- | ACE/ace/OS_NS_sys_wait.inl | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/ACE/ace/OS_NS_sys_wait.inl b/ACE/ace/OS_NS_sys_wait.inl deleted file mode 100644 index 2503d509828..00000000000 --- a/ACE/ace/OS_NS_sys_wait.inl +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "ace/OS_NS_errno.h" -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE pid_t -ACE_OS::wait (int *status) -{ - ACE_OS_TRACE ("ACE_OS::wait"); -#if defined (ACE_LACKS_WAIT) - ACE_UNUSED_ARG (status); - ACE_NOTSUP_RETURN (0); -#else - ACE_OSCALL_RETURN (::wait (status), pid_t, -1); -#endif /* ACE_LACKS_WAIT */ -} - -ACE_INLINE pid_t -ACE_OS::waitpid (pid_t pid, - ACE_exitcode *status, - int wait_options, - ACE_HANDLE handle) -{ - ACE_OS_TRACE ("ACE_OS::waitpid"); -#if defined (ACE_LACKS_WAITPID) - ACE_UNUSED_ARG (pid); - ACE_UNUSED_ARG (status); - ACE_UNUSED_ARG (wait_options); - ACE_UNUSED_ARG (handle); - - ACE_NOTSUP_RETURN (0); -#elif defined (ACE_WIN32) - int blocking_period = ACE_BIT_ENABLED (wait_options, WNOHANG) - ? 0 /* don't hang */ - : INFINITE; - - ACE_HANDLE phandle = handle; - - if (phandle == 0) - { - phandle = ::OpenProcess (SYNCHRONIZE, - FALSE, - pid); - - if (phandle == 0) - { - ACE_OS::set_errno_to_last_error (); - return -1; - } - } - - pid_t result = pid; - - // Don't try to get the process exit status if wait failed so we can - // keep the original error code intact. - switch (::WaitForSingleObject (phandle, - blocking_period)) - { - case WAIT_OBJECT_0: - if (status != 0) - // The error status of <GetExitCodeProcess> is nonetheless - // not tested because we don't know how to return the value. - ::GetExitCodeProcess (phandle, - status); - break; - case WAIT_TIMEOUT: - errno = ETIME; - result = 0; - break; - default: - ACE_OS::set_errno_to_last_error (); - result = -1; - } - if (handle == 0) - ::CloseHandle (phandle); - return result; -#elif defined(ACE_TANDEM_T1248_PTHREADS) - ACE_UNUSED_ARG (handle); - ACE_OSCALL_RETURN (::spt_waitpid (pid, status, wait_options), - pid_t, -1); -#else - ACE_UNUSED_ARG (handle); - ACE_OSCALL_RETURN (::waitpid (pid, status, wait_options), - pid_t, -1); -#endif /* ACE_LACKS_WAITPID */ -} - -ACE_INLINE pid_t -ACE_OS::wait (pid_t pid, - ACE_exitcode *status, - int wait_options, - ACE_HANDLE handle) -{ - ACE_OS_TRACE ("ACE_OS::wait"); - return ACE_OS::waitpid (pid, - status, - wait_options, - handle); -} - -ACE_END_VERSIONED_NAMESPACE_DECL |