summary refs log tree commit diff
path: root/src/libstd/sys/unix/process
AgeCommit message (Collapse)AuthorLines
2017-01-24Updated Fuchsia support for std::process. Adds support for try_wait. Misc. ↵Theodore DeRego-23/+167
updates to reflect changes in Magenta
2017-01-06std: Add a nonblocking `Child::try_wait` methodAlex Crichton-0/+17
This commit adds a new method to the `Child` type in the `std::process` module called `try_wait`. This method is the same as `wait` except that it will not block the calling thread and instead only attempt to collect the exit status. On Unix this means that we call `waitpid` with the `WNOHANG` flag and on Windows it just means that we pass a 0 timeout to `WaitForSingleObject`. Currently it's possible to build this method out of tree, but it's unfortunately tricky to do so. Specifically on Unix you essentially lose ownership of the pid for the process once a call to `waitpid` has succeeded. Although `Child` tracks this state internally to be resilient to multiple calls to `wait` or a `kill` after a successful wait, if the child is waited on externally then the state inside of `Child` is not updated. This means that external implementations of this method must be extra careful to essentially not use a `Child`'s methods after a call to `waitpid` has succeeded (even in a nonblocking fashion). By adding this functionality to the standard library it should help canonicalize these external implementations and ensure they can continue to robustly reuse the `Child` type from the standard library without worrying about pid ownership.
2016-12-21Removes magenta build warning.Jason Campbell-1/+0
Small bug fix to remove an unused type in the magenta process code that causes build failures for magenta's rustc.
2016-12-01std::process fuchsia support cleanupTheodore DeRego-13/+203
2016-11-30Removed Option<ExitStatus> member from fuchsia Process struct. Destroy ↵Theodore DeRego-32/+19
launchpads and close handles in Drop impls rather than manually
2016-11-23Separated fuchsia-specific process stuff into 'process_fuchsia.rs' and ↵Theodore DeRego-0/+940
refactored out some now-duplicated code into a 'process_common.rs'