support compilation for armv7

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-03-21 08:14:51 +00:00
parent 1005d1dba9
commit ae42cc4173
5 changed files with 31 additions and 4 deletions

View file

@ -0,0 +1,20 @@
// mksyscall.pl -l32 copy_linux.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package sysx
import (
"syscall"
"unsafe"
)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) {
r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}

View file

@ -0,0 +1,7 @@
package sysx
const (
// SYS_COPY_FILE_RANGE defined in Kernel 4.5+
// Number defined in /usr/include/arm-linux-gnueabihf/asm/unistd.h
SYS_COPY_FILE_RANGE = 391
)

View file

@ -365,7 +365,7 @@ func openSubvolDir(path string) (*os.File, error) {
}
func isStatfsSubvol(statfs *syscall.Statfs_t) error {
if statfs.Type != C.BTRFS_SUPER_MAGIC {
if int64(statfs.Type) != int64(C.BTRFS_SUPER_MAGIC) {
return errors.Errorf("not a btrfs filesystem")
}