blob: c47feb8774ad1d6dc5f44ac03b5e6099229ad301 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
//@ignore-target: windows
use std::io::{Read, Write, pipe};
fn main() {
let (mut ping_rx, mut ping_tx) = pipe().unwrap();
ping_tx.write(b"hello").unwrap();
let mut buf: [u8; 5] = [0; 5];
ping_rx.read(&mut buf).unwrap();
assert_eq!(&buf, "hello".as_bytes());
}
|