Blame missing_d/strerror.c
|
Packit |
575503 |
/* strerror.c --- ANSI C compatible system error routine
|
|
Packit |
575503 |
|
|
Packit |
575503 |
Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
This program is free software; you can redistribute it and/or modify
|
|
Packit |
575503 |
it under the terms of the GNU General Public License as published by
|
|
Packit |
575503 |
the Free Software Foundation; either version 2, or (at your option)
|
|
Packit |
575503 |
any later version.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
This program is distributed in the hope that it will be useful,
|
|
Packit |
575503 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
575503 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
575503 |
GNU General Public License for more details.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
You should have received a copy of the GNU General Public License
|
|
Packit |
575503 |
along with this program; if not, write to the Free Software Foundation,
|
|
Packit |
575503 |
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
Packit |
575503 |
|
|
Packit |
575503 |
#if 0
|
|
Packit |
575503 |
#include <stdio.h>
|
|
Packit |
575503 |
#endif
|
|
Packit |
575503 |
|
|
Packit |
575503 |
extern int sys_nerr;
|
|
Packit |
575503 |
extern char *sys_errlist[];
|
|
Packit |
575503 |
|
|
Packit |
575503 |
char *
|
|
Packit |
575503 |
strerror(n)
|
|
Packit |
575503 |
int n;
|
|
Packit |
575503 |
{
|
|
Packit |
575503 |
static char mesg[30];
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if (n < 0 || n >= sys_nerr) {
|
|
Packit |
575503 |
sprintf(mesg, "Unknown error (%d)", n);
|
|
Packit |
575503 |
return mesg;
|
|
Packit |
575503 |
} else
|
|
Packit |
575503 |
return sys_errlist[n];
|
|
Packit |
575503 |
}
|