summaryrefslogtreecommitdiff
path: root/ace/Process.i
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-08-22 00:15:58 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-08-22 00:15:58 +0000
commit2bdb1540aaa19c2a51ecc67108a3330450b995e7 (patch)
tree133c77094fc7028a005c0faaa34b0f0d60d1bceb /ace/Process.i
parentf47274c555f6363418380d44721a5827065a3580 (diff)
downloadATCD-2bdb1540aaa19c2a51ecc67108a3330450b995e7.tar.gz
ChangeLogTag:Sat Aug 21 12:36:40 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'ace/Process.i')
-rw-r--r--ace/Process.i51
1 files changed, 42 insertions, 9 deletions
diff --git a/ace/Process.i b/ace/Process.i
index ce83a1ec6af..ec49650111a 100644
--- a/ace/Process.i
+++ b/ace/Process.i
@@ -20,25 +20,59 @@ ACE_Process::getpid (void)
#endif /* ACE_WIN32 */
}
-ACE_INLINE int
-ACE_Process::kill (int signum)
+ACE_INLINE pid_t
+ACE_Process::wait (int *status,
+ int options)
+{
+ return ACE_OS::wait (this->getpid (),
+ status,
+ options);
+}
+
+ACE_INLINE pid_t
+ACE_Process::wait (const ACE_Time_Value &tv,
+ int *status)
{
-#if defined (ACE_WIN32) || defined (CHORUS)
- ACE_UNUSED_ARG (signum);
+#if defined (ACE_WIN32)
+ // Don't try to get the process exit status if wait failed so we can
+ // keep the original error code intact.
+ switch (::WaitForSingleObject (process_info_.hProcess,
+ tv.msec ()))
+ {
+ 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 (handle,
+ (LPDWORD) status);
+ return 0;
+ case WAIT_TIMEOUT:
+ errno = ETIME;
+ return 0;
+ default:
+ ACE_OS::set_errno_to_last_error ();
+ return -1;
+ }
+#else /* ACE_WIN32 */
+ ACE_UNUSED_ARG (tv);
+ ACE_UNUSED_ARG (status);
ACE_NOTSUP_RETURN (-1);
-#else
- return ACE_OS::kill (this->getpid (), signum);
#endif /* ACE_WIN32 */
}
ACE_INLINE int
+ACE_Process::kill (int signum)
+{
+ return ACE_OS::kill (this->getpid (),
+ signum);
+}
+
+ACE_INLINE int
ACE_Process::terminate (void)
{
return ACE::terminate_process (this->getpid ());
}
-// ************************************************************
-
ACE_INLINE u_long
ACE_Process_Options::creation_flags (void) const
{
@@ -55,7 +89,6 @@ ACE_Process_Options::creation_flags (u_long cf)
creation_flags_ = cf;
}
-// ******************************
#if defined (ACE_WIN32)
ACE_INLINE STARTUPINFO *