source: vendor/python/2.5/Python/strerror.c

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 416 bytes
Line 
1
2/* PD implementation of strerror() for systems that don't have it.
3 Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */
4
5#include <stdio.h>
6#include "Python.h"
7
8extern int sys_nerr;
9extern char *sys_errlist[];
10
11char *
12strerror(int err)
13{
14 static char buf[20];
15 if (err >= 0 && err < sys_nerr)
16 return sys_errlist[err];
17 PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err);
18 return buf;
19}
Note: See TracBrowser for help on using the repository browser.