github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/parsers/kernel/uname_linux.go (about)

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