1 // Copyright (C) 2006 Matthew Gregan <kinetik@.orcon.net.nz>
2 //
3 // This program is made available under the GNU GPL version 2.0 or
4 // greater. See the accompanying file COPYING for details.
5 //
6 // This program is distributed WITHOUT ANY WARRANTY; without even the
7 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE.
9 
10 #include "../base.hh"
11 #include <string.h>
12 
13 #include "../sanity.hh"
14 #include "../platform.hh"
15 
16 std::string
os_strerror(os_err_t errnum)17 os_strerror(os_err_t errnum)
18 {
19   char* msg = strerror(errnum);
20   if (msg == 0)
21     return (F("unknown error code %d") % errnum).str();
22   return std::string(msg);
23 }
24 
25 // Local Variables:
26 // mode: C++
27 // fill-column: 76
28 // c-file-style: "gnu"
29 // indent-tabs-mode: nil
30 // End:
31 // vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
32