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.
This commit is contained in:
bors
2022-06-10 11:50:39 +00:00
3 changed files with 103 additions and 35 deletions

View File

@@ -239,6 +239,7 @@
#![feature(dropck_eyepatch)]
#![feature(exhaustive_patterns)]
#![feature(intra_doc_pointers)]
#![feature(label_break_value)]
#![feature(lang_items)]
#![feature(let_chains)]
#![feature(let_else)]