* 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:
parent
91a1423a87
commit
3171175e90
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1445,7 +1445,7 @@ setdtablesize (int size)
|
|||
extern "C" int
|
||||
getdtablesize ()
|
||||
{
|
||||
return cygheap->fdtab.size;
|
||||
return OPEN_MAX;
|
||||
}
|
||||
|
||||
extern "C" size_t
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue