about summary refs log tree commit diff
path: root/library/std/src/process.rs
AgeCommit message (Collapse)AuthorLines
2021-04-22Rework `at_exit` to `cleanup`Christiaan Dirkx-1/+1
2021-04-21Replace all `fmt.pad` with `debug_struct`Christiaan Dirkx-4/+4
2021-03-27Use DebugStruct::finish_non_exhaustive() in std.Mara Bos-1/+1
2021-03-14Rollup merge of #82943 - kornelski:threadstdio, r=joshtriplettYuki Okushi-7/+18
Demonstrate best practice for feeding stdin of a child processes Documentation change. It's possible to create a deadlock with stdin/stdout I/O on a single thread: * the child process may fill its stdout buffer, and have to wait for the parent process to read it, * but the parent process may be waiting until its stdin write finishes before reading the stdout. Therefore, the parent process should use separate threads for writing and reading. These examples are not deadlocking in practice, because they use short strings, but I think it's better to demonstrate code that works even for long writes. The problem is non-obvious and tricky to debug (it seems that even libstd has a similar issue: #45572). This also demonstrates how to use stdio with threads: it's not obvious that `.take()` can be used to avoid fighting with the borrow checker. I've checked that the modified examples run fine.
2021-03-09Demonstrate best practice for feeding stdin of a child processesKornel-7/+18
It's possible to create a deadlock with stdin/stdout I/O on a single thread: * the child process may fill its stdout buffer, and have to wait for the parent process to read it, * but the parent process may be waiting until its stdin write finishes before reading the stdout. Therefore, the parent process should use separate threads for writing and reading.
2021-02-23ExitStatus: Improve documentation re wait status vs exit statusIan Jackson-7/+18
The use of `ExitStatus` as the Rust type name for a Unix *wait status*, not an *exit status*, is very confusing, but sadly probably too late to change. This area is confusing enough in Unix already (and many programmers are already confuxed). We can at least document it. I chose *not* to mention the way shells like to exit with signal numbers, thus turning signal numbers into exit statuses. This is only relevant for Rust programs using `std::process` if they run shells. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-02-10Seal the CommandExt, OsStrExt and OsStringExt traitsAmanieu d'Antras-0/+8
2020-11-23Auto merge of #78439 - lzutao:rm-clouldabi, r=Mark-Simulacrumbors-1/+1
Drop support for all cloudabi targets `cloudabi` is a tier-3 target, and [it is no longer being maintained upstream][no]. This PR drops supports for cloudabi targets. Those targets are: * aarch64-unknown-cloudabi * armv7-unknown-cloudabi * i686-unknown-cloudabi * x86_64-unknown-cloudabi Since this drops supports for a target, I'd like somebody to tag `relnotes` label to this PR. Some other issues: * The tidy exception for `cloudabi` crate is still remained because * `parking_lot v0.9.0` and `parking_lot v0.10.2` depends on `cloudabi v0.0.3`. * `parking_lot v0.11.0` depends on `cloudabi v0.1.0`. [no]: https://github.com/NuxiNL/cloudabi#note-this-project-is-unmaintained
2020-11-22Drop support for cloudabi targetsLzu Tao-1/+1
2020-11-18Add #[cold] to `abort` and `handle_alloc_error`Benoît du Garreau-0/+1
2020-10-31Apply suggestions from code reviewMatyáš Racek-4/+8
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2020-10-31Add note to process::arg[s] that args shouldn't be escaped or quotedMatyáš Racek-0/+6
2020-10-18Add missing punctuationpierwill-1/+1
2020-09-26Add accessors to Command.Eric Huss-0/+125
2020-09-21Rollup merge of #76275 - FedericoPonzi:immutable-write-impl-73836, r=dtolnayecstatic-morse-0/+19
Implementation of Write for some immutable ref structs Fixes #73836
2020-09-21Update library/std/src/process.rsFederico Ponzi-1/+1
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-09-16Rollup merge of #73955 - hellow554:unsafe_process, r=Mark-SimulacrumDylan DPC-2/+5
deny(unsafe_op_in_unsafe_fn) in libstd/process.rs The libstd/process.rs part of #73904 . Wraps the two calls to an unsafe fn Initializer::nop() in an unsafe block. Will have to wait for #73909 to be merged, because of the feature in the libstd/lib.rs
2020-09-11Deduplicates io::Write implementationsFederico Ponzi-4/+4
2020-09-03More implementations of Write for immutable refsFederico Ponzi-0/+19
Fixes #73836
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-408/+3
Also doing fmt inplace as requested.
2020-08-23doc: Fix typo in std::process::Child documentationJR Heard-1/+1
2020-08-14Rollup merge of #75432 - camelid:intra-doc-links-for-std-process, r=jyn514Tyler Mandry-58/+37
Switch to intra-doc links in `std::process` Part of #75080.
2020-08-14Improve documentation on process::Child.std* fieldsJonas Berlin-3/+24
As a relative beginner, it took a while for me to figure out I could just steal the references to avoid partially moving the child and thus retain ability to call functions on it (and store it in structs etc).
2020-08-11Use `Child::std{in,out,err}` instead of `Child.`Camelid-3/+3
These links were broken before.
2020-08-11Switch to intra-doc links in `std::process`Camelid-58/+37
2020-08-11deny(unsafe_op_in_unsafe_fn) in libstd/process.rsMarcel Hellwig-2/+5
2020-07-27mv std libs to library/mark-0/+2112