* 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:
parent
3171175e90
commit
1457739a63
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue