From 2771160004630733bcf39d020b50f296994ba6aa Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 8 Jan 1994 22:27:30 +0000 Subject: [PATCH] [! HAVE_STRERROR] (strerror): Define the function. --- lib-src/emacsclient.c | 15 +++++++++++++++ lib-src/env.c | 15 +++++++++++++++ lib-src/timer.c | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index b28acb26da0..85d0bdebeb5 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -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 */ diff --git a/lib-src/env.c b/lib-src/env.c index 282a94069df..35532e0360d 100644 --- a/lib-src/env.c +++ b/lib-src/env.c @@ -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 */ diff --git a/lib-src/timer.c b/lib-src/timer.c index 8676b196597..cb7c4c0b2b1 100644 --- a/lib-src/timer.c +++ b/lib-src/timer.c @@ -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 */