1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:24:42 -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,16 +552,7 @@ 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. return "", nil
// 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
}
} }
// Read into buffer of that size. // Read into buffer of that size.