mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
As the title says. Vendor Buildah v1.27.0 into Podman in preparation for Buildah v4.2 [No New Tests Needed] Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
20 lines
346 B
Go
20 lines
346 B
Go
//go:build linux || freebsd || darwin
|
|
// +build linux freebsd darwin
|
|
|
|
package util
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func ReadKernelVersion() (string, error) {
|
|
var uname unix.Utsname
|
|
if err := unix.Uname(&uname); err != nil {
|
|
return "", err
|
|
}
|
|
n := bytes.IndexByte(uname.Release[:], 0)
|
|
return string(uname.Release[:n]), nil
|
|
}
|