From 1fb795427249579fe8cc3cb81def7fc9d08d640b Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Fri, 21 Aug 2020 00:55:34 +0800 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- unix/syscall_linux_arm.go | 5 ----- unix/syscall_linux_gc_arm.go | 13 +++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 unix/syscall_linux_gc_arm.go diff --git a/unix/syscall_linux_arm.go b/unix/syscall_linux_arm.go index e1913e2c..496837b1 100644 --- a/unix/syscall_linux_arm.go +++ b/unix/syscall_linux_arm.go @@ -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 { diff --git a/unix/syscall_linux_gc_arm.go b/unix/syscall_linux_gc_arm.go new file mode 100644 index 00000000..8c514c95 --- /dev/null +++ b/unix/syscall_linux_gc_arm.go @@ -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)