Ruby
2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
missing
strerror.c
Go to the documentation of this file.
1
/* public domain rewrite of strerror(3) */
2
3
#include "
ruby/missing.h
"
4
5
extern
int
sys_nerr
;
6
extern
char
*
sys_errlist
[];
7
8
static
char
msg[50];
9
10
char
*
11
strerror
(
int
error
)
12
{
13
if
(error <= sys_nerr && error > 0) {
14
return
sys_errlist
[
error
];
15
}
16
snprintf
(msg,
sizeof
(msg),
"Unknown error (%d)"
,
error
);
17
return
msg;
18
}
error
const rb_iseq_t const char * error
Definition:
rb_mjit_min_header-2.7.2.h:13471
sys_errlist
char * sys_errlist[]
strerror
char * strerror(int error)
Definition:
strerror.c:11
snprintf
int snprintf(char *__restrict, size_t, const char *__restrict,...) __attribute__((__format__(__printf__
missing.h
sys_nerr
int sys_nerr
Generated by
1.8.20