How can we know how many bytes were read when calling a synchronous read operation on a random-access device and it throws an exception, for example random_access_file
?
Is this not supported, and to know how many bytes were read, one is supposed to take the boost::system::error_code ec
overload?
error_code ec;
size_t s = a.read_some_at(offset, buffers, ec);
offset += s; // need to be done before unwinding
if (ec) throw system_error(ec);
return s;