Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / include / xbt / system_error.hpp
1 /* Copyright (c) 2016. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <cerrno>
8
9 #include <system_error>
10
11 #ifndef SIMGRID_MC_SYSTEM_ERROR_HPP
12 #define SIMGRID_MC_SYSTEM_ERROR_HPP
13
14 namespace simgrid {
15 namespace xbt {
16
17 inline
18 const std::error_category& errno_category() noexcept
19 {
20   return std::generic_category();
21 }
22
23 inline
24 std::system_error errno_error(int errnum)
25 {
26   return std::system_error(errnum, errno_category());
27 }
28
29 inline
30 std::system_error errno_error(int errnum, const char* what)
31 {
32   return std::system_error(errnum, errno_category(), what);
33 }
34
35 }
36 }
37
38 #endif