test_errors();
test_rename();
test_directory();
+ test_dup_stdout_stderr();
}
fn tmp() -> PathBuf {
// Reading the metadata of a non-existent directory should fail with a "not found" error.
assert_eq!(ErrorKind::NotFound, check_metadata(&[], &dir_path).unwrap_err().kind());
}
+
+fn test_dup_stdout_stderr() {
+ let bytes = b"hello dup fd\n";
+ unsafe {
+ let new_stdout = libc::fcntl(1, libc::F_DUPFD, 0);
+ let new_stderr = libc::fcntl(2, libc::F_DUPFD, 0);
+ libc::write(new_stdout, bytes.as_ptr() as *const libc::c_void, bytes.len());
+ libc::write(new_stderr, bytes.as_ptr() as *const libc::c_void, bytes.len());
+ }
+}
+++ /dev/null
-// ignore-windows
-// compile-flags: -Zmiri-disable-isolation
-
-#![feature(rustc_private)]
-
-extern crate libc;
-
-fn main() {
- dup_stdout_stderr_test();
-}
-
-fn dup_stdout_stderr_test() {
- let bytes = b"hello dup fd\n";
- unsafe {
- let new_stdout = libc::fcntl(1, libc::F_DUPFD, 0);
- let new_stderr = libc::fcntl(2, libc::F_DUPFD, 0);
- libc::write(new_stdout, bytes.as_ptr() as *const libc::c_void, bytes.len());
- libc::write(new_stderr, bytes.as_ptr() as *const libc::c_void, bytes.len());
- }
-}