3 // $Id: OS_NS_sys_wait.inl 80826 2008-03-04 14:51:23Z wotte $
5 #include "ace/OS_NS_errno.h"
6 #include "ace/Global_Macros.h"
8 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
11 ACE_OS::wait (int *status)
13 ACE_OS_TRACE ("ACE_OS::wait");
14 #if defined (ACE_LACKS_WAIT)
15 ACE_UNUSED_ARG (status);
16 ACE_NOTSUP_RETURN (0);
18 ACE_OSCALL_RETURN (::wait (status), pid_t, -1);
19 #endif /* ACE_LACKS_WAIT */
23 ACE_OS::waitpid (pid_t pid,
28 ACE_OS_TRACE ("ACE_OS::waitpid");
29 #if defined (ACE_LACKS_WAITPID)
31 ACE_UNUSED_ARG (status);
32 ACE_UNUSED_ARG (wait_options);
33 ACE_UNUSED_ARG (handle);
35 ACE_NOTSUP_RETURN (0);
36 #elif defined (ACE_WIN32)
37 int blocking_period = ACE_BIT_ENABLED (wait_options, WNOHANG)
41 ACE_HANDLE phandle = handle;
45 phandle = ::OpenProcess (SYNCHRONIZE,
51 ACE_OS::set_errno_to_last_error ();
58 // Don't try to get the process exit status if wait failed so we can
59 // keep the original error code intact.
60 switch (::WaitForSingleObject (phandle,
65 // The error status of <GetExitCodeProcess> is nonetheless
66 // not tested because we don't know how to return the value.
67 ::GetExitCodeProcess (phandle,
75 ACE_OS::set_errno_to_last_error ();
79 ::CloseHandle (phandle);
81 #elif defined(ACE_TANDEM_T1248_PTHREADS)
82 ACE_UNUSED_ARG (handle);
83 ACE_OSCALL_RETURN (::spt_waitpid (pid, status, wait_options),
86 ACE_UNUSED_ARG (handle);
87 ACE_OSCALL_RETURN (::waitpid (pid, status, wait_options),
89 #endif /* ACE_LACKS_WAITPID */
93 ACE_OS::wait (pid_t pid,
98 ACE_OS_TRACE ("ACE_OS::wait");
99 return ACE_OS::waitpid (pid,
105 ACE_END_VERSIONED_NAMESPACE_DECL