mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
Initial revision
This commit is contained in:
parent
c636014c43
commit
85a5fbbdfe
78 changed files with 13589 additions and 0 deletions
18
Python/strerror.c
Normal file
18
Python/strerror.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* PD implementation of strerror() for BSD derivatives 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(err)
|
||||
int err;
|
||||
{
|
||||
static char buf[20];
|
||||
if (err >= 0 && err < sys_nerr)
|
||||
return sys_errlist[err];
|
||||
sprintf(buf, "Unknown errno %d", err);
|
||||
return buf;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue