about summary refs log tree commit diff
path: root/library/std/src/sys/windows/process.rs
AgeCommit message (Collapse)AuthorLines
2022-10-13std: use `sync::Mutex` for internal staticsjoboet-3/+3
2022-06-09Implement ExitCodeExt for WindowsAron Parker-0/+6
2022-05-17Revert "Auto merge of #96441 - ChrisDenton:sync-pipes, r=m-ou-se"Mark Rousskov-32/+6
This reverts commit ddb7fbe8434be481607ae199fe2aee976ee2fc2e, reversing changes made to baaa3b682986879c7784b5733ecea942e9ae7de3.
2022-05-11Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplettYuki Okushi-1/+0
Use Rust 2021 prelude in std itself.
2022-05-10Expose process main_thread_handle on Windowsunknown-7/+13
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-1/+0
2022-04-27Note the importance of using sync pipesChris Denton-1/+19
2022-04-26Windows: Make stdin pipes synchronousChris Denton-6/+14
Stdin pipes do not need to be used asynchronously within the standard library.
2022-04-25Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplettbors-86/+30
Windows Command: Don't run batch files using verbatim paths Fixes #95178 Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.
2022-04-08Windows: Use a pipe relay for chaining pipesChris Denton-1/+7
2022-03-23Command: handle exe and batch files separatelyChris Denton-17/+25
2022-03-23Refactor: Move argument building into argsChris Denton-69/+5
2022-02-17Keep the path after `program_exists` succeedsChris Denton-22/+23
2022-02-17Use verbatim paths for `process::Command` if necessaryChris Denton-11/+21
2022-02-14Maintain broken symlink behaviour for the Windows exe resolverChris Denton-2/+17
2022-02-09Rollup merge of #93445 - yaahc:exitcode-constructor, r=dtolnayYuki Okushi-0/+6
Add From<u8> for ExitCode This should cover a mostly cross-platform subset of supported exit codes. We decided to stick with `u8` initially since its the common subset between all platforms that we support (excluding wasm which I think only works with `true` or `false`). Posix is supposed to take i32s, but in practice many unix platforms mask out all but the low 8 bits or in some cases the 8-15th bits. Windows takes a u32 instead of an i32. Bourne-compatible shells also report signals as exitcode 128 + `signal_no`, so there's some ambiguity there when returning exit codes > 127, but it is possible to disambiguate them on the other side so we decided against restricting the possible codes further than to `u8`. ## Related - Detailed analysis of exit code support on various platforms: https://internals.rust-lang.org/t/mini-pre-rfc-redesigning-process-exitstatus/5426 - https://github.com/rust-lang/rust/issues/48711 - https://github.com/rust-lang/rust/issues/43301 - https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Termination.2FExit.20Status.20Stabilization
2022-02-06Add From<u8> for ExitCodeJane Lusby-0/+6
This should cover a mostly cross-platform subset of supported exit codes.
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-4/+4
2022-01-03Explicitly pass `PATH` to the Windows exe resolverChris Denton-11/+20
2021-12-16Quote bat script command lineChris Denton-0/+16
2021-10-31 Windows: Resolve Command program without using the current directoryChris Denton-26/+141
2021-08-19Use the correct `into_*` on Windows to avoid dropping a stdio handle.Dan Gohman-2/+2
Use `into_raw_handle()` rather than `into_inner()` to completely consume a `Handle` without dropping its contained handle.
2021-08-19I/O safety.Dan Gohman-19/+22
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: - <https://github.com/rust-lang/rust/issues/87074> RFC: - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
2021-08-08Fix Windows Command::env("PATH")Chris Denton-5/+24
2021-07-09Debug formatting of raw_arg()Kornel-2/+6
2021-07-09Unescaped command-line arguments for WindowsKornel-18/+51
Fixes #29494
2021-07-04Auto merge of #85270 - ChrisDenton:win-env-case, r=m-ou-sebors-9/+74
When using `process::Command` on Windows, environment variable names must be case-preserving but case-insensitive When using `Command` to set the environment variables, the key should be compared as uppercase Unicode but when set it should preserve the original case. Fixes #85242
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-1/+1
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-19Windows: Fix `Command::env_clear` so it worksChris Denton-0/+6
Previously, it would error unless at least one new environment variable was added.
2021-06-17Document how Windows compares environment variablesChris Denton-3/+22
2021-05-19Windows `Command` environment variables are case-preservingChris Denton-9/+55
But comparing is case-insensitive.
2021-05-12Provide ExitStatusErrorIan Jackson-2/+23
Closes #73125 This is in pursuance of Issue #73127 Consider adding #[must_use] to std::process::ExitStatus In MR #81452 Add #[must_use] to [...] process::ExitStatus we concluded that the existing arrangements in are too awkward so adding that #[must_use] is blocked on improving the ergonomics. I wrote a mini-RFC-style discusion of the approach in https://github.com/rust-lang/rust/issues/73125#issuecomment-771092741 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-04-28Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` insteadChristiaan Dirkx-24/+4
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-1/+1
2021-02-17Expose force_quotes on Windows.Yonggang Luo-3/+9
Quotes the arg and not quotes the arg have different effect on Windows when the program called are msys2/cygwin program. Refer to https://github.com/msys2/MSYS2-packages/issues/2176 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
2020-09-26Add accessors to Command.Eric Huss-1/+47
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-38/+3
Also doing fmt inplace as requested.
2020-07-27mv std libs to library/mark-0/+566