ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.280 by root, Tue Sep 10 02:16:41 2019 UTC vs.
Revision 1.282 by root, Wed Feb 26 15:49:25 2020 UTC

2727 if (0 == setrlimit (RLIMIT_NOFILE, &rl)) 2727 if (0 == setrlimit (RLIMIT_NOFILE, &rl))
2728 XSRETURN_YES; 2728 XSRETURN_YES;
2729 2729
2730 if (errno == EPERM) 2730 if (errno == EPERM)
2731 { 2731 {
2732 /* setlimit failed with EPERM - maybe we can't raise the hardlimit, or maybe */ 2732 /* setrlimit failed with EPERM - maybe we can't raise the hardlimit, or maybe */
2733 /* our limit overflows a system-wide limit */ 2733 /* our limit overflows a system-wide limit */
2734 /* try an adaptive algorithm, but do not lower the hardlimit */ 2734 /* try an adaptive algorithm, but do not lower the hardlimit */
2735 rl.rlim_max = 0; 2735 rl.rlim_max = 0;
2736 for (bit = 0x40000000U; bit; bit >>= 1) 2736 for (bit = 0x40000000U; bit; bit >>= 1)
2737 { 2737 {
2738 rl.rlim_max |= bit; 2738 rl.rlim_max |= bit;
2739 rl.rlim_cur = rl.rlim_max; 2739 rl.rlim_cur = rl.rlim_max;
2740 2740
2741 /* nevr decrease the hard limit */ 2741 /* never decrease the hard limit */
2742 if (rl.rlim_max < orig_rlim_max) 2742 if (rl.rlim_max < orig_rlim_max)
2743 break; 2743 break;
2744 2744
2745 if (0 != setrlimit (RLIMIT_NOFILE, &rl)) 2745 if (0 != setrlimit (RLIMIT_NOFILE, &rl))
2746 rl.rlim_max &= ~bit; /* too high, remove bit again */ 2746 rl.rlim_max &= ~bit; /* too high, remove bit again */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines