* 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.
This commit is contained in:
Corinna Vinschen 2001-08-16 14:29:21 +00:00
parent 3171175e90
commit 1457739a63
4 changed files with 11 additions and 3 deletions

View 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

View 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;

View 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

View 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: