diff options
| author | Ralf Jung <post@ralfj.de> | 2022-12-24 10:12:14 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-12-24 10:12:14 +0100 |
| commit | 9c01e9f7f56694db0179673fca221358d3524903 (patch) | |
| tree | 7a64babe493c9e88f72cfd2eead7fccadd304e0a /library/std/src/sys/unix/process/process_unix.rs | |
| parent | 0c14ad4d9fe83e737d7b8db0c2520ef54c99926e (diff) | |
| parent | 4f4d0586ad20c66a16d547581ca379beafece93a (diff) | |
| download | rust-9c01e9f7f56694db0179673fca221358d3524903.tar.gz rust-9c01e9f7f56694db0179673fca221358d3524903.zip | |
Merge from rustc
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index c0716a089bc..39d1c8b1d8e 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -133,6 +133,11 @@ impl Command { } } + pub fn output(&mut self) -> io::Result<(ExitStatus, Vec<u8>, Vec<u8>)> { + let (proc, pipes) = self.spawn(Stdio::MakePipe, false)?; + crate::sys_common::process::wait_with_output(proc, pipes) + } + // Attempts to fork the process. If successful, returns Ok((0, -1)) // in the child, and Ok((child_pid, -1)) in the parent. #[cfg(not(target_os = "linux"))] |
