unix: fix redefinition of seek func on arm and gccgo

Change-Id: Ia23cb723766e9d76d51c24ace0157f47cb5b34ae
Reviewed-on: https://go-review.googlesource.com/c/sys/+/249617
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:
Shengjing Zhu
2020-08-21 00:55:34 +08:00
committed by Tobias Klauser
parent e2d4c690b9
commit 1fb7954272
2 changed files with 13 additions and 5 deletions

View File

@@ -7,7 +7,6 @@
package unix
import (
"syscall"
"unsafe"
)
@@ -49,10 +48,6 @@ func Pipe2(p []int, flags int) (err error) {
return
}
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid allocation.
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
newoffset, errno := seek(fd, offset, whence)
if errno != 0 {

View File

@@ -0,0 +1,13 @@
// Copyright 2009 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 arm,!gccgo,linux
package unix
import "syscall"
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid allocation.
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)