1
0
mirror of https://github.com/golang/go synced 2024-11-20 10:24:40 -07:00

syscall: remove sysctl workaround for openbsd

Now that Go will no longer work on OpenBSD versions prior to 5.1,
remove the sysctl workaround that was needed for 5.0 and earlier.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6116050
This commit is contained in:
Joel Sing 2012-04-27 01:45:15 +10:00
parent 5491623406
commit e5f2662c25

View File

@ -13,7 +13,6 @@
package syscall package syscall
import ( import (
"runtime"
"unsafe" "unsafe"
) )
@ -553,17 +552,8 @@ func Sysctl(name string) (value string, err error) {
return "", err return "", err
} }
if n == 0 { if n == 0 {
// TODO(jsing): Remove after OpenBSD 5.2 release.
// Work around a bug that was fixed after OpenBSD 5.0.
// The length for kern.hostname and kern.domainname is always
// returned as 0 when a nil value is passed for oldp.
if runtime.GOOS == "openbsd" && (name == "kern.hostname" || name == "kern.domainname") {
// MAXHOSTNAMELEN
n = 256
} else {
return "", nil return "", nil
} }
}
// Read into buffer of that size. // Read into buffer of that size.
buf := make([]byte, n) buf := make([]byte, n)