getrlimit() was implemented in kLIBC and works well. Strangely,
however, it crashes due to 'stack overflow' or 'SIGSEGV' when used in
GNU M4. So just use getdtablesize().
* lib/getdtablesize.c (rpl_getdtablesize): Do not use getrlimit() on
OS/2 kLIBC.
---
lib/getdtablesize.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index f0c6271..bd4932f 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -92,6 +92,7 @@ getdtablesize (void)
int
rpl_getdtablesize(void)
{
+#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 +102,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