rust/library/std/src/io
Dylan DPC fe55eee9a5
Rollup merge of #93263 - sunfishcode:sunfishcode/detatched-console-handle, r=dtolnay
Consistently present absent stdio handles on Windows as NULL handles.

This addresses #90964 by making the std API consistent about presenting
absent stdio handles on Windows as NULL handles. Stdio handles may be
absent due to `#![windows_subsystem = "windows"]`, due to the console
being detached, or due to a child process having been launched from a
parent where stdio handles are absent.

Specifically, this fixes the case of child processes of parents with absent
stdio, which previously ended up with `stdin().as_raw_handle()` returning
`INVALID_HANDLE_VALUE`, which was surprising, and which overlapped with an
unrelated valid handle value. With this patch, `stdin().as_raw_handle()`
now returns null in these situation, which is consistent with what it
does in the parent process.

And, document this in the "Windows Portability Considerations" sections of
the relevant documentation.
2022-03-19 02:02:01 +01:00
..
buffered Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
cursor impl Write for Cursor<[u8; N]> 2022-01-19 15:57:40 -08:00
error Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
impls std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
readbuf implement review suggestions 2021-11-02 22:47:28 -07:00
stdio Make default stdio lock() return 'static handles 2022-02-13 10:23:16 -05:00
util read_buf 2021-11-02 22:47:20 -07:00
copy.rs fix test failure from trying to assume_init too much 2021-11-02 22:47:27 -07:00
cursor.rs Rollup merge of #92663 - cuviper:generic-write-cursor, r=dtolnay 2022-03-19 02:02:00 +01:00
error.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
impls.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
mod.rs changed wording 2022-03-16 03:04:40 +01:00
prelude.rs Use heading for std::prelude and not io::prelude 2021-01-05 17:52:24 -08:00
readbuf.rs fix typo: intialized -> initialized 2021-12-26 18:37:11 -08:00
stdio.rs Rollup merge of #93263 - sunfishcode:sunfishcode/detatched-console-handle, r=dtolnay 2022-03-19 02:02:01 +01:00
tests.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
util.rs add safety comments 2021-11-02 22:47:26 -07:00