1907
|
1 |
This patch provides extended file stdio support.
|
|
2 |
As it is Solaris-specific, it is not suitable for upstream.
|
|
3 |
Note that this patch is no longer needed, since is we build Python 3 64-bit
|
|
4 |
only, but we are keeping it around as a precaution in case we need to add
|
|
5 |
32-bit support back in at some point. If a time comes when we are certain
|
|
6 |
we will never need 32-bit support, then the patch can be removed.
|
|
7 |
|
|
8 |
--- Python-3.4.0/Modules/python.c.~1~ 2014-03-16 19:31:31.000000000 -0700
|
|
9 |
+++ Python-3.4.0/Modules/python.c 2014-03-17 11:08:20.154195402 -0700
|
|
10 |
@@ -15,6 +15,13 @@
|
|
11 |
}
|
|
12 |
#else
|
|
13 |
|
|
14 |
+#if defined(sun) && defined(__SVR4) && !defined(_LP64)
|
|
15 |
+#define USE_EXTENDED_FILE_STDIO 1
|
|
16 |
+#include <stdio.h>
|
|
17 |
+#include <stdio_ext.h>
|
|
18 |
+#include <signal.h>
|
|
19 |
+#endif
|
|
20 |
+
|
|
21 |
int
|
|
22 |
main(int argc, char **argv)
|
|
23 |
{
|
|
24 |
@@ -44,6 +51,19 @@
|
|
25 |
fpsetmask(m & ~FP_X_OFL);
|
|
26 |
#endif
|
|
27 |
|
|
28 |
+#ifdef USE_EXTENDED_FILE_STDIO
|
|
29 |
+ /*
|
|
30 |
+ * enable extended FILE facility on Solaris so that Python
|
|
31 |
+ * apps can keep more than 256 file descriptors open
|
|
32 |
+ */
|
|
33 |
+ struct rlimit rlp;
|
|
34 |
+ (void) getrlimit(RLIMIT_NOFILE, &rlp);
|
|
35 |
+ rlp.rlim_cur = rlp.rlim_max;
|
|
36 |
+ if (setrlimit(RLIMIT_NOFILE, &rlp) != -1) {
|
|
37 |
+ enable_extended_FILE_stdio(-1, 0);
|
|
38 |
+ }
|
|
39 |
+#endif
|
|
40 |
+
|
|
41 |
oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
|
|
42 |
if (!oldloc) {
|
|
43 |
fprintf(stderr, "out of memory\n");
|