changeset 5527:51451a050975

[! HAVE_STRERROR] (strerror): Define the function.
author Roland McGrath <roland@gnu.org>
date Sat, 08 Jan 1994 22:27:30 +0000
parents 5131e7d642b9
children e9e928d02747
files lib-src/=timer.c lib-src/emacsclient.c lib-src/env.c
diffstat 3 files changed, 45 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/=timer.c	Sat Jan 08 22:06:34 1994 +0000
+++ b/lib-src/=timer.c	Sat Jan 08 22:27:30 1994 +0000
@@ -300,5 +300,20 @@
   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 */
--- a/lib-src/emacsclient.c	Sat Jan 08 22:06:34 1994 +0000
+++ b/lib-src/emacsclient.c	Sat Jan 08 22:27:30 1994 +0000
@@ -282,3 +282,18 @@
 #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 */
--- a/lib-src/env.c	Sat Jan 08 22:06:34 1994 +0000
+++ b/lib-src/env.c	Sat Jan 08 22:27:30 1994 +0000
@@ -333,3 +333,18 @@
     }
   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 */