OSDN Git Service

* resource.cc (getrlimit): Return getdtablesize () as current limit
authorcorinna <corinna>
Thu, 16 Aug 2001 14:29:21 +0000 (14:29 +0000)
committercorinna <corinna>
Thu, 16 Aug 2001 14:29:21 +0000 (14:29 +0000)
        on RLIMIT_NOFILE.
        * syscalls.cc (getdtablesize): Return OPEN_MAX if current dtable size
        is less than OPEN_MAX, the current dtable size otherwise.
        * sysconf.cc (sysconf): Return getdtablesize () on _SC_OPEN_MAX.

winsup/cygwin/ChangeLog
winsup/cygwin/resource.cc
winsup/cygwin/syscalls.cc
winsup/cygwin/sysconf.cc

index c3df032..aa9c154 100644 (file)
@@ -1,3 +1,11 @@
+Thu Aug 16 16:26:00 2001  Corinna Vinschen <corinna@vinschen.de>
+
+       * resource.cc (getrlimit): Return getdtablesize () as current limit
+       on RLIMIT_NOFILE.
+       * syscalls.cc (getdtablesize): Return OPEN_MAX if current dtable size
+       is less than OPEN_MAX, the current dtable size otherwise.
+       * sysconf.cc (sysconf): Return getdtablesize () on _SC_OPEN_MAX.
+
 Thu Aug 16 16:17:00 2001  Corinna Vinschen <corinna@vinschen.de>
 
        * resource.cc (getrlimit): Return OPEN_MAX as current limit
index 3ee6c57..84ab9fe 100644 (file)
@@ -120,7 +120,7 @@ getrlimit (int resource, struct rlimit *rlp)
     case RLIMIT_STACK:
       break;
     case RLIMIT_NOFILE:
-      rlp->rlim_cur = OPEN_MAX;
+      rlp->rlim_cur = getdtablesize ();
       break;
     case RLIMIT_CORE:
       rlp->rlim_cur = rlim_core;
index 8e34825..936fd59 100644 (file)
@@ -1445,7 +1445,7 @@ setdtablesize (int size)
 extern "C" int
 getdtablesize ()
 {
-  return OPEN_MAX;
+  return cygheap->fdtab.size > OPEN_MAX ? cygheap->fdtab.size : OPEN_MAX;
 }
 
 extern "C" size_t
index 5c930fb..5ffb037 100644 (file)
@@ -33,7 +33,7 @@ sysconf (int in)
        /* FIXME: what's the right value?  _POSIX_ARG_MAX is only 4K */
        return 1048576;
       case _SC_OPEN_MAX:
-       return OPEN_MAX;
+       return getdtablesize ();
       case _SC_PAGESIZE:
        return getpagesize ();
       case _SC_CLK_TCK: