blob: 5c2a2f08317cf7671a0fd4772afb1496da022c30 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00002Copyright (c) 2000, BeOpen.com.
3Copyright (c) 1995-2000, Corporation for National Research Initiatives.
4Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
5All rights reserved.
Guido van Rossumf70e43a1991-02-19 12:39:46 +00006
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00007See the file "Misc/COPYRIGHT" for information on usage and
8redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumf70e43a1991-02-19 12:39:46 +00009******************************************************************/
10
Guido van Rossum3d54f2d1990-11-02 17:51:17 +000011/* PD implementation of strerror() for systems that don't have it.
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000012 Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */
13
14#include <stdio.h>
15
16extern int sys_nerr;
17extern char *sys_errlist[];
18
19char *
20strerror(err)
21 int err;
22{
23 static char buf[20];
24 if (err >= 0 && err < sys_nerr)
25 return sys_errlist[err];
26 sprintf(buf, "Unknown errno %d", err);
27 return buf;
28}
Guido van Rossum3d54f2d1990-11-02 17:51:17 +000029
Guido van Rossum1d5735e1994-08-30 08:27:36 +000030#ifdef macintosh
Guido van Rossum3d54f2d1990-11-02 17:51:17 +000031int sys_nerr = 0;
32char *sys_errlist[1] = 0;
33#endif