bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 05/13] getdtablesize: do not use getrlimit() on OS/2 kLIBC


From: KO Myung-Hun
Subject: [PATCH v3 05/13] getdtablesize: do not use getrlimit() on OS/2 kLIBC
Date: Mon, 19 Jan 2015 13:47:11 +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 59b9736..b4f23a1 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]