stat_linux.go 579 B

1234567891011121314151617181920
  1. package system // import "github.com/docker/docker/pkg/system"
  2. import "syscall"
  3. // fromStatT converts a syscall.Stat_t type to a system.Stat_t type
  4. func fromStatT(s *syscall.Stat_t) (*StatT, error) {
  5. return &StatT{size: s.Size,
  6. mode: s.Mode,
  7. uid: s.Uid,
  8. gid: s.Gid,
  9. // the type is 32bit on mips
  10. rdev: uint64(s.Rdev), //nolint: unconvert
  11. mtim: s.Mtim}, nil
  12. }
  13. // FromStatT converts a syscall.Stat_t type to a system.Stat_t type
  14. // This is exposed on Linux as pkg/archive/changes uses it.
  15. func FromStatT(s *syscall.Stat_t) (*StatT, error) {
  16. return fromStatT(s)
  17. }