]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplett
authorbors <bors@rust-lang.org>
Fri, 10 Jun 2022 11:50:39 +0000 (11:50 +0000)
committerbors <bors@rust-lang.org>
Fri, 10 Jun 2022 11:50:39 +0000 (11:50 +0000)
commitec55c61305eaf385fc1b93ac9a78284b4d887fe5
tree5b6abe8dc4a2278044d14457fb5f298b25e0527b
parentf19ccc2e8dab09e542d4c5a3ec14c7d5bce8d50e
parent2e62fdab76bd92d0d381589fc85602efad93c846
Auto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplett

Use `fcntl(fd, F_GETFD)` to detect if standard streams are open

In the previous implementation, if the standard streams were open,
but the RLIMIT_NOFILE value was below three, the poll would fail
with EINVAL:

> ERRORS: EINVAL The nfds value exceeds the RLIMIT_NOFILE value.

Switch to the existing fcntl based implementation to avoid the issue.

Fixes #96621.
library/std/src/lib.rs
library/std/src/sys/unix/mod.rs