* resource.cc (getrlimit): Return OPEN_MAX as current limit

on RLIMIT_NOFILE.
        * syscalls.cc (getdtablesize): Return OPEN_MAX.
        * sysconf.cc (sysconf): Return OPEN_MAX on _SC_OPEN_MAX.
        * include/limits.h (OPEN_MAX): Define as 256.
This commit is contained in:
Corinna Vinschen 2001-08-16 14:20:09 +00:00
parent 91a1423a87
commit 3171175e90
5 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,11 @@
Thu Aug 16 16:17:00 2001 Corinna Vinschen <corinna@vinschen.de>
* resource.cc (getrlimit): Return OPEN_MAX as current limit
on RLIMIT_NOFILE.
* syscalls.cc (getdtablesize): Return OPEN_MAX.
* sysconf.cc (sysconf): Return OPEN_MAX on _SC_OPEN_MAX.
* include/limits.h (OPEN_MAX): Define as 256.
Wed Aug 15 12:43:00 2001 Corinna Vinschen <corinna@vinschen.de>
* times.cc (utimes): Revert previous change. Just open the

View File

@ -122,6 +122,13 @@ details. */
This limits how many children we can fork/spawn off. */
#define CHILD_MAX 63
/* # of open files per process. Actually it can be more since Cygwin
grows the dtable as necessary. We define a reasonable limit here
which is returned by getdtablesize(), sysconf(_SC_OPEN_MAX) and
getrlimit(RLIMIT_NOFILE). */
#undef OPEN_MAX
#define OPEN_MAX 256
/* POSIX values */
/* These should never vary from one system type to another */
/* They represent the minimum values that POSIX systems must support.

View File

@ -15,6 +15,7 @@ details. */
#include "winsup.h"
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
@ -117,7 +118,9 @@ getrlimit (int resource, struct rlimit *rlp)
case RLIMIT_FSIZE:
case RLIMIT_DATA:
case RLIMIT_STACK:
break;
case RLIMIT_NOFILE:
rlp->rlim_cur = OPEN_MAX;
break;
case RLIMIT_CORE:
rlp->rlim_cur = rlim_core;

View File

@ -1445,7 +1445,7 @@ setdtablesize (int size)
extern "C" int
getdtablesize ()
{
return cygheap->fdtab.size;
return OPEN_MAX;
}
extern "C" size_t

View File

@ -33,10 +33,7 @@ sysconf (int in)
/* FIXME: what's the right value? _POSIX_ARG_MAX is only 4K */
return 1048576;
case _SC_OPEN_MAX:
/* FIXME: this returns the current limit which can increase
if and when dtable::find_unused_handle is called. Perhaps
we should return NOFILE or OPEN_MAX instead? */
return cygheap->fdtab.size;
return OPEN_MAX;
case _SC_PAGESIZE:
return getpagesize ();
case _SC_CLK_TCK: