Mercurial > cpython-lru_cache-weakref
annotate Python/strerror.c @ 14674:756c8c6535fe legacy-trunk
Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.
Changes include:
- There's a --with-pth configure option.
- Instead of _GNU_PTH, we test for HAVE_PTH.
- Better signal handling.
- (The config.h.in file is regenerated in a slightly different order.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 19 Sep 2000 00:46:46 +0000 |
| parents | 6f6f965c5e2d |
| children | 379fc66f4c96 |
| rev | line source |
|---|---|
| 145 | 1 |
|
61
5c4dd9348e81
Added provision for THINK C which doesn't have sys_nerrors or sys_errlist.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
2 /* PD implementation of strerror() for systems that don't have it. |
| 6 | 3 Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */ |
| 4 | |
| 5 #include <stdio.h> | |
| 6 | |
| 7 extern int sys_nerr; | |
| 8 extern char *sys_errlist[]; | |
| 9 | |
| 10 char * | |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
13256
diff
changeset
|
11 strerror(int err) |
| 6 | 12 { |
| 13 static char buf[20]; | |
| 14 if (err >= 0 && err < sys_nerr) | |
| 15 return sys_errlist[err]; | |
| 16 sprintf(buf, "Unknown errno %d", err); | |
| 17 return buf; | |
| 18 } | |
|
61
5c4dd9348e81
Added provision for THINK C which doesn't have sys_nerrors or sys_errlist.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
19 |
|
1848
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
20 #ifdef macintosh |
|
61
5c4dd9348e81
Added provision for THINK C which doesn't have sys_nerrors or sys_errlist.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
21 int sys_nerr = 0; |
|
5c4dd9348e81
Added provision for THINK C which doesn't have sys_nerrors or sys_errlist.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
22 char *sys_errlist[1] = 0; |
|
5c4dd9348e81
Added provision for THINK C which doesn't have sys_nerrors or sys_errlist.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
23 #endif |
