Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------doc/html8
m---------include/boost/afio/boost-lite0
m---------include/boost/afio/outcome0
-rw-r--r--include/boost/afio/revision.hpp6
-rw-r--r--include/boost/afio/v2.0/async_file_handle.hpp26
-rw-r--r--include/boost/afio/v2.0/detail/impl/posix/file_handle.ipp1
-rw-r--r--include/boost/afio/v2.0/detail/impl/posix/handle.ipp22
-rw-r--r--include/boost/afio/v2.0/detail/impl/windows/file_handle.ipp13
-rw-r--r--include/boost/afio/v2.0/detail/impl/windows/handle.ipp20
-rw-r--r--include/boost/afio/v2.0/detail/impl/windows/stat.ipp26
-rw-r--r--include/boost/afio/v2.0/file_handle.hpp14
-rw-r--r--include/boost/afio/v2.0/handle.hpp45
-rw-r--r--include/boost/afio/v2.0/stat.hpp52
m---------test/kerneltest0
14 files changed, 115 insertions, 118 deletions
diff --git a/doc/html b/doc/html
-Subproject b230026567ce566d45e224c35fc7c95a0046e2a
+Subproject 641cadb4e991fa835d5d7e26f58f2dd7f02634d
diff --git a/include/boost/afio/boost-lite b/include/boost/afio/boost-lite
-Subproject f7a19f6a8e0f51a8d47197e7b76d102bc12b167
+Subproject 772d81695870f6139f9e06828484480b1a5487d
diff --git a/include/boost/afio/outcome b/include/boost/afio/outcome
-Subproject ad136750f6134fbe8576d65b1141a0d1ad888e1
+Subproject df4468529af6559c049b2421d0c2162d58d5f69
diff --git a/include/boost/afio/revision.hpp b/include/boost/afio/revision.hpp
index 0bbabac9..63674219 100644
--- a/include/boost/afio/revision.hpp
+++ b/include/boost/afio/revision.hpp
@@ -1,4 +1,4 @@
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
-#define BOOST_AFIO_PREVIOUS_COMMIT_REF 09f734b579955c79e1fc3fd48db8d05e3ceeb3d9
-#define BOOST_AFIO_PREVIOUS_COMMIT_DATE "2017-04-09 10:51:10 +00:00"
-#define BOOST_AFIO_PREVIOUS_COMMIT_UNIQUE 09f734b5
+#define BOOST_AFIO_PREVIOUS_COMMIT_REF 8374482f8398578f93d9649b54749c6017ef7c78
+#define BOOST_AFIO_PREVIOUS_COMMIT_DATE "2017-04-09 21:07:41 +00:00"
+#define BOOST_AFIO_PREVIOUS_COMMIT_UNIQUE 8374482f
diff --git a/include/boost/afio/v2.0/async_file_handle.hpp b/include/boost/afio/v2.0/async_file_handle.hpp
index ff206835..c990069b 100644
--- a/include/boost/afio/v2.0/async_file_handle.hpp
+++ b/include/boost/afio/v2.0/async_file_handle.hpp
@@ -44,6 +44,8 @@ BOOST_AFIO_V2_NAMESPACE_EXPORT_BEGIN
class BOOST_AFIO_DECL async_file_handle : public file_handle
{
public:
+ using dev_t = file_handle::dev_t;
+ using ino_t = file_handle::ino_t;
using path_type = io_handle::path_type;
using extent_type = io_handle::extent_type;
using size_type = io_handle::size_type;
@@ -59,34 +61,24 @@ public:
template <class T> using io_result = io_handle::io_result<T>;
protected:
- io_service *_service;
+ // Do NOT declare variables here, put them into file_handle to preserve up-conversion
public:
//! Default constructor
- async_file_handle()
- : file_handle()
- , _service(nullptr)
- {
- }
+ constexpr async_file_handle() = default;
//! Construct a handle from a supplied native handle
- async_file_handle(io_service *service, path_type path, native_handle_type h, caching caching = caching::none, flag flags = flag::none)
- : file_handle(std::move(path), std::move(h), std::move(caching), std::move(flags))
- , _service(service)
+ async_file_handle(io_service *service, native_handle_type h, dev_t devid, ino_t inode, path_type path, caching caching = caching::none, flag flags = flag::none)
+ : file_handle(std::move(h), devid, inode, std::move(path), std::move(caching), std::move(flags))
{
+ this->_service = service;
}
//! Implicit move construction of async_file_handle permitted
- async_file_handle(async_file_handle &&o) noexcept : file_handle(std::move(o)), _service(o._service) { o._service = nullptr; }
+ async_file_handle(async_file_handle &&o) noexcept = default;
//! Explicit conversion from file_handle permitted
explicit async_file_handle(file_handle &&o) noexcept : file_handle(std::move(o)) {}
//! Explicit conversion from handle and io_handle permitted
- explicit async_file_handle(handle &&o, io_service *service, path_type path) noexcept : file_handle(std::move(o), std::move(path)), _service(service) {}
- using file_handle::really_copy;
- //! Copy the handle. Tag enabled because copying handles is expensive (fd duplication).
- explicit async_file_handle(const async_file_handle &o, really_copy _)
- : file_handle(o, _)
- {
- }
+ explicit async_file_handle(handle &&o, io_service *service, path_type path, dev_t devid, ino_t inode) noexcept : file_handle(std::move(o), std::move(path), devid, inode) { this->_service = service; }
//! Move assignment of async_file_handle permitted
async_file_handle &operator=(async_file_handle &&o) noexcept
{
diff --git a/include/boost/afio/v2.0/detail/impl/posix/file_handle.ipp b/include/boost/afio/v2.0/detail/impl/posix/file_handle.ipp
index 6d57831a..6009cd04 100644
--- a/include/boost/afio/v2.0/detail/impl/posix/file_handle.ipp
+++ b/include/boost/afio/v2.0/detail/impl/posix/file_handle.ipp
@@ -264,6 +264,7 @@ result<file_handle> file_handle::clone() const noexcept
{
BOOST_AFIO_LOG_FUNCTION_CALL(_v.fd);
result<file_handle> ret(file_handle(native_handle_type(), _path, _devid, _inode, _caching, _flags));
+ ret.value()._service = _service;
ret.value()._v.behaviour = _v.behaviour;
ret.value()._v.fd = ::dup(_v.fd);
if(-1 == ret.value()._v.fd)
diff --git a/include/boost/afio/v2.0/detail/impl/posix/handle.ipp b/include/boost/afio/v2.0/detail/impl/posix/handle.ipp
index ad22dbaf..53452aaf 100644
--- a/include/boost/afio/v2.0/detail/impl/posix/handle.ipp
+++ b/include/boost/afio/v2.0/detail/impl/posix/handle.ipp
@@ -39,17 +39,6 @@ DEALINGS IN THE SOFTWARE.
BOOST_AFIO_V2_NAMESPACE_BEGIN
-handle::handle(const handle &o, handle::really_copy)
-{
- BOOST_AFIO_LOG_FUNCTION_CALL(_v.fd);
- _caching = o._caching;
- _flags = o._flags;
- _v.behaviour = o._v.behaviour;
- _v.fd = ::dup(o._v.fd);
- if(-1 == _v.fd)
- throw std::system_error(errno, std::system_category());
-}
-
handle::~handle()
{
if(_v)
@@ -81,6 +70,17 @@ result<void> handle::close() noexcept
return make_result<void>();
}
+result<handle> handle::clone() const noexcept
+{
+ BOOST_AFIO_LOG_FUNCTION_CALL(_v.fd);
+ result<handle> ret(handle(native_handle_type(), _caching, _flags));
+ ret.value()._v.behaviour = _v.behaviour;
+ ret.value()._v.fd = ::dup(_v.fd);
+ if (-1 == ret.value()._v.fd)
+ return make_errored_result<handle>(errno, last190(path()));
+ return ret;
+}
+
result<void> handle::set_append_only(bool enable) noexcept
{
BOOST_AFIO_LOG_FUNCTION_CALL(_v.fd);
diff --git a/include/boost/afio/v2.0/detail/impl/windows/file_handle.ipp b/include/boost/afio/v2.0/detail/impl/windows/file_handle.ipp
index 141ee118..1d3ae6f8 100644
--- a/include/boost/afio/v2.0/detail/impl/windows/file_handle.ipp
+++ b/include/boost/afio/v2.0/detail/impl/windows/file_handle.ipp
@@ -126,7 +126,7 @@ result<file_handle> file_handle::file(file_handle::path_type _path, file_handle:
{
windows_nt_kernel::init();
using namespace windows_nt_kernel;
- result<file_handle> ret(file_handle(std::move(_path), native_handle_type(), _caching, flags));
+ result<file_handle> ret(file_handle(native_handle_type(), 0, 0, std::move(_path), _caching, flags));
native_handle_type &nativeh = ret.get()._v;
BOOST_OUTCOME_TRY(access, access_mask_from_handle_mode(nativeh, _mode));
DWORD creation = OPEN_EXISTING;
@@ -154,9 +154,9 @@ result<file_handle> file_handle::file(file_handle::path_type _path, file_handle:
return make_errored_result<file_handle>(errcode, last190(ret.value()._path.u8string()));
}
BOOST_AFIO_LOG_FUNCTION_CALL(nativeh.h);
- if(!(flags & disable_safety_unlinks))
+ if(!(flags & flag::disable_safety_unlinks))
{
- BOOST_OUTCOME_TRYV(_fetch_inode());
+ BOOST_OUTCOME_TRYV(ret.value()._fetch_inode());
}
if(flags & flag::unlink_on_close)
{
@@ -181,7 +181,7 @@ result<file_handle> file_handle::temp_inode(path_type dirpath, mode _mode, flag
caching _caching = caching::temporary;
// No need to rename to random on unlink or check inode before unlink
flags |= flag::unlink_on_close | flag::disable_safety_unlinks | flag::win_disable_unlink_emulation;
- result<file_handle> ret(file_handle(path_type(), native_handle_type(), _caching, flags));
+ result<file_handle> ret(file_handle(native_handle_type(), 0, 0, path_type(), _caching, flags));
native_handle_type &nativeh = ret.get()._v;
BOOST_OUTCOME_TRY(access, access_mask_from_handle_mode(nativeh, _mode));
BOOST_OUTCOME_TRY(attribs, attributes_from_handle_caching_and_flags(nativeh, _caching, flags));
@@ -203,7 +203,7 @@ result<file_handle> file_handle::temp_inode(path_type dirpath, mode _mode, flag
return make_errored_result<file_handle>(errcode, last190(ret.value()._path.u8string()));
}
BOOST_AFIO_LOG_FUNCTION_CALL(nativeh.h);
- BOOST_OUTCOME_TRYV(_fetch_inode()); // It can be useful to know the inode of temporary inodes
+ BOOST_OUTCOME_TRYV(ret.value()._fetch_inode()); // It can be useful to know the inode of temporary inodes
if(nativeh.h)
{
// Hide this item
@@ -221,7 +221,8 @@ result<file_handle> file_handle::temp_inode(path_type dirpath, mode _mode, flag
result<file_handle> file_handle::clone() const noexcept
{
BOOST_AFIO_LOG_FUNCTION_CALL(_v.h);
- result<file_handle> ret(file_handle(native_handle_type(), _path, _devid, _inode, _caching, _flags));
+ result<file_handle> ret(file_handle(native_handle_type(), _devid, _inode, _path, _caching, _flags));
+ ret.value()._service = _service;
ret.value()._v.behaviour = _v.behaviour;
if(!DuplicateHandle(GetCurrentProcess(), _v.h, GetCurrentProcess(), &ret.value()._v.h, 0, false, DUPLICATE_SAME_ACCESS))
return make_errored_result<file_handle>(GetLastError(), last190(ret.value()._path.u8string()));
diff --git a/include/boost/afio/v2.0/detail/impl/windows/handle.ipp b/include/boost/afio/v2.0/detail/impl/windows/handle.ipp
index fa053419..a637a0d0 100644
--- a/include/boost/afio/v2.0/detail/impl/windows/handle.ipp
+++ b/include/boost/afio/v2.0/detail/impl/windows/handle.ipp
@@ -34,16 +34,6 @@ DEALINGS IN THE SOFTWARE.
BOOST_AFIO_V2_NAMESPACE_BEGIN
-handle::handle(const handle &o, handle::really_copy)
-{
- BOOST_AFIO_LOG_FUNCTION_CALL(_v.h);
- _caching = o._caching;
- _flags = o._flags;
- _v.behaviour = o._v.behaviour;
- if(!DuplicateHandle(GetCurrentProcess(), o._v.h, GetCurrentProcess(), &_v.h, 0, false, DUPLICATE_SAME_ACCESS))
- throw std::system_error(GetLastError(), std::system_category());
-}
-
handle::~handle()
{
if(_v)
@@ -75,6 +65,16 @@ result<void> handle::close() noexcept
return make_result<void>();
}
+result<handle> handle::clone() const noexcept
+{
+ BOOST_AFIO_LOG_FUNCTION_CALL(_v.h);
+ result<handle> ret(handle(native_handle_type(), _caching, _flags));
+ ret.value()._v.behaviour = _v.behaviour;
+ if (!DuplicateHandle(GetCurrentProcess(), _v.h, GetCurrentProcess(), &ret.value()._v.h, 0, false, DUPLICATE_SAME_ACCESS))
+ return make_errored_result<handle>(GetLastError(), last190(ret.value().path().u8string()));
+ return ret;
+}
+
result<void> handle::set_append_only(bool enable) noexcept
{
BOOST_AFIO_LOG_FUNCTION_CALL(_v.h);
diff --git a/include/boost/afio/v2.0/detail/impl/windows/stat.ipp b/include/boost/afio/v2.0/detail/impl/windows/stat.ipp
index 10c72aca..2e451e6e 100644
--- a/include/boost/afio/v2.0/detail/impl/windows/stat.ipp
+++ b/include/boost/afio/v2.0/detail/impl/windows/stat.ipp
@@ -33,6 +33,8 @@ DEALINGS IN THE SOFTWARE.
#include "../../../stat.hpp"
#include "import.hpp"
+#include <winioctl.h> // for DeviceIoControl codes
+
BOOST_AFIO_V2_NAMESPACE_BEGIN
BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat_t::want wanted) noexcept
@@ -47,9 +49,9 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
FILE_ALL_INFORMATION &fai=*(FILE_ALL_INFORMATION *)buffer;
FILE_FS_SECTOR_SIZE_INFORMATION ffssi={0};
- bool needInternal=(wanted&want::ino);
- bool needBasic=((wanted&want::type) || (wanted&want::atim) || (wanted&want::mtim) || (wanted&want::ctim) || (wanted&want::birthtim) || (wanted&want::sparse) || (wanted&want::compressed) || (wanted&want::reparse_point));
- bool needStandard=((wanted&want::nlink) || (wanted&want::size) || (wanted&want::allocated) || (wanted&want::blocks));
+ bool needInternal=!!(wanted&want::ino);
+ bool needBasic=(!!(wanted&want::type) || !!(wanted&want::atim) || !!(wanted&want::mtim) || !!(wanted&want::ctim) || !!(wanted&want::birthtim) || !!(wanted&want::sparse) || !!(wanted&want::compressed) || !!(wanted&want::reparse_point));
+ bool needStandard=(!!(wanted&want::nlink) || !!(wanted&want::size) || !!(wanted&want::allocated) || !!(wanted&want::blocks));
// It's not widely known that the NT kernel supplies a stat() equivalent i.e. get me everything in a single syscall
// However fetching FileAlignmentInformation which comes with FILE_ALL_INFORMATION is slow as it touches the device driver,
// so only use if we need more than one item
@@ -59,7 +61,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
if(STATUS_PENDING == ntstat)
ntstat = ntwait(h.native_handle().h, isb, deadline());
if(ntstat)
- return make_errored_result_nt<size_t>(ntstat, last190(h.path()));
+ return make_errored_result_nt<size_t>(ntstat, last190(h.path().u8string()));
}
else
{
@@ -69,7 +71,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
if(STATUS_PENDING == ntstat)
ntstat = ntwait(h.native_handle().h, isb, deadline());
if(ntstat)
- return make_errored_result_nt<size_t>(ntstat, last190(h.path()));
+ return make_errored_result_nt<size_t>(ntstat, last190(h.path().u8string()));
}
if(needBasic)
{
@@ -78,7 +80,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
if(STATUS_PENDING == ntstat)
ntstat = ntwait(h.native_handle().h, isb, deadline());
if(ntstat)
- return make_errored_result_nt<size_t>(ntstat, last190(h.path()));
+ return make_errored_result_nt<size_t>(ntstat, last190(h.path().u8string()));
}
if(needStandard)
{
@@ -87,7 +89,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
if(STATUS_PENDING == ntstat)
ntstat = ntwait(h.native_handle().h, isb, deadline());
if(ntstat)
- return make_errored_result_nt<size_t>(ntstat, last190(h.path()));
+ return make_errored_result_nt<size_t>(ntstat, last190(h.path().u8string()));
}
}
if((wanted&want::blocks) || (wanted&want::blksize))
@@ -97,7 +99,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
if(STATUS_PENDING == ntstat)
ntstat = ntwait(h.native_handle().h, isb, deadline());
if(ntstat)
- return make_errored_result_nt<size_t>(ntstat, last190(h.path()));
+ return make_errored_result_nt<size_t>(ntstat, last190(h.path().u8string()));
}
// FIXME: Implement st_dev for Windows somehow
@@ -109,12 +111,12 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC result<size_t> stat_t::fill(handle &h, stat
// We need to get its reparse tag to see if it's a symlink
if(fai.BasicInformation.FileAttributes&FILE_ATTRIBUTE_REPARSE_POINT && !ReparsePointTag)
{
- align_as(8) char buffer[sizeof(REPARSE_DATA_BUFFER)+32769];
+ alignas(8) char buffer_[sizeof(REPARSE_DATA_BUFFER)+32769];
DWORD written=0;
- REPARSE_DATA_BUFFER *rpd=(REPARSE_DATA_BUFFER *) buffer;
+ REPARSE_DATA_BUFFER *rpd=(REPARSE_DATA_BUFFER *) buffer_;
memset(rpd, 0, sizeof(*rpd));
- if(!DeviceIoControl(h.native_handle().h, FSCTL_GET_REPARSE_POINT, NULL, 0, rpd, sizeof(buffer), &written, NULL))
- return make_errored_result<size_t>(GetLastError(), last190(h.path()));
+ if(!DeviceIoControl(h.native_handle().h, FSCTL_GET_REPARSE_POINT, NULL, 0, rpd, sizeof(buffer_), &written, NULL))
+ return make_errored_result<size_t>(GetLastError(), last190(h.path().u8string()));
ReparsePointTag=rpd->ReparseTag;
}
st_type=windows_nt_kernel::to_st_type(fai.BasicInformation.FileAttributes, ReparsePointTag); ++ret;
diff --git a/include/boost/afio/v2.0/file_handle.hpp b/include/boost/afio/v2.0/file_handle.hpp
index 521760aa..bdc50e07 100644
--- a/include/boost/afio/v2.0/file_handle.hpp
+++ b/include/boost/afio/v2.0/file_handle.hpp
@@ -98,7 +98,7 @@ protected:
public:
//! Default constructor
- file_handle()
+ constexpr file_handle()
: io_handle()
, _devid(0)
, _inode(0)
@@ -109,7 +109,7 @@ public:
file_handle(native_handle_type h, dev_t devid, ino_t inode, path_type path, caching caching = caching::none, flag flags = flag::none)
: io_handle(std::move(h), std::move(caching), std::move(flags))
, _devid(devid)
- , _inod(inode)
+ , _inode(inode)
, _path(std::move(path))
, _service(nullptr)
{
@@ -118,16 +118,6 @@ public:
file_handle(file_handle &&o) noexcept : io_handle(std::move(o)), _devid(o._devid), _inode(o._inode), _path(std::move(o._path)), _service(o._service) { o._devid = 0; o._inode = 0; o._service = nullptr; }
//! Explicit conversion from handle and io_handle permitted
explicit file_handle(handle &&o, path_type path, dev_t devid, ino_t inode) noexcept : io_handle(std::move(o)), _devid(devid), _inode(inode), _path(std::move(path)), _service(nullptr) {}
- using io_handle::really_copy;
- //! Copy the handle. Tag enabled because copying handles is expensive (fd duplication).
- explicit file_handle(const file_handle &o, really_copy _)
- : io_handle(o, _)
- , _devid(o._devid)
- , _inode(o._inode)
- , _path(o._path)
- , _service(o._service)
- {
- }
//! Move assignment of file_handle permitted
file_handle &operator=(file_handle &&o) noexcept
{
diff --git a/include/boost/afio/v2.0/handle.hpp b/include/boost/afio/v2.0/handle.hpp
index 90563421..0492f84f 100644
--- a/include/boost/afio/v2.0/handle.hpp
+++ b/include/boost/afio/v2.0/handle.hpp
@@ -170,23 +170,31 @@ public:
{
}
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC ~handle();
- //! Move the handle. Explicit because this will lose information in any derived source.
- explicit handle(handle &&o) noexcept : _caching(o._caching), _flags(o._flags), _v(std::move(o._v))
+ //! No copy construction (use clone())
+ handle(const handle &) = delete;
+ //! No copy assignment
+ handle &operator=(const handle &o) = delete;
+ //! Move the handle.
+ handle(handle &&o) noexcept : _caching(o._caching), _flags(o._flags), _v(std::move(o._v))
{
o._caching = caching::none;
o._flags = flag::none;
o._v = native_handle_type();
}
- //! Tag type to enable copy constructor
- struct really_copy
+ //! Move assignment of handle
+ handle &operator=(handle &&o) noexcept
{
- };
- //! Copy the handle. Tag enabled because copying handles is expensive (fd duplication).
- explicit handle(const handle &o, really_copy);
- //! No move assignment
- handle &operator=(handle &&o) = delete;
- //! No copy assignment
- handle &operator=(const handle &o) = delete;
+ this->~handle();
+ new(this) handle(std::move(o));
+ return *this;
+ }
+ //! Swap with another instance
+ void swap(handle &o) noexcept
+ {
+ handle temp(std::move(*this));
+ *this = std::move(o);
+ o = std::move(temp);
+ }
//! A unique identifier for this handle in this process (native handle). Subclasses like `file_handle` make this a unique identifier across the entire system.
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC unique_id_type unique_id() const noexcept { unique_id_type ret(nullptr); ret.as_longlongs[0] = _v._init; return ret; }
@@ -194,6 +202,11 @@ public:
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC path_type path() const noexcept { return path_type(); }
//! Immediately close the native handle type managed by this handle
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC result<void> close() noexcept;
+ /*! Clone this handle (copy constructor is disabled to avoid accidental copying)
+
+ \errors Any of the values POSIX dup() or DuplicateHandle() can return.
+ */
+ result<handle> clone() const noexcept;
//! Release the native handle type managed by this handle
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC native_handle_type release() noexcept
{
@@ -393,12 +406,10 @@ public:
}
//! Explicit conversion from handle permitted
explicit io_handle(handle &&o) noexcept : handle(std::move(o)) {}
- using handle::really_copy;
- //! Copy the handle. Tag enabled because copying handles is expensive (fd duplication).
- explicit io_handle(const io_handle &o, really_copy _)
- : handle(o, _)
- {
- }
+ //! Move construction permitted
+ io_handle(io_handle &&) = default;
+ //! Move assignment permitted
+ io_handle &operator=(io_handle &&) = default;
/*! \brief Read data from the open handle.
diff --git a/include/boost/afio/v2.0/stat.hpp b/include/boost/afio/v2.0/stat.hpp
index 3206ad7c..47ec3bf1 100644
--- a/include/boost/afio/v2.0/stat.hpp
+++ b/include/boost/afio/v2.0/stat.hpp
@@ -71,36 +71,36 @@ with compression enabled (e.g. ZFS with ZLE compression which elides runs of zer
*/
struct stat_t
{
- uint64_t st_dev; /*!< inode of device containing file (POSIX only) */
- uint64_t st_ino; /*!< inode of file (Windows, POSIX) */
- filesystem::file_type st_type; /*!< type of file (Windows, POSIX) */
+ uint64_t st_dev; /*!< inode of device containing file (POSIX only) */
+ uint64_t st_ino; /*!< inode of file (Windows, POSIX) */
+ stl1z::filesystem::file_type st_type; /*!< type of file (Windows, POSIX) */
#ifndef _WIN32
#ifndef DOXYGEN_SHOULD_SKIP_THIS
uint16_t st_perms;
#else
- filesystem::perms st_perms; /*!< uint16_t bitfield perms of file (POSIX only) */
+ stil1z::filesystem::perms st_perms; /*!< uint16_t bitfield perms of file (POSIX only) */
#endif
#endif
- int16_t st_nlink; /*!< number of hard links (Windows, POSIX) */
+ int16_t st_nlink; /*!< number of hard links (Windows, POSIX) */
#ifndef _WIN32
- int16_t st_uid; /*!< user ID of the file (POSIX only) */
- int16_t st_gid; /*!< group ID of the file (POSIX only) */
- dev_t st_rdev; /*!< id of file if special (POSIX only) */
+ int16_t st_uid; /*!< user ID of the file (POSIX only) */
+ int16_t st_gid; /*!< group ID of the file (POSIX only) */
+ dev_t st_rdev; /*!< id of file if special (POSIX only) */
#endif
- chrono::system_clock::time_point st_atim; /*!< time of last access (Windows, POSIX) */
- chrono::system_clock::time_point st_mtim; /*!< time of last data modification (Windows, POSIX) */
- chrono::system_clock::time_point st_ctim; /*!< time of last status change (Windows, POSIX) */
- handle::extent_type st_size; /*!< file size, in bytes (Windows, POSIX) */
- handle::extent_type st_allocated; /*!< bytes allocated for file (Windows, POSIX) */
- handle::extent_type st_blocks; /*!< number of blocks allocated (Windows, POSIX) */
- uint16_t st_blksize; /*!< block size used by this device (Windows, POSIX) */
- uint32_t st_flags; /*!< user defined flags for file (FreeBSD, OS X, zero otherwise) */
- uint32_t st_gen; /*!< file generation number (FreeBSD, OS X, zero otherwise)*/
- chrono::system_clock::time_point st_birthtim; /*!< time of file creation (Windows, FreeBSD, OS X, zero otherwise) */
-
- unsigned st_sparse : 1; /*!< if this file is sparse, or this directory capable of sparse files (Windows, POSIX) */
- unsigned st_compressed : 1; /*!< if this file is compressed, or this directory capable of compressed files (Windows) */
- unsigned st_reparse_point : 1; /*!< if this file or directory is a reparse point (Windows) */
+ stl11::chrono::system_clock::time_point st_atim; /*!< time of last access (Windows, POSIX) */
+ stl11::chrono::system_clock::time_point st_mtim; /*!< time of last data modification (Windows, POSIX) */
+ stl11::chrono::system_clock::time_point st_ctim; /*!< time of last status change (Windows, POSIX) */
+ handle::extent_type st_size; /*!< file size, in bytes (Windows, POSIX) */
+ handle::extent_type st_allocated; /*!< bytes allocated for file (Windows, POSIX) */
+ handle::extent_type st_blocks; /*!< number of blocks allocated (Windows, POSIX) */
+ uint16_t st_blksize; /*!< block size used by this device (Windows, POSIX) */
+ uint32_t st_flags; /*!< user defined flags for file (FreeBSD, OS X, zero otherwise) */
+ uint32_t st_gen; /*!< file generation number (FreeBSD, OS X, zero otherwise)*/
+ stl11::chrono::system_clock::time_point st_birthtim; /*!< time of file creation (Windows, FreeBSD, OS X, zero otherwise) */
+
+ unsigned st_sparse : 1; /*!< if this file is sparse, or this directory capable of sparse files (Windows, POSIX) */
+ unsigned st_compressed : 1; /*!< if this file is compressed, or this directory capable of compressed files (Windows) */
+ unsigned st_reparse_point : 1; /*!< if this file or directory is a reparse point (Windows) */
//! Used to indicate what metadata should be filled in
BOOSTLITE_BITFIELD_BEGIN(want) {
@@ -129,15 +129,15 @@ struct stat_t
}
BOOSTLITE_BITFIELD_END(want)
//! Constructs a UNINITIALIZED instance i.e. full of random garbage
- constexpr stat_t() noexcept { }
+ stat_t() noexcept { }
//! Constructs a zeroed instance
constexpr stat_t(std::nullptr_t) noexcept :
st_dev(0),
st_ino(0),
#ifdef BOOST_AFIO_USE_LEGACY_FILESYSTEM_SEMANTICS
- st_type(filesystem::file_type::type_unknown),
+ st_type(stl1z::filesystem::file_type::type_unknown),
#else
- st_type(filesystem::file_type::unknown),
+ st_type(stl1z::filesystem::file_type::unknown),
#endif
#ifndef _WIN32
st_perms(0),
@@ -150,7 +150,7 @@ struct stat_t
#ifdef __cpp_exceptions
//! Constructs a filled instance, throwing as an exception any error which might occur
stat_t(handle &h, want wanted = want::all)
- : statfs_t()
+ : stat_t()
{
auto v(fill(h, wanted));
if(v.has_error())
diff --git a/test/kerneltest b/test/kerneltest
-Subproject c6f9b348168e6478b4d99b4211827affeda6734
+Subproject 6c4ecff5a65af9808a51f16fde4e576a4304c93