blob: acce427b626e46dc2cdfc0a3d766c143812d4bfd [file] [log] [blame]
Brian Silvermanaf784862014-05-13 08:14:55 -07001#ifndef AOS_COMMON_LIBC_AOS_STRERROR_H_
2#define AOS_COMMON_LIBC_AOS_STRERROR_H_
Brian Silverman01be0002014-05-10 15:44:38 -07003
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8// Thread-safe version of strerror(3) (except it may change errno).
9//
Brian Silvermanaf784862014-05-13 08:14:55 -070010// Returns a pointer to static data or a thread-local buffer.
11//
Brian Silverman01be0002014-05-10 15:44:38 -070012// Necessary because strerror_r(3) is such a mess (which version you get is
13// determined at compile time by black magic related to feature macro
14// definitions, compiler flags, glibc version, and even whether you're using g++
15// or clang++) and strerror_l(3) might not work if you end up with the magic
16// LC_GLOBAL_LOCALE locale.
Brian Silvermanaf784862014-05-13 08:14:55 -070017const char *aos_strerror(int error);
Brian Silverman01be0002014-05-10 15:44:38 -070018
19#ifdef __cplusplus
20}
21#endif
22
Brian Silvermanaf784862014-05-13 08:14:55 -070023#endif // AOS_COMMON_LIBC_AOS_STRERROR_H_