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