This allows to drop the cgo implementation. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@@ -42,7 +42,7 @@ func copyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRang
defer dstFile.Close()
if *copyWithFileClone {
- err = fiClone(srcFile, dstFile)
+ err = unix.IoctlFileClone(int(dstFile.Fd()), int(srcFile.Fd()))
if err == nil {
return nil
}
@@ -1,22 +0,0 @@
-// +build linux,cgo
-
-package copy // import "github.com/docker/docker/daemon/graphdriver/copy"
-/*
-#include <linux/fs.h>
-#ifndef FICLONE
-#define FICLONE _IOW(0x94, 9, int)
-#endif
-*/
-import "C"
-import (
- "os"
- "golang.org/x/sys/unix"
-)
-func fiClone(srcFile, dstFile *os.File) error {
- _, _, err := unix.Syscall(unix.SYS_IOCTL, dstFile.Fd(), C.FICLONE, srcFile.Fd())
- return err
-}
@@ -1,13 +0,0 @@
-// +build linux,!cgo
- return unix.ENOSYS