aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/os.cpp
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-11-03 10:07:39 +0100
committerGitHub <noreply@github.com>2020-11-03 10:07:39 +0100
commit50604971745c0ddd2373bba933c30b59db624d2b (patch)
tree6bbf752e96849ad05ac269ba769daebc8bb5937e /src/stage1/os.cpp
parentb30a765b95cf666409c1e5324718a7c8c60af4af (diff)
parente023a5fe5d8e0c2849c160ffab993ec1e378681c (diff)
downloadzig-50604971745c0ddd2373bba933c30b59db624d2b.tar.gz
zig-50604971745c0ddd2373bba933c30b59db624d2b.zip
Merge pull request #6921 from xackus/gimmeMoreOfThoseSweetSweetFileDescriptors
stage2: ask for more file descriptors
Diffstat (limited to 'src/stage1/os.cpp')
-rw-r--r--src/stage1/os.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/stage1/os.cpp b/src/stage1/os.cpp
index c9dd49071c..1cb015c1af 100644
--- a/src/stage1/os.cpp
+++ b/src/stage1/os.cpp
@@ -978,29 +978,6 @@ int os_init(void) {
host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &macos_monotonic_clock);
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &macos_calendar_clock);
#endif
-#if defined(ZIG_OS_POSIX)
- // Raise the open file descriptor limit.
- // Code lifted from node.js
- struct rlimit lim;
- if (getrlimit(RLIMIT_NOFILE, &lim) == 0 && lim.rlim_cur != lim.rlim_max) {
- // Do a binary search for the limit.
- rlim_t min = lim.rlim_cur;
- rlim_t max = 1 << 20;
- // But if there's a defined upper bound, don't search, just set it.
- if (lim.rlim_max != RLIM_INFINITY) {
- min = lim.rlim_max;
- max = lim.rlim_max;
- }
- do {
- lim.rlim_cur = min + (max - min) / 2;
- if (setrlimit(RLIMIT_NOFILE, &lim)) {
- max = lim.rlim_cur;
- } else {
- min = lim.rlim_cur;
- }
- } while (min + 1 < max);
- }
-#endif
return 0;
}