From 53a8ee5011c2cca9f938af2ff2973ed8897aa597 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 10 Apr 2015 12:34:31 +0300 Subject: [PATCH] syscall: correct code for cover cmd Fixes #10378 This is clumsy, but currently cover tool fails as: $ go test -run=none -cover syscall syscall_linux_amd64.go:15: can only use //go:noescape with external func implementations FAIL syscall [build failed] This happens because cover tool mishandles //go: comments. r and gri said that fixing cover is infeasible due to go/ast limitations. So at least fix the offending code so that coverage works. This come up in context of coverage-guided fuzzing which works best with program-wide coverage. Change-Id: I142e5774c9f326ed38cb202693bd4edae93879ba Reviewed-on: https://go-review.googlesource.com/8723 Reviewed-by: Rob Pike --- src/syscall/syscall_linux_amd64.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/syscall/syscall_linux_amd64.go b/src/syscall/syscall_linux_amd64.go index 4111c075e8..fad9c32580 100644 --- a/src/syscall/syscall_linux_amd64.go +++ b/src/syscall/syscall_linux_amd64.go @@ -57,8 +57,6 @@ const _SYS_dup = SYS_DUP2 //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) -func Getpagesize() int { return 4096 } - //go:noescape func gettimeofday(tv *Timeval) (err Errno) @@ -70,6 +68,8 @@ func Gettimeofday(tv *Timeval) (err error) { return nil } +func Getpagesize() int { return 4096 } + func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval errno := gettimeofday(&tv)