[Top][All Lists]

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

[PATCH 14/21] getdtablesize: do not use getrlimit() on OS/2 kLIBC

From: KO Myung-Hun
Subject: [PATCH 14/21] getdtablesize: do not use getrlimit() on OS/2 kLIBC
Date: Sun, 30 Nov 2014 13:20:16 +0900

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
 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)
+#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;
   return getdtablesize ();

reply via email to

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