Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of 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 namespace simgrid {
12 namespace xbt {
13
14 inline
15 const std::error_category& errno_category() noexcept
16 {
17   return std::generic_category();
18 }
19
20 inline
21 std::system_error errno_error(int errnum)
22 {
23   return std::system_error(errnum, errno_category());
24 }
25
26 inline
27 std::system_error errno_error(int errnum, const char* what)
28 {
29   return std::system_error(errnum, errno_category(), what);
30 }
31
32 }
33 }