1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

[! HAVE_STRERROR] (strerror): Define the function.

This commit is contained in:
Roland McGrath 1994-01-08 22:27:30 +00:00
parent e773d20a7b
commit 2771160004
3 changed files with 45 additions and 0 deletions

View File

@ -282,3 +282,18 @@ main (argc, argv)
#endif /* HAVE_SYSVIPC */
#endif /* HAVE_SOCKETS or HAVE_SYSVIPC */
#ifndef HAVE_STRERROR
char *
strerror (errnum)
int errnum;
{
extern char *sys_errlist[];
extern int sys_nerr;
if (errnum >= 0 && errnum < sys_nerr)
return sys_errlist[errnum];
return (char *) "Unknown error";
}
#endif /* ! HAVE_STRERROR */

View File

@ -333,3 +333,18 @@ myindex (str, c)
}
return 0;
}
#ifndef HAVE_STRERROR
char *
strerror (errnum)
int errnum;
{
extern char *sys_errlist[];
extern int sys_nerr;
if (errnum >= 0 && errnum < sys_nerr)
return sys_errlist[errnum];
return (char *) "Unknown error";
}
#endif /* ! HAVE_STRERROR */

View File

@ -300,5 +300,20 @@ main (argc, argv)
for (;;)
pause ();
}
#ifndef HAVE_STRERROR
char *
strerror (errnum)
int errnum;
{
extern char *sys_errlist[];
extern int sys_nerr;
if (errnum >= 0 && errnum < sys_nerr)
return sys_errlist[errnum];
return (char *) "Unknown error";
}
#endif /* ! HAVE_STRERROR */
/* timer.c ends here */