use std::ffi::CStr;
use std::io::IoSlice;
use std::os::raw::{c_char, c_int};
-use std::os::unix::io::RawFd;
+use std::os::unix::io::RawFd; // TODO io-safety, MSRV>=1.66, maybe nix>=1.30
+use std::os::fd::IntoRawFd; // TODO io-safety maybe remove
use std::slice;
use std::str;
use std::thread::panicking;
pub fn phase1() -> Self {
unsafe {
let null_fd = open(cstr!(b"/dev/null\0"), OFlag::O_RDWR, Mode::empty())
- .context("open /dev/null");
+ .context("open /dev/null")
+ .into_raw_fd();
mdup2(null_fd, 0, "null onto stdin");
let (st_rfd, st_wfd) = compat::pipe().context("pipe");