about summary refs log tree commit diff
path: root/src/libstd/process.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-2112/+0
2020-05-22Implement `Sync` for `process::Command on unix and vxworksLeSeulArtichaut-3/+3
2020-05-17abort_internal is safeRalf Jung-1/+1
2020-04-26Update nameSteven Fackler-6/+6
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+14
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2019-11-29Format libstd with rustfmtDavid Tolnay-86/+133
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-06Ignore these tests ,since the called commands doesn't exist in VxWorksUmesh Kalappa-12/+17
2019-10-20Remove leading :: from paths in doc examplesMikko Rantanen-6/+6
2019-09-23Rollup merge of #64294 - wchargin:wchargin-stdio-piped-docs, r=Dylan-DPCMazdak Farrokhzad-1/+1
Fix `Stdio::piped` example code and lint Summary: Invoking `rev` does not add a trailing newline when none is present in the input (at least on my Debian). Nearby examples use `echo` rather than `rev`, which probably explains the source of the discrepancy. Also, a `mut` qualifier is unused. Test Plan: Copy the code block into <https://play.rust-lang.org> with a `fn main` wrapper, and run it. Note that it compiles and runs cleanly; prior to this commit, it would emit an `unused_mut` warning and then panic. wchargin-branch: stdio-piped-docs
2019-09-19Remove unnecessary `mut` in doc exampleAdrian Heine né Lang-1/+1
2019-09-15use println!()Guanqun Lu-1/+1
2019-09-08Fix `Stdio::piped` example code and lintWilliam Chargin-2/+2
Summary: Invoking `rev` does not add a trailing newline when none is present in the input (at least on my Debian). Nearby examples use `echo` rather than `rev`, which probably explains the source of the discrepancy. Also, a `mut` qualifier is unused. Test Plan: Copy the code block into <https://play.rust-lang.org> with a `fn main` wrapper, and run it. Note that it compiles and runs cleanly; prior to this commit, it would emit an `unused_mut` warning and then panic. wchargin-branch: stdio-piped-docs
2019-09-06A few cosmetic improvements to code & comments in liballoc and libcoreAlexander Regueiro-1/+1
2019-06-27std: Move a process test out of libstdAlex Crichton-27/+0
This commit moves a test out of libstd which is causing deadlocks on musl on CI. Looks like the recent update in musl versions brings in some internal updates to musl which makes `setgid` and `setuid` invalid to call after a `fork` in a multithreaded program. The issue seen here is that the child thread was attempting to grab a lock held by a nonexistent thread, meaning that the child process simply deadlocked causing the whole test to deadlock. This commit moves the test to its own file with no threads which should work.
2019-06-05Tidy: trailing whitespaceReinier Maas-1/+1
Removed trailing whitespace from documentation of ExitStatus.
2019-06-05Edit docs of ExitStatusReinier Maas-1/+4
The documentation of [`ExitStatus`] are extended to be at the same depth as [`Output`].
2019-05-01doc: Warn about possible zombie apocalypseMichal 'vorner' Vaner-0/+12
Extend the std::process::Child docs with warning about possible zombies. The previous version mentioned that when dropping the Child, the process is not killed. However, the wording gave the impression that such behaviour is fine to do (leaving the reader believe low-level details like reaping zombies of the dead processes is taken over by std somehow; or simply leaving the reader unaware about the problem).
2019-04-27Stabilized vectored IOSteven Fackler-4/+4
This renames `std::io::IoVec` to `std::io::IoSlice` and `std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes `std::io::IoSlice`, `std::io::IoSliceMut`, `std::io::Read::read_vectored`, and `std::io::Write::write_vectored`. Closes #58452
2019-04-10std: Add `{read,write}_vectored` for more typesAlex Crichton-1/+15
This commit implements the `{read,write}_vectored` methods on more types in the standard library, namely: * `std::fs::File` * `std::process::ChildStd{in,out,err}` * `std::io::Std{in,out,err}` * `std::io::Std{in,out,err}Lock` * `std::io::Std{in,out,err}Raw` Where supported the OS implementations hook up to native support, otherwise it falls back to the already-defaulted implementation.
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-8/+8
2019-03-25SGX target: fix std unit testsJethro Beekman-1/+1
2019-03-14Don't run test launching `echo` since that doesn't exist on WindowsJohn Kåre Alsaker-1/+1
2019-02-28libstd => 2018Taiki Endo-27/+26
2019-02-25Disable running several Stdio doctestsIvan Petkov-2/+2
* A number of `Stdio` related doc examples include running the "rev" command to illustrate piping commands. The majority of these tests are marked as `no_run` except for two tests which were not * Not running these tests is unlikely to cause any negative impact, and doing so also allows the test suite to pass in environments where the "rev" command is unavailable
2019-02-10libs: doc commentsAlexander Regueiro-7/+7
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-21Move a flaky process test out of libstdAlex Crichton-36/+0
This test ensures that everything in `env::vars()` is inherited but that's not actually true because other tests may add env vars after we spawn the process, causing the test to be flaky! This commit moves the test to a run-pass test where it can execute in isolation. Along the way this removes a lot of the platform specificity of the test, using iteslf to print the environment instead of a foreign process.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-2/+2
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-2/+2
2018-11-13Rollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcrichtonkennytm-3/+6
Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err r? @nikomatsakis
2018-11-10Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/errSantiago Pastorino-3/+6
2018-10-24Documents `From` implementations for `Stdio`OCTronics-0/+88
Add a basic summary and an example to From `ChildStdin`, `ChildStdout`, `ChildStderr`, `File` implementations.
2018-08-20document the platform-specific behavior of Command::current_dirJack O'Connor-0/+10
2018-08-11Fix indentHavvy (Ryan Scheel)-1/+1
2018-08-11Show that Command can be reused and remodifiedRyan Scheel-0/+33
The prior documentation did not make it clear this was possible.
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-2/+2
2018-04-24Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrumkennytm-2/+11
std: Child::kill() returns error if process has already exited This patch makes it clear in std::process::Child::kill()'s API documentation that an error is returned if the child process has already cleanly exited. This is implied by the example, but not called out explicitly.
2018-04-17fixup! std: Child::kill() returns error if process has already exitedAndreas Tolfsen-1/+1
2018-04-08fixup! std: Child::kill() returns error if process has already exitedAndreas Tolfsen-1/+1
2018-04-05std: Inline some Termination-related methodsAlex Crichton-0/+2
These were showing up in tests and in binaries but are trivially optimize-able away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them out.
2018-04-02Fix "since" version for getpid feature.Thayne McCombs-1/+1
It was stabilized right before the beta branch was cut for 1.26.0. See https://github.com/rust-lang/rust/pull/49523#issuecomment-377996315
2018-04-01Stabilize `std::process::id()`Thayne McCombs-2/+1
Fixes #44971
2018-03-29fixup! std: Child::kill() returns error if process has already exitedAndreas Tolfsen-1/+6
2018-03-28fixup! std: Child::kill() returns error if process has already exitedAndreas Tolfsen-1/+4
2018-03-28std: Child::kill() returns error if process has already exitedAndreas Tolfsen-2/+3
This patch makes it clear in std::process::Child::kill()'s API documentation that an error is returned if the child process has already cleanly exited. This is implied by the example, but not called out explicitly.
2018-03-25Minor formatting consistency fix.Alexander Ronald Altman-1/+1
2018-03-21termination_trait: Make error message more helpfulTyler Mandry-2/+3
2018-03-21termination_trait: Put examples in error help, not labelTyler Mandry-1/+1
2018-03-21termination_trait: Add () example to error messageTyler Mandry-1/+1