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