route: drop support for go1.5
This change drops a workaround for golang.org/issues/13372.
The compiler in Go 1.6 or above handles the "conversion of a
unsafe.Pointer to uintptr when calling syscall.Syscall" case
correctly.
Also fixes a typo.
Change-Id: I0433f3b8f75b34437aad91c6e8cf103e884d2a83
Reviewed-on: https://go-review.googlesource.com/37171
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/route/binary.go b/route/binary.go
index 4c56163..6910520 100644
--- a/route/binary.go
+++ b/route/binary.go
@@ -9,7 +9,7 @@
// This file contains duplicates of encoding/binary package.
//
// This package is supposed to be used by the net package of standard
-// library. Therefore a package set used in the package must be the
+// library. Therefore the package set used in the package must be the
// same as net package.
var (
diff --git a/route/syscall.go b/route/syscall.go
index d136325..c211188 100644
--- a/route/syscall.go
+++ b/route/syscall.go
@@ -11,10 +11,6 @@
"unsafe"
)
-// TODO: replace with runtime.KeepAlive when available
-//go:noescape
-func keepAlive(p unsafe.Pointer)
-
var zero uintptr
func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
@@ -25,7 +21,6 @@
p = unsafe.Pointer(&zero)
}
_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- keepAlive(p)
if errno != 0 {
return error(errno)
}
diff --git a/route/syscall.s b/route/syscall.s
deleted file mode 100644
index fa6297f..0000000
--- a/route/syscall.s
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 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.
-
-#include "textflag.h"
-
-TEXT ·keepAlive(SB),NOSPLIT,$0
- RET