]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: getdtablesize: always return OPEN_MAX_MAX
authorKen Brown <kbrown@cornell.edu>
Thu, 28 Jan 2021 01:06:22 +0000 (20:06 -0500)
committerKen Brown <kbrown@cornell.edu>
Mon, 1 Feb 2021 14:55:07 +0000 (09:55 -0500)
commit3d256e22e22d435d13cfecf39c15338cfbd6f587
tree6b485c62fcaa8d60148de9ffbdb47466328de7ee
parent6c1552b0da7c7cdf1cf1668b3706c0d1a14c9b2d
Cygwin: getdtablesize: always return OPEN_MAX_MAX

According to the Linux man page for getdtablesize(3), the latter is
supposed to return "the maximum number of files a process can have
open, one more than the largest possible value for a file descriptor."
The constant OPEN_MAX_MAX is the only limit enforced by Cygwin, so we
now return that.

Previously getdtablesize returned the current size of cygheap->fdtab,
Cygwin's internal file descriptor table.  But this is a dynamically
growing table, and its current size does not reflect an actual limit
on the number of open files.

With this change, gnulib now reports that getdtablesize and
fcntl(F_DUPFD) work on Cygwin.  Packages like GNU tar that use the
corresponding gnulib modules will no longer use gnulib replacements on
Cygwin.
winsup/cygwin/syscalls.cc
This page took 0.030966 seconds and 5 git commands to generate.