io: add dup instance method to fd

This commit is contained in:
Danny Robson 2016-08-29 16:16:51 +10:00
parent 1b118ff377
commit 798d3aac5a
2 changed files with 9 additions and 0 deletions

8
io.cpp
View File

@ -166,6 +166,14 @@ fd::~fd () {
}
///////////////////////////////////////////////////////////////////////////////
fd
fd::dup (void) const
{
return dup (m_fd);
}
//-----------------------------------------------------------------------------
fd
fd::dup (int _fd)

1
io.hpp
View File

@ -47,6 +47,7 @@ namespace util {
fd (const char *path, int flags, mode_t mode = 0660);
fd (const boost::filesystem::path&, int flags);
fd dup (void) const;
static fd dup (int);
~fd ();