dup2 function
Duplicate FD to FD2, closing FD2 and making it open on the same file.
Implementation
int dup2(
int fd,
int fd2,
) {
_dup2 ??= Libc()
.dylib
.lookupFunction<ffi.Int32 Function(ffi.Int32, ffi.Int32), _dart_dup2>(
'dup2');
return _dup2!(
fd,
fd2,
);
}