2018-02-05 16:05:59 -05:00
|
|
|
package system // import "github.com/docker/docker/pkg/system"
|
2014-02-21 04:12:25 -05:00
|
|
|
|
2017-04-05 18:35:43 -04:00
|
|
|
import "syscall"
|
2014-02-21 04:12:25 -05:00
|
|
|
|
2015-03-31 04:03:31 -04:00
|
|
|
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type
|
2015-07-28 12:13:12 -04:00
|
|
|
func fromStatT(s *syscall.Stat_t) (*StatT, error) {
|
|
|
|
return &StatT{size: s.Size,
|
2017-08-24 13:11:44 -04:00
|
|
|
mode: s.Mode,
|
2014-11-13 15:36:05 -05:00
|
|
|
uid: s.Uid,
|
|
|
|
gid: s.Gid,
|
2019-08-01 04:48:48 -04:00
|
|
|
// the type is 32bit on mips
|
|
|
|
rdev: uint64(s.Rdev), // nolint: unconvert
|
2014-11-13 15:36:05 -05:00
|
|
|
mtim: s.Mtim}, nil
|
2014-02-21 04:12:25 -05:00
|
|
|
}
|
2015-03-11 11:42:49 -04:00
|
|
|
|
2017-04-05 18:35:43 -04:00
|
|
|
// FromStatT converts a syscall.Stat_t type to a system.Stat_t type
|
|
|
|
// This is exposed on Linux as pkg/archive/changes uses it.
|
2015-07-28 12:13:12 -04:00
|
|
|
func FromStatT(s *syscall.Stat_t) (*StatT, error) {
|
2015-04-14 15:28:54 -04:00
|
|
|
return fromStatT(s)
|
|
|
|
}
|