stat_linux.go 585 B

12345678910111213141516171819202122
  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{
  6. size: s.Size,
  7. mode: s.Mode,
  8. uid: s.Uid,
  9. gid: s.Gid,
  10. // the type is 32bit on mips
  11. rdev: uint64(s.Rdev), //nolint: unconvert
  12. mtim: s.Mtim,
  13. }, nil
  14. }
  15. // FromStatT converts a syscall.Stat_t type to a system.Stat_t type
  16. // This is exposed on Linux as pkg/archive/changes uses it.
  17. func FromStatT(s *syscall.Stat_t) (*StatT, error) {
  18. return fromStatT(s)
  19. }