File indexing completed on 2025-01-18 09:50:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_PROCESS_POSIX_CHILD_HPP
0011 #define BOOST_PROCESS_POSIX_CHILD_HPP
0012
0013 #include <utility>
0014 #include <system_error>
0015
0016 namespace boost { namespace process { namespace detail { namespace posix {
0017
0018 typedef ::pid_t pid_t;
0019
0020 struct child_handle
0021 {
0022 int pid {-1};
0023 explicit child_handle(int pid) : pid(pid)
0024 {}
0025
0026 child_handle() = default;
0027 ~child_handle() = default;
0028
0029 child_handle(const child_handle & c) = delete;
0030 child_handle(child_handle && c) : pid(c.pid)
0031 {
0032 c.pid = -1;
0033 }
0034 child_handle &operator=(const child_handle & c) = delete;
0035 child_handle &operator=(child_handle && c)
0036 {
0037 pid = c.pid;
0038 c.pid = -1;
0039 return *this;
0040 }
0041
0042 int id() const
0043 {
0044 return pid;
0045 }
0046 bool in_group() const {return true;}
0047 bool in_group(std::error_code&) const noexcept {return true;}
0048
0049 typedef int process_handle_t;
0050 process_handle_t process_handle() const { return pid; }
0051
0052 bool valid() const
0053 {
0054 return pid != -1;
0055 }
0056 };
0057
0058 }}}}
0059
0060 #endif