00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00018 #ifndef BOOST_PROCESS_STATUS_HPP
00019 #define BOOST_PROCESS_STATUS_HPP
00020
00021 #include <boost/process/config.hpp>
00022
00023 #if defined(BOOST_POSIX_API)
00024 # include <sys/wait.h>
00025 #elif defined(BOOST_WINDOWS_API)
00026 #else
00027 # error "Unsupported platform."
00028 #endif
00029
00030 #include <boost/assert.hpp>
00031
00032 namespace boost {
00033 namespace process {
00034
00035 class child;
00036
00046 class status
00047 {
00048 friend class child;
00049
00050 public:
00054 bool exited() const
00055 {
00056 #if defined(BOOST_POSIX_API)
00057 return WIFEXITED(flags_);
00058 #elif defined(BOOST_WINDOWS_API)
00059 return true;
00060 #endif
00061 }
00062
00070 int exit_status() const
00071 {
00072 BOOST_ASSERT(exited());
00073 #if defined(BOOST_POSIX_API)
00074 return WEXITSTATUS(flags_);
00075 #elif defined(BOOST_WINDOWS_API)
00076 return flags_;
00077 #endif
00078 }
00079
00080 protected:
00091 status(int flags)
00092 : flags_(flags)
00093 {
00094 }
00095
00099 int flags_;
00100 };
00101
00102 }
00103 }
00104
00105 #endif