diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-06-07 12:17:40 +0200 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-06-07 13:42:50 +0000 |
commit | 5f2b4f26aa3ae79e6cfd3bd397d586d5a3ed9fec (patch) | |
tree | 3c4b1d2ef2fbe89e1929f3ee6ed7693524d30a72 /src/runtime/os_darwin.go | |
parent | e5f0c1f6c9dc382bdc6a0ec1a0d5e1fc6f833485 (diff) | |
download | go-5f2b4f26aa3ae79e6cfd3bd397d586d5a3ed9fec.tar.gz go-5f2b4f26aa3ae79e6cfd3bd397d586d5a3ed9fec.zip |
runtime: remove unused darwinVersion and getDarwinVersion
They are unused since CL 114799.
Also remove consts _CTL_KERN and _KERN_OSRELEASE previously used by
getDarwinVersion.
Change-Id: I51b701e8effbe4dd4301b0e6d52e8885469032f4
Reviewed-on: https://go-review.googlesource.com/116955
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/os_darwin.go')
-rw-r--r-- | src/runtime/os_darwin.go | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/runtime/os_darwin.go b/src/runtime/os_darwin.go index 52153055f0..55f938cd80 100644 --- a/src/runtime/os_darwin.go +++ b/src/runtime/os_darwin.go @@ -11,8 +11,6 @@ type mOS struct { waitsema uint32 // semaphore for parking on locks } -var darwinVersion int - //go:noescape func mach_msg_trap(h unsafe.Pointer, op int32, send_size, rcv_size, rcv_name, timeout, notify uint32) int32 @@ -50,34 +48,14 @@ func osinit() { ncpu = getncpu() physPageSize = getPageSize() - darwinVersion = getDarwinVersion() } const ( - _CTL_KERN = 1 - _CTL_HW = 6 - _KERN_OSRELEASE = 2 - _HW_NCPU = 3 - _HW_PAGESIZE = 7 + _CTL_HW = 6 + _HW_NCPU = 3 + _HW_PAGESIZE = 7 ) -func getDarwinVersion() int { - // Use sysctl to fetch kern.osrelease - mib := [2]uint32{_CTL_KERN, _KERN_OSRELEASE} - var out [32]byte - nout := unsafe.Sizeof(out) - ret := sysctl(&mib[0], 2, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0) - if ret >= 0 { - ver := 0 - for i := 0; i < int(nout) && out[i] >= '0' && out[i] <= '9'; i++ { - ver *= 10 - ver += int(out[i] - '0') - } - return ver - } - return 17 // should not happen: default to a newish version -} - func getncpu() int32 { // Use sysctl to fetch hw.ncpu. mib := [2]uint32{_CTL_HW, _HW_NCPU} |