github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/daemon/graphdriver/copy/copy_cgo.go (about)

     1  // +build linux,cgo
     2  
     3  package copy // import "github.com/docker/docker/daemon/graphdriver/copy"
     4  
     5  /*
     6  #include <linux/fs.h>
     7  
     8  #ifndef FICLONE
     9  #define FICLONE		_IOW(0x94, 9, int)
    10  #endif
    11  */
    12  import "C"
    13  import (
    14  	"os"
    15  
    16  	"golang.org/x/sys/unix"
    17  )
    18  
    19  func fiClone(srcFile, dstFile *os.File) error {
    20  	_, _, err := unix.Syscall(unix.SYS_IOCTL, dstFile.Fd(), C.FICLONE, srcFile.Fd())
    21  	return err
    22  }