Source File
kernel_version_linux.go
Belonging Package
internal/syscall/unix
// Copyright 2022 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.package uniximport ()// KernelVersion returns major and minor kernel version numbers// parsed from the syscall.Uname's Release field, or (0, 0) if// the version can't be obtained or parsed.func () (, int) {var syscall.Utsnameif := syscall.Uname(&); != nil {return}var ([2]int, int)for , := range .Release {if '0' <= && <= '9' {= ( * 10) + int(-'0')} else {// Note that we're assuming N.N.N here.// If we see anything else, we are likely to mis-parse it.[] =++if >= len() {break}= 0}}return [0], [1]}
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)