github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/pkg/system/stat_linux.go (about)

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