* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / missing / strerror.c
blob023935a1ff65ccd52ed37ce650937635a5ad5abe
1 /* public domain rewrite of strerror(3) */
3 extern int sys_nerr;
4 extern char *sys_errlist[];
6 static char msg[50];
8 char *
9 strerror(int error)
11 if (error <= sys_nerr && error > 0) {
12 return sys_errlist[error];
14 sprintf(msg, "Unknown error (%d)", error);
15 return msg;