This follows the existing pattern of wrapping dup/dup2 and pipe with FileDescriptor.duplicate and FileDescriptor.pipe, with additional overloads for passing the O_CLOEXEC and similar flags.
CSystem is a leaky library dependency from System and must be
distributed. Install the files and make the dependency public so that
it is emitted into the clients.