ffmpeg-6: fix COMPONENT_REVISION
[oi-userland.git] / components / python / python27 / patches / 01-ext-stdio.patch
blob28a082f4078d0a5b1ae766e7e1ebf44c9fbc8acf
1 --- Python-2.7.1/Modules/python.c.orig Tue Jun 21 21:35:45 2011
2 +++ Python-2.7.1/Modules/python.c Tue Jun 21 21:39:29 2011
3 @@ -6,6 +6,13 @@
4 #include <floatingpoint.h>
5 #endif
7 +#if defined(sun) && defined(__SVR4) && !defined(_LP64)
8 +#define USE_EXTENDED_FILE_STDIO 1
9 +#include <stdio.h>
10 +#include <stdio_ext.h>
11 +#include <signal.h>
12 +#endif
14 int
15 main(int argc, char **argv)
17 @@ -20,5 +27,18 @@
18 m = fpgetmask();
19 fpsetmask(m & ~FP_X_OFL);
20 #endif
21 +#ifdef USE_EXTENDED_FILE_STDIO
22 + /*
23 + * enable extended FILE facility on Solaris so that Python
24 + * apps can keep more than 256 file descriptors open
25 + */
26 + struct rlimit rlp;
27 + (void) getrlimit(RLIMIT_NOFILE, &rlp);
28 + rlp.rlim_cur = rlp.rlim_max;
29 + if (setrlimit(RLIMIT_NOFILE, &rlp) != -1) {
30 + enable_extended_FILE_stdio(-1, 0);
31 + }
32 +#endif
34 return Py_Main(argc, argv);