2014-07-28 17:23:38 -07:00
|
|
|
package kernel
|
2013-05-15 17:40:47 -07:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
import "golang.org/x/sys/unix"
|
2013-05-15 17:40:47 -07:00
|
|
|
|
2015-07-25 10:35:07 +02: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 10:35:07 +02:00
|
|
|
// other platforms where it is not available.
|
2017-05-23 10:22:32 -04:00
|
|
|
type Utsname unix.Utsname
|
2013-05-18 22:55:59 -03:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
func uname() (*unix.Utsname, error) {
|
|
|
|
uts := &unix.Utsname{}
|
2013-05-15 17:40:47 -07:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
if err := unix.Uname(uts); err != nil {
|
2013-05-15 17:40:47 -07:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return uts, nil
|
|
|
|
}
|