diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-14 12:13:14 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-14 12:13:14 +0100 |
| commit | 7624ddd6d82230be5d9df0f74b1b98b761eed677 (patch) | |
| tree | 136a17764648a619745ed571b406920d27528c4e /executor/executor_bsd.h | |
| parent | fe7127be71799d60a3f6adc9f357839882a27968 (diff) | |
executor: move setrlimit from setup_control_pipes to bsd os_init
This broke fuchsia build. We need setrlimit only for bsd.
Diffstat (limited to 'executor/executor_bsd.h')
| -rw-r--r-- | executor/executor_bsd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h index 8f364ca13..b6cf9a3ea 100644 --- a/executor/executor_bsd.h +++ b/executor/executor_bsd.h @@ -21,6 +21,11 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) if (mmap(data, data_size, prot, MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0) != data) fail("mmap of data segment failed"); + + // Makes sure the file descriptor limit is sufficient to map control pipes. + struct rlimit rlim; + rlim.rlim_cur = rlim.rlim_max = kMaxFd; + setrlimit(RLIMIT_NOFILE, &rlim); } static long execute_syscall(const call_t* c, long a[kMaxArgs]) |
