dup function

int dup(
  1. int fd
)

Duplicate FD, returning a new file descriptor on the same file.

Implementation

int dup(
  int fd,
) {
  _dup ??= Libc()
      .dylib
      .lookupFunction<ffi.Int32 Function(ffi.Int32), _dart_dup>('dup');
  return _dup!(
    fd,
  );
}