mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
unix: fix seek while compiling with gccgo under arm and 386
Fixes golang/go#23361 Change-Id: Ia4fb99b1ac2b109048a1b81f9b1534685f6e31a8 Reviewed-on: https://go-review.googlesource.com/100076 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
7dca6fe1f4
commit
c28acc882e
21
unix/syscall_linux_gccgo.go
Normal file
21
unix/syscall_linux_gccgo.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build linux
|
||||
// +build gccgo
|
||||
// +build 386 arm
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) {
|
||||
offsetLow := uint32(offset & 0xffffffff)
|
||||
offsetHigh := uint32((offset >> 32) & 0xffffffff)
|
||||
_, _, err = Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
|
||||
return newoffset, err
|
||||
}
|
||||
Reference in New Issue
Block a user