[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/14] getdtablesize: do not use getrlimit() on OS/2 kLIBC
From: |
KO Myung-Hun |
Subject: |
[PATCH 07/14] getdtablesize: do not use getrlimit() on OS/2 kLIBC |
Date: |
Tue, 9 Dec 2014 10:40:52 +0900 |
getrlimit() implementation of kLIBC is buggy. For examples, it crashes
due to 'stack overflow' or 'SIGSEGV' when used in GNU M4. So just use
getdtablesize() on kLIBC.
* lib/getdtablesize.c (rpl_getdtablesize): Do not use getrlimit() on
OS/2 kLIBC.
---
lib/getdtablesize.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index f0c6271..07e9d57 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -92,6 +92,10 @@ getdtablesize (void)
int
rpl_getdtablesize(void)
{
+/* getrlimit() implementation of kLIBC is buggy. For examples, it crashes
+ due to 'stack overflow' or 'SIGSEGV' when used in GNU M4. So just use
+ getdtablesize() on kLIBC. */
+# ifndef __KLIBC__
/* To date, this replacement is only compiled for Cygwin 1.7.25,
which auto-increased the RLIMIT_NOFILE soft limit until it
hits the compile-time constant hard limit of 3200. Although
@@ -101,6 +105,7 @@ rpl_getdtablesize(void)
struct rlimit lim;
if (!getrlimit (RLIMIT_NOFILE, &lim) && lim.rlim_max != RLIM_INFINITY)
return lim.rlim_max;
+# endif
return getdtablesize ();
}
--
1.8.5.2
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, (continued)
[PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX, KO Myung-Hun, 2014/12/08
[PATCH 04/14] binary-io: don't put fd in binary mode if it is a console on EMX, KO Myung-Hun, 2014/12/08
[PATCH 05/14] pipe-filter-aux: undefine HAVE_SELECT on KLIBC, KO Myung-Hun, 2014/12/08
[PATCH 06/14] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 07/14] getdtablesize: do not use getrlimit() on OS/2 kLIBC,
KO Myung-Hun <=
[PATCH 08/14] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 09/14] utimes: detect utimes() correctly on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 10/14] gnulib-tool: fall back into copy if symbolic link is not supported, KO Myung-Hun, 2014/12/08
[PATCH 11/14] pipe_filter_ii_execute: port to OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 12/14] save_cwd: save/restore all CWDs of each drive on EMX, KO Myung-Hun, 2014/12/08
[PATCH 13/14] dup, dup2, fcntl: support a directory fd on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 14/14] opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC, KO Myung-Hun, 2014/12/08