aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-02-10 18:00:00 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-10-01 20:34:49 +0100
commitd71476c9df931f3ca674941f1942b03eabea010d (patch)
tree33076cef361719f15219ea8cd2b9f32b28996e9c /gcc
parenta09bb4a852f82af02b3f965358cd44b0aa266a5b (diff)
downloadgcc-d71476c9df931f3ca674941f1942b03eabea010d.zip
gcc-d71476c9df931f3ca674941f1942b03eabea010d.tar.gz
gcc-d71476c9df931f3ca674941f1942b03eabea010d.tar.bz2
libstdc++: Add utility for creating std::error_code from OS errors
This adds a helper function to encapsulate obtaining an error code for errors from OS calls. For Windows we want to use GetLastError() and the system error category, but otherwise just use errno and the generic error category. This should not be used to replace existing uses of ec.assign(errno, generic_category()) because in those cases we really do want to get the value of errno, not a system-specific error. Only the cases that currently use GetLastError() are replace by this new function. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * src/filesystem/ops-common.h (last_error): New helper function. (filesystem::do_space): Use last_error(). * src/c++17/fs_ops.cc (fs::absolute, fs::create_hard_link) (fs::equivalent, fs::remove, fs::temp_directory_path): Use last_error(). * src/filesystem/ops.cc (fs::create_hard_link) (fs::remove, fs::temp_directory_path): Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions