X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/11ca718deb6ce1b2e4eb6978fd5a953b187ad511..9f9eb7fc2dcaeb4e7bdf6b0aaf76fe713e370746:/include/xbt/system_error.hpp diff --git a/include/xbt/system_error.hpp b/include/xbt/system_error.hpp new file mode 100644 index 0000000000..02f508990e --- /dev/null +++ b/include/xbt/system_error.hpp @@ -0,0 +1,33 @@ +/* Copyright (c) 2016. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include + +#include + +namespace simgrid { +namespace xbt { + +inline +const std::error_category& errno_category() noexcept +{ + return std::generic_category(); +} + +inline +std::system_error errno_error(int errnum) noexcept +{ + return std::system_error(errnum, errno_category()); +} + +inline +std::system_error errno_error(int errno, const char* what) +{ + return std::system_error(errnum, errno_category(), what); +} + +} +}