process: Implement AsRawFd for ChildStd* structs

This commit is contained in:
Yuya Nishihara 2018-09-27 21:49:53 +09:00 committed by Ivan Petkov
parent 3b43262a10
commit e0e9594f71
No known key found for this signature in database
GPG Key ID: 0B431E9837056942

View File

@ -619,3 +619,27 @@ impl Read for ChildStderr {
impl AsyncRead for ChildStderr {
}
#[cfg(unix)]
mod sys {
use std::os::unix::io::{AsRawFd, RawFd};
use super::{ChildStdin, ChildStdout, ChildStderr};
impl AsRawFd for ChildStdin {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
impl AsRawFd for ChildStdout {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
impl AsRawFd for ChildStderr {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
}