mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add Uname on FreeBSD
FreeBSD doesn't have a uname syscall but the information can be retrieved using sysctls the same way as on Darwin. Change-Id: I824c42490d1feed3f1ad3823427c01dd3e5ea3c1 Reviewed-on: https://go-review.googlesource.com/79918 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
4ff8c001ce
commit
096928d58b
@@ -295,3 +295,13 @@ func TestCapRightsSetAndClear(t *testing.T) {
|
||||
t.Fatalf("Wrong rights set")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUname(t *testing.T) {
|
||||
var utsname unix.Utsname
|
||||
err := unix.Uname(&utsname)
|
||||
if err != nil {
|
||||
t.Fatalf("Uname: %v", err)
|
||||
}
|
||||
|
||||
t.Logf("OS: %s/%s %s", utsname.Sysname[:], utsname.Machine[:], utsname.Release[:])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user