source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/errno/strerror.c@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 765 bytes
Line 
1#include <errno.h>
2#include <string.h>
3#include "locale_impl.h"
4#include "libc.h"
5
6#define E(a,b) ((unsigned char)a),
7static const unsigned char errid[] = {
8#include "__strerror.h"
9};
10
11#undef E
12#define E(a,b) b "\0"
13static const char errmsg[] =
14#include "__strerror.h"
15;
16
17char *__strerror_l(int e, locale_t loc)
18{
19 const char *s;
20 int i;
21 /* mips has one error code outside of the 8-bit range due to a
22 * historical typo, so we just remap it. */
23 if (EDQUOT==1133) {
24 if (e==109) e=-1;
25 else if (e==EDQUOT) e=109;
26 }
27 for (i=0; errid[i] && errid[i] != e; i++);
28 for (s=errmsg; i; s++, i--) for (; *s; s++);
29 return (char *)LCTRANS(s, LC_MESSAGES, loc);
30}
31
32char *strerror(int e)
33{
34 return __strerror_l(e, CURRENT_LOCALE);
35}
36
37weak_alias(__strerror_l, strerror_l);
Note: See TracBrowser for help on using the repository browser.