#[cfg(not(windows))]
fn main() {
use rustix::io::{dup2, pipe};
use std::io::{BufRead, BufReader};
use std::mem::forget;
let (reader, writer) = pipe().unwrap();
let (stdin, stdout) = unsafe { (rustix::io::take_stdin(), rustix::io::take_stdout()) };
dup2(&reader, &stdin).unwrap();
dup2(&writer, &stdout).unwrap();
forget(stdin);
forget(stdout);
drop(reader);
drop(writer);
println!("hello, world!");
let mut s = String::new();
BufReader::new(std::io::stdin()).read_line(&mut s).unwrap();
assert_eq!(s, "hello, world!\n");
}
#[cfg(windows)]
fn main() {
unimplemented!()
}