Staging
v0.5.1
https://github.com/python/cpython
Revision 3873dbd389481659553cb16a51aa2026829769a7 authored by Martin v. Löwis on 13 December 2008, 13:37:28 UTC, committed by Martin v. Löwis on 13 December 2008, 13:37:28 UTC
1 parent 3b9c0f4
Raw File
Tip revision: 3873dbd389481659553cb16a51aa2026829769a7 authored by Martin v. Löwis on 13 December 2008, 13:37:28 UTC
Tagging for release of Python 2.4.6c1
Tip revision: 3873dbd
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>
#include "Python.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];
	PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err);
	return buf;
}
back to top