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.
+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
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.
#include "winsup.h"
#include <errno.h>
#include <unistd.h>
+#include <limits.h>
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
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;
extern "C" int
getdtablesize ()
{
- return cygheap->fdtab.size;
+ return OPEN_MAX;
}
extern "C" size_t
/* 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: