2 #include "ace/OS_NS_errno.h"
3 #include "ace/Global_Macros.h"
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_OS::wait (int *status)
10 ACE_OS_TRACE ("ACE_OS::wait");
11 #if defined (ACE_LACKS_WAIT)
12 ACE_UNUSED_ARG (status);
13 ACE_NOTSUP_RETURN (-1);
15 ACE_OSCALL_RETURN (::wait (status), pid_t, -1);
16 #endif /* ACE_LACKS_WAIT */
20 ACE_OS::waitpid (pid_t pid,
25 ACE_OS_TRACE ("ACE_OS::waitpid");
26 #if defined (ACE_LACKS_WAITPID)
28 ACE_UNUSED_ARG (status);
29 ACE_UNUSED_ARG (wait_options);
30 ACE_UNUSED_ARG (handle);
32 ACE_NOTSUP_RETURN (-1);
33 #elif defined (ACE_WIN32)
34 int blocking_period = ACE_BIT_ENABLED (wait_options, WNOHANG)
38 ACE_HANDLE phandle = handle;
42 phandle = ::OpenProcess (SYNCHRONIZE,
48 ACE_OS::set_errno_to_last_error ();
55 // Don't try to get the process exit status if wait failed so we can
56 // keep the original error code intact.
57 switch (::WaitForSingleObject (phandle, blocking_period))
61 // The error status of <GetExitCodeProcess> is nonetheless
62 // not tested because we don't know how to return the value.
63 ::GetExitCodeProcess (phandle, status);
70 ACE_OS::set_errno_to_last_error ();
74 ::CloseHandle (phandle);
77 ACE_UNUSED_ARG (handle);
78 ACE_OSCALL_RETURN (::waitpid (pid, status, wait_options),
80 #endif /* ACE_LACKS_WAITPID */
84 ACE_OS::wait (pid_t pid,
89 ACE_OS_TRACE ("ACE_OS::wait");
90 return ACE_OS::waitpid (pid,
96 ACE_END_VERSIONED_NAMESPACE_DECL