Staging
v0.5.1
https://github.com/python/cpython
Revision da79389f100366a4e221e30b45da6f33e6f8ec34 authored by Ka-Ping Yee on 13 April 2001, 11:02:51 UTC, committed by Ka-Ping Yee on 13 April 2001, 11:02:51 UTC
1 parent 79c009d
Raw File
Tip revision: da79389f100366a4e221e30b45da6f33e6f8ec34 authored by Ka-Ping Yee on 13 April 2001, 11:02:51 UTC
Word-wrap the list of cross-references.
Tip revision: da79389
strerror.c

/* PD implementation of strerror() for systems that don't have it.
   Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */

#include <stdio.h>

extern int sys_nerr;
extern char *sys_errlist[];

char *
strerror(int err)
{
	static char buf[20];
	if (err >= 0 && err < sys_nerr)
		return sys_errlist[err];
	sprintf(buf, "Unknown errno %d", err);
	return buf;
}

#ifdef macintosh
int sys_nerr = 0;
char *sys_errlist[1] = 0;
#endif
back to top