arceos_posix_api

Function sys_dup2

Source
pub fn sys_dup2(old_fd: c_int, new_fd: c_int) -> c_int
Available on crate feature fd only.
Expand description

Duplicate a file descriptor, but it uses the file descriptor number specified in new_fd.

TODO: dup2 should forcibly close new_fd if it is already opened.