stat_linux.go 472 B

12345678910111213141516171819
  1. package 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. rdev: s.Rdev,
  10. mtim: s.Mtim}, nil
  11. }
  12. // FromStatT converts a syscall.Stat_t type to a system.Stat_t type
  13. // This is exposed on Linux as pkg/archive/changes uses it.
  14. func FromStatT(s *syscall.Stat_t) (*StatT, error) {
  15. return fromStatT(s)
  16. }