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: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
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;
extern "C" int
getdtablesize ()
{
- return OPEN_MAX;
+ return cygheap->fdtab.size > OPEN_MAX ? cygheap->fdtab.size : OPEN_MAX;
}
extern "C" size_t
/* 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: