]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/process/detail/posix/fd.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / process / detail / posix / fd.hpp
index 51790c32371b949cd582d63c3435dc2b7e459566..bd5f153d3731f90658be80ef5d4f12fea05347bc 100644 (file)
 
 #include <boost/process/detail/posix/handler.hpp>
 #include <unistd.h>
+#include <boost/process/detail/used_handles.hpp>
+#include <array>
 
 namespace boost { namespace process { namespace detail { namespace posix {
 
 
-struct close_fd_ : handler_base_ext
+struct close_fd_ : handler_base_ext, ::boost::process::detail::uses_handles
 {
     close_fd_(int fd) : fd_(fd) {}
 
@@ -27,12 +29,15 @@ struct close_fd_ : handler_base_ext
             e.set_error(::boost::process::detail::get_last_error(), "close() failed");
     }
 
+    int get_used_handles() {return fd_;}
+
+
 private:
     int fd_;
 };
 
 template <class Range>
-struct close_fds_ : handler_base_ext
+struct close_fds_ : handler_base_ext, ::boost::process::detail::uses_handles
 {
 public:
     close_fds_(const Range &fds) : fds_(fds) {}
@@ -48,6 +53,8 @@ public:
             }
     }
 
+    Range& get_used_handles() {return fds_;}
+
 private:
     Range fds_;
 };
@@ -55,7 +62,7 @@ private:
 
 
 template <class FileDescriptor>
-struct bind_fd_ : handler_base_ext
+struct bind_fd_ : handler_base_ext, ::boost::process::detail::uses_handles
 {
 public:
     bind_fd_(int id, const FileDescriptor &fd) : id_(id), fd_(fd) {}
@@ -67,6 +74,9 @@ public:
              e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
     }
 
+    std::array<int, 2> get_used_handles() {return {id_, fd_};}
+
+
 private:
     int id_;
     FileDescriptor fd_;