mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
230a55d337
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
22 lines
383 B
Go
22 lines
383 B
Go
// +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
|
|
}
|