pub fn ioctl_fioclex<Fd: AsFd>(fd: Fd) -> Result<()>
ioctl(fd, FIOCLEX, NULL)—Set the close-on-exec flag.
ioctl(fd, FIOCLEX, NULL)
This is similar to fcntl(fd, F_SETFD, FD_CLOEXEC), except that it avoids clearing any other flags that might be set.
fcntl(fd, F_SETFD, FD_CLOEXEC)