00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file OS_NS_sys_wait.h 00006 * 00007 * $Id: OS_NS_sys_wait.h 74005 2006-08-14 11:30:00Z johnnyw $ 00008 * 00009 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00010 * @author Jesper S. M|ller<stophph@diku.dk> 00011 * @author and a cast of thousands... 00012 * 00013 * Originally in OS.h. 00014 */ 00015 //============================================================================= 00016 00017 #ifndef ACE_OS_NS_SYS_WAIT_H 00018 # define ACE_OS_NS_SYS_WAIT_H 00019 00020 # include /**/ "ace/pre.h" 00021 00022 # include "ace/config-all.h" 00023 00024 # if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 # endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "ace/os_include/sys/os_wait.h" 00029 #include /**/ "ace/ACE_export.h" 00030 00031 #if defined (ACE_EXPORT_MACRO) 00032 # undef ACE_EXPORT_MACRO 00033 #endif 00034 #define ACE_EXPORT_MACRO ACE_Export 00035 00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00037 00038 namespace ACE_OS 00039 { 00040 00041 /// Calls OS @c ::wait function, so it's only portable to UNIX/POSIX 00042 /// platforms. 00043 ACE_NAMESPACE_INLINE_FUNCTION 00044 pid_t wait (int * = 0); 00045 00046 /** 00047 * Calls @c ::WaitForSingleObject on Win32 and ACE::waitpid () 00048 * otherwise. Returns the passed in @a pid_t on success and -1 on 00049 * failure. 00050 * On Win32, @a pid is ignored if the @a handle is not equal to 0. 00051 * Passing the process @a handle is prefer on Win32 because using 00052 * @a pid to wait on the project doesn't always work correctly 00053 * if the waited process has already terminated. 00054 */ 00055 ACE_NAMESPACE_INLINE_FUNCTION 00056 pid_t wait (pid_t pid, 00057 ACE_exitcode *status, 00058 int wait_options = 0, 00059 ACE_HANDLE handle = 0); 00060 00061 /** 00062 * Calls @c ::waitpid on UNIX/POSIX platforms Does not work on Vxworks 5.5.x. 00063 * On Win32, @a pid is ignored if the @a handle is not equal to 0. 00064 * Passing the process @a handle is prefer on Win32 because using 00065 * @a pid to wait on the project doesn't always work correctly 00066 * if the waited process has already terminated. 00067 */ 00068 ACE_NAMESPACE_INLINE_FUNCTION 00069 pid_t waitpid (pid_t pid, 00070 ACE_exitcode *status = 0, 00071 int wait_options = 0, 00072 ACE_HANDLE handle = 0); 00073 00074 } /* namespace ACE_OS */ 00075 00076 ACE_END_VERSIONED_NAMESPACE_DECL 00077 00078 # if defined (ACE_HAS_INLINED_OSCALLS) 00079 # if defined (ACE_INLINE) 00080 # undef ACE_INLINE 00081 # endif /* ACE_INLINE */ 00082 # define ACE_INLINE inline 00083 # include "ace/OS_NS_sys_wait.inl" 00084 # endif /* ACE_HAS_INLINED_OSCALLS */ 00085 00086 # include /**/ "ace/post.h" 00087 #endif /* ACE_OS_NS_SYS_WAIT_H */