uname_linux.go 392 B

12345678910111213141516171819
  1. package kernel
  2. import (
  3. "syscall"
  4. )
  5. // Utsname represents the system name structure.
  6. // It is passthrough for syscall.Utsname in order to make it portable with
  7. // other platforms where it is not available.
  8. type Utsname syscall.Utsname
  9. func uname() (*syscall.Utsname, error) {
  10. uts := &syscall.Utsname{}
  11. if err := syscall.Uname(uts); err != nil {
  12. return nil, err
  13. }
  14. return uts, nil
  15. }