Skip to content

Commit

Permalink
pkg/parsers: Enable GetKernelVersion on FreeBSD
Browse files Browse the repository at this point in the history
This is needed by podman/test/utils.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
  • Loading branch information
dfr committed Nov 8, 2022
1 parent 74e3743 commit 331b110
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions pkg/parsers/kernel/uname_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package kernel

import "golang.org/x/sys/unix"

// Utsname represents the system name structure.
// It is passthrough for unix.Utsname in order to make it portable with
// other platforms where it is not available.
type Utsname unix.Utsname

func uname() (*unix.Utsname, error) {
uts := &unix.Utsname{}

if err := unix.Uname(uts); err != nil {
return nil, err
}
return uts, nil
}
4 changes: 2 additions & 2 deletions pkg/parsers/kernel/uname_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build freebsd || openbsd
// +build freebsd openbsd
//go:build openbsd
// +build openbsd

package kernel

Expand Down
4 changes: 2 additions & 2 deletions pkg/parsers/kernel/uname_unsupported_type.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !linux && !solaris
// +build !linux,!solaris
//go:build !linux && !solaris && !freebsd
// +build !linux,!solaris,!freebsd

package kernel

Expand Down

0 comments on commit 331b110

Please sign in to comment.