diff options
author | Ken Brown <kbrown@cornell.edu> | 2021-01-29 17:02:15 +0300 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2021-02-01 17:55:07 +0300 |
commit | b9cbc49b70c96bed047f8c9f2e995719ca68fc01 (patch) | |
tree | 183baed5ef81de1c39272dbbd8c04cbfb5ddb391 /winsup/cygwin/sysconf.cc | |
parent | 3d256e22e22d435d13cfecf39c15338cfbd6f587 (diff) |
Cygwin: sysconf, getrlimit: don't call getdtablesize
Now that getdtablesize always returns OPEN_MAX_MAX, we can simplify
sysconf(_SC_OPEN_MAX) and getrlimit(RLIMIT_NOFILE) to just use that
same constant instead of calling getdtablesize.
Diffstat (limited to 'winsup/cygwin/sysconf.cc')
-rw-r--r-- | winsup/cygwin/sysconf.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc index 001da96ad..d5d82bb4a 100644 --- a/winsup/cygwin/sysconf.cc +++ b/winsup/cygwin/sysconf.cc @@ -22,15 +22,6 @@ details. */ #include "clock.h" static long -get_open_max (int in) -{ - long max = getdtablesize (); - if (max < OPEN_MAX) - max = OPEN_MAX; - return max; -} - -static long get_page_size (int in) { return wincap.allocation_granularity (); @@ -520,7 +511,7 @@ static struct {cons, {c:CHILD_MAX}}, /* 1, _SC_CHILD_MAX */ {cons, {c:CLOCKS_PER_SEC}}, /* 2, _SC_CLK_TCK */ {cons, {c:NGROUPS_MAX}}, /* 3, _SC_NGROUPS_MAX */ - {func, {f:get_open_max}}, /* 4, _SC_OPEN_MAX */ + {cons, {c:OPEN_MAX_MAX}}, /* 4, _SC_OPEN_MAX */ {cons, {c:_POSIX_JOB_CONTROL}}, /* 5, _SC_JOB_CONTROL */ {cons, {c:_POSIX_SAVED_IDS}}, /* 6, _SC_SAVED_IDS */ {cons, {c:_POSIX_VERSION}}, /* 7, _SC_VERSION */ |