mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-09 02:29:07 +08:00
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.
This commit is contained in:
parent
62334dffd7
commit
6ae15c77a0
@ -2887,7 +2887,7 @@ setdtablesize (int size)
|
|||||||
extern "C" int
|
extern "C" int
|
||||||
getdtablesize ()
|
getdtablesize ()
|
||||||
{
|
{
|
||||||
return cygheap->fdtab.size;
|
return OPEN_MAX_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int
|
extern "C" int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user