Bump version to 0.9.1.
[python/dscho.git] / Python / strerror.c
blobfc7f8d193fbcb38e673ceb575301ad265d5923d6
1 /***********************************************************
2 Copyright (c) 2000, BeOpen.com.
3 Copyright (c) 1995-2000, Corporation for National Research Initiatives.
4 Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
5 All rights reserved.
7 See the file "Misc/COPYRIGHT" for information on usage and
8 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9 ******************************************************************/
11 /* PD implementation of strerror() for systems that don't have it.
12 Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */
14 #include <stdio.h>
16 extern int sys_nerr;
17 extern char *sys_errlist[];
19 char *
20 strerror(int err)
22 static char buf[20];
23 if (err >= 0 && err < sys_nerr)
24 return sys_errlist[err];
25 sprintf(buf, "Unknown errno %d", err);
26 return buf;
29 #ifdef macintosh
30 int sys_nerr = 0;
31 char *sys_errlist[1] = 0;
32 #endif