Staging
v0.8.1
https://github.com/python/cpython
Revision 71e2aa0cc5c07a4e15a48c35739f34d5ab69d26c authored by Neal Norwitz on 11 September 2006, 04:01:57 UTC, committed by Neal Norwitz on 11 September 2006, 04:01:57 UTC
Anonymous structure fields that have a bit-width specified did not work,
and they gave a strange error message from PyArg_ParseTuple:
   function takes exactly 2 arguments (3 given).
1 parent 19d76c5
Raw File
Tip revision: 71e2aa0cc5c07a4e15a48c35739f34d5ab69d26c authored by Neal Norwitz on 11 September 2006, 04:01:57 UTC
Backport rev 51819 from Thomas Heller
Tip revision: 71e2aa0
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