Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-07-09 05:33:06 +0400
committerChristopher Faylor <me@cgf.cx>2003-07-09 05:33:06 +0400
commit4d782b426a09120642906e12e21bf669b7bb77db (patch)
tree514a0f6f1034d3bf897b6f7d7c365779fa40c44b /winsup/cygwin/sysconf.cc
parenta42408549f7b286dda7f333b5b977caf67fc1cdd (diff)
* cygheap.cc (creturn): Set appropriate errno when out of memory.
(ccalloc): Only issue system_printf when debugging. * dtable.cc (dtable::extend): Only allocate 100 * the incremental growth size max. Set errno appropriately. (dtable::build_fhandler): Check for error from set_name. * fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM. * fhandler.h (fhandler_base::set_name): Change to bool. * fhandler_process.cc (format_process_stat): Fix formatting. * resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size. * sysconf.cc (sysconf): Ditto.
Diffstat (limited to 'winsup/cygwin/sysconf.cc')
-rw-r--r--winsup/cygwin/sysconf.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc
index 678d978a9..944afdd41 100644
--- a/winsup/cygwin/sysconf.cc
+++ b/winsup/cygwin/sysconf.cc
@@ -35,7 +35,12 @@ sysconf (int in)
case _SC_OPEN_MAX:
return getdtablesize ();
case _SC_PAGESIZE:
- return getpagesize ();
+ {
+ long max = getdtablesize ();
+ if (max < OPEN_MAX)
+ max = OPEN_MAX;
+ return max;
+ }
case _SC_CLK_TCK:
return CLOCKS_PER_SEC;
case _SC_JOB_CONTROL: