2014-02-21 13:12:25 +04:00
|
|
|
package system
|
|
|
|
|
2017-04-06 01:35:43 +03:00
|
|
|
import "syscall"
|
2014-02-21 13:12:25 +04:00
|
|
|
|
2015-03-31 11:03:31 +03:00
|
|
|
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type
|
2015-07-28 19:13:12 +03:00
|
|
|
func fromStatT(s *syscall.Stat_t) (*StatT, error) {
|
|
|
|
return &StatT{size: s.Size,
|
2017-04-06 01:35:43 +03:00
|
|
|
mode: uint32(s.Mode),
|
2014-11-13 23:36:05 +03:00
|
|
|
uid: s.Uid,
|
|
|
|
gid: s.Gid,
|
2017-04-06 01:35:43 +03:00
|
|
|
rdev: uint64(s.Rdev),
|
2014-11-13 23:36:05 +03:00
|
|
|
mtim: s.Mtim}, nil
|
2014-02-21 13:12:25 +04:00
|
|
|
}
|
2015-03-11 18:42:49 +03:00
|
|
|
|
2017-04-06 01:35:43 +03: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 19:13:12 +03:00
|
|
|
func FromStatT(s *syscall.Stat_t) (*StatT, error) {
|
2015-04-14 22:28:54 +03:00
|
|
|
return fromStatT(s)
|
|
|
|
}
|