diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-29 22:28:19 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-29 22:28:19 +0000 |
commit | ed5eaef15428747927fd53be52b59399f9de4e6c (patch) | |
tree | 806912a2a6edb04c4fd55fcf0214728df252589a /ace/ACE.cpp | |
parent | b93a95c850306e17e564becba9c9ecdf9de0965e (diff) | |
download | ATCD-ed5eaef15428747927fd53be52b59399f9de4e6c.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r-- | ace/ACE.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 1164d7b67a9..a9163176ae5 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -12,6 +12,45 @@ size_t ACE::pagesize_ = 0; int +ACE::is_process_active (pid_t pid) +{ +#if !defined(ACE_WIN32) + int retval = ACE_OS::kill (pid, 0); + if (retval == 0) + { + return 1; + } + else + { + if (errno == ESRCH) + return 0; + else + return retval; + } +#else + // Create a handle for the given process id. + ACE_HANDLE process_handle = ::OpenProcess (PROCESS_QUERY_INFORMATION, + FALSE, + pid); + if (process_handle == ACE_INVALID_HANDLE || process_handle == NULL) + return 0; + else + { + DWORD status; + if (GetExitCodeProcess (process_handle, &status) == 0) + return 0; + else + { + if(status == STILL_ACTIVE) + return 1; + else + return 0; + } + } +#endif /* ACE_WIN32 */ +} + +int ACE::register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, |