]> git.proxmox.com Git - ceph.git/blob - ceph/src/common/errno.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / errno.cc
1 #include "common/errno.h"
2 #include "acconfig.h"
3 #include "include/compat.h"
4
5 #include <sstream>
6 #include <string.h>
7
8 std::string cpp_strerror(int err)
9 {
10 char buf[128];
11 char *errmsg;
12
13 if (err < 0)
14 err = -err;
15 std::ostringstream oss;
16
17 errmsg = ceph_strerror_r(err, buf, sizeof(buf));
18
19 oss << "(" << err << ") " << errmsg;
20
21 return oss.str();
22 }