aboutsummaryrefslogtreecommitdiff
path: root/butl/fdstream
diff options
context:
space:
mode:
Diffstat (limited to 'butl/fdstream')
-rw-r--r--butl/fdstream11
1 files changed, 9 insertions, 2 deletions
diff --git a/butl/fdstream b/butl/fdstream
index 289d925..d3dbef7 100644
--- a/butl/fdstream
+++ b/butl/fdstream
@@ -52,8 +52,9 @@ namespace butl
void
reset (int fd = -1) noexcept;
- // Close an open file descriptor. Throw ios::failure on failure. The object
- // become unopened whenever the exception is thrown or not.
+ // Close an open file descriptor. Throw ios::failure on the underlying OS
+ // error. Reset the descriptor to -1 whenever the exception is thrown or
+ // not.
//
void
close ();
@@ -498,6 +499,12 @@ namespace butl
permissions::rg | permissions::wg |
permissions::ro | permissions::wo);
+ // Duplicate an open file descriptor. Throw ios::failure on the underlying
+ // OS error.
+ //
+ LIBBUTL_EXPORT auto_fd
+ fddup (int fd);
+
// Set the translation mode for the file descriptor. Return the previous
// mode on success, throw ios::failure otherwise.
//