2018-02-05 16:05:59 -05:00
|
|
|
package kernel // import "github.com/docker/docker/pkg/parsers/kernel"
|
2013-05-15 20:40:47 -04:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
import "golang.org/x/sys/unix"
|
2013-05-15 20:40:47 -04:00
|
|
|
|
2015-07-25 04:35:07 -04:00
|
|
|
// Utsname represents the system name structure.
|
2017-05-23 10:22:32 -04:00
|
|
|
// It is passthrough for unix.Utsname in order to make it portable with
|
2015-07-25 04:35:07 -04:00
|
|
|
// other platforms where it is not available.
|
2017-05-23 10:22:32 -04:00
|
|
|
type Utsname unix.Utsname
|
2013-05-18 21:55:59 -04:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
func uname() (*unix.Utsname, error) {
|
|
|
|
uts := &unix.Utsname{}
|
2013-05-15 20:40:47 -04:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
if err := unix.Uname(uts); err != nil {
|
2013-05-15 20:40:47 -04:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return uts, nil
|
|
|
|
}
|