Commit c28acc88 authored by Christian Pellegrin's avatar Christian Pellegrin Committed by Tobias Klauser

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: 's avatarTobias Klauser <tobias.klauser@gmail.com>
parent 7dca6fe1
// 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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment