You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dup_fd.go
    path of file: ./repos/tableflip
    
    the code of the file until where you have to start completion: //go:build !windows
// +build !windows

package tableflip

import (
	"fmt"
	"syscall"
)

func dupFd(fd uintptr, name fileName) (*file, error) {
	dupfd, _, errn
    
func dupFd(fd uintptr, name fileName) (*file, error) {
	dupfd, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_DUPFD_CLOEXEC, 0)
	if errno != 0 {
		return nil, fmt.Errorf("can't dup fd using fcntl: %s", errno)
	}

	return newFile(dupfd, name), nil
}