From ae43c5780651d594b1ec76e99330cd6ef082b0c5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 16 Oct 2020 22:18:45 +0300 Subject: Add fdselect() overload that also takes timeout --- libbutl/fdstream.ixx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libbutl/fdstream.ixx') diff --git a/libbutl/fdstream.ixx b/libbutl/fdstream.ixx index fb57b99..4ef5b1d 100644 --- a/libbutl/fdstream.ixx +++ b/libbutl/fdstream.ixx @@ -353,4 +353,23 @@ namespace butl { return fdmode (stderr_fd (), m); } + + // fdselect + // + // Implement fdselect() function templates in terms of their milliseconds + // specialization. + // + template <> + LIBBUTL_SYMEXPORT std::pair + fdselect (fdselect_set&, fdselect_set&, const std::chrono::milliseconds&); + + template + inline std::pair + fdselect (fdselect_set& ifds, + fdselect_set& ofds, + const std::chrono::duration& timeout) + { + using namespace std::chrono; + return fdselect (ifds, ofds, duration_cast (timeout)); + } } -- cgit v1.1