John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame^] | 1 | #ifndef AOS_LIBC_AOS_STRERROR_H_ |
| 2 | #define AOS_LIBC_AOS_STRERROR_H_ |
Brian Silverman | 01be000 | 2014-05-10 15:44:38 -0700 | [diff] [blame] | 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | // Thread-safe version of strerror(3) (except it may change errno). |
| 9 | // |
Brian Silverman | af78486 | 2014-05-13 08:14:55 -0700 | [diff] [blame] | 10 | // Returns a pointer to static data or a thread-local buffer. |
| 11 | // |
Brian Silverman | 01be000 | 2014-05-10 15:44:38 -0700 | [diff] [blame] | 12 | // 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 Silverman | af78486 | 2014-05-13 08:14:55 -0700 | [diff] [blame] | 17 | const char *aos_strerror(int error); |
Brian Silverman | 01be000 | 2014-05-10 15:44:38 -0700 | [diff] [blame] | 18 | |
| 19 | #ifdef __cplusplus |
| 20 | } |
| 21 | #endif |
| 22 | |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame^] | 23 | #endif // AOS_LIBC_AOS_STRERROR_H_ |