History

add hg and python

cinap_lenrek committed 15 years ago

Commit 4bb9e221 parent 987265c3706 files · +1228772 −-233Browse files

Showing the changes to sys/src/cmd/python/Python/strerror.c (1 of 3706 files). Show all

Unified · Split

sys/src/cmd/python/Python/strerror.c+19−0
@@ -0,0 +1,19 @@
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+
8+extern int sys_nerr;
9+extern char *sys_errlist[];
10+
11+char *
12+strerror(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+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t