Closed
Description
The following code outputs
0
1
2
3
#![feature(old_io)]
#![feature(process)]
#![feature(old_path)]
fn main () {
use std::old_io::File;
use std::process::Command;
let mut file = File::create(&Path::new("message.txt"));
let _ = file.write_all(b"hello, file!\n");
let output = Command::new("ls").arg("/dev/fd").output().unwrap();
let val = output.stdout;
let _ = ::std::old_io::stdio::stdout().write_all(&val[0..]);
}
This means that Rust is setting the close-on-exec
flag for the file descriptor that it created (file descriptor 3 is for the /dev/fd
directory). The new io
module should that this is also done, and that this is done atomically where possible.
This is mostly a tracking issue to make sure that there is no regression.
Metadata
Metadata
Assignees
Labels
No labels