diff --git a/util/env_posix.cc b/util/env_posix.cc index d84cd1e..24b1c4c 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -6,7 +6,9 @@ #include #include #include +#ifndef __Fuchsia__ #include +#endif #include #include #include @@ -757,6 +759,10 @@ int MaxOpenFiles() { if (g_open_read_only_file_limit >= 0) { return g_open_read_only_file_limit; } +#ifdef __Fuchsia__ + // Fuchsia doesn't implement getrlimit. + g_open_read_only_file_limit = 50; +#else struct ::rlimit rlim; if (::getrlimit(RLIMIT_NOFILE, &rlim)) { // getrlimit failed, fallback to hard-coded default. @@ -767,6 +773,7 @@ int MaxOpenFiles() { // Allow use of 20% of available file descriptors for read-only files. g_open_read_only_file_limit = rlim.rlim_cur / 5; } +#endif return g_open_read_only_file_limit; }