diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-08-16 18:29:21 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-08-16 18:29:21 +0400 |
commit | 1457739a6335f150e6ca015fae725838150f0bf9 (patch) | |
tree | ea7f0155d641389b41a104b0ec035cbf8cdaab4f | |
parent | 3171175e90d908fd5be0da43af7aa427701d45b6 (diff) |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/resource.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/sysconf.cc | 2 |
4 files changed, 11 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c3df032d4..aa9c1540f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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 diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc index 3ee6c57da..84ab9feaa 100644 --- a/winsup/cygwin/resource.cc +++ b/winsup/cygwin/resource.cc @@ -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; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 8e34825e2..936fd596c 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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 diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc index 5c930fb22..5ffb03789 100644 --- a/winsup/cygwin/sysconf.cc +++ b/winsup/cygwin/sysconf.cc @@ -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: |