4 #include "locale_impl.h"
6 /* mips has one error code outside of the 8-bit range due to a
7 * historical typo, so we just remap it. */
9 #define EDQUOT_ORIG 1133
14 static const struct errmsgstr_t
{
15 #define E(n, s) char str##n[sizeof(s)];
16 #include "__strerror.h"
20 #include "__strerror.h"
24 static const unsigned short errmsgidx
[] = {
25 #define E(n, s) [n] = offsetof(struct errmsgstr_t, str##n),
26 #include "__strerror.h"
30 char *__strerror_l(int e
, locale_t loc
)
35 else if (e
==EDQUOT_ORIG
) e
=EDQUOT
;
37 if (e
>= sizeof errmsgidx
/ sizeof *errmsgidx
) e
= 0;
38 s
= (char *)&errmsgstr
+ errmsgidx
[e
];
39 return (char *)LCTRANS(s
, LC_MESSAGES
, loc
);
44 return __strerror_l(e
, CURRENT_LOCALE
);
47 weak_alias(__strerror_l
, strerror_l
);