projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
use rt_sigprocmask, not legacy sigprocmask, syscall in pthread exit code
[oweals/musl.git]
/
src
/
errno
/
strerror.c
1
#include <errno.h>
2
#include <string.h>
3
4
#define E(a,b) a,
5
static const unsigned char errid[] = {
6
#include "__strerror.h"
7
};
8
9
#undef E
10
#define E(a,b) b "\0"
11
static const char errmsg[] =
12
#include "__strerror.h"
13
;
14
15
char *strerror(int e)
16
{
17
const char *s;
18
int i;
19
for (i=0; errid[i] && errid[i] != e; i++);
20
for (s=errmsg; i; s++, i--) for (; *s; s++);
21
return (char *)s;
22
}