2018-02-05 21:05:59 +00:00
|
|
|
package system // import "github.com/docker/docker/pkg/system"
|
2014-02-21 09:12:25 +00:00
|
|
|
|
2017-04-05 22:35:43 +00:00
|
|
|
import "syscall"
|
2014-02-21 09:12:25 +00:00
|
|
|
|
2015-03-31 08:03:31 +00:00
|
|
|
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type
|
2015-07-28 16:13:12 +00:00
|
|
|
func fromStatT(s *syscall.Stat_t) (*StatT, error) {
|
|
|
|
return &StatT{size: s.Size,
|
2017-08-24 17:11:44 +00:00
|
|
|
mode: s.Mode,
|
2014-11-13 20:36:05 +00:00
|
|
|
uid: s.Uid,
|
|
|
|
gid: s.Gid,
|
2019-08-01 08:48:48 +00:00
|
|
|
// the type is 32bit on mips
|
|
|
|
rdev: uint64(s.Rdev), // nolint: unconvert
|
2014-11-13 20:36:05 +00:00
|
|
|
mtim: s.Mtim}, nil
|
2014-02-21 09:12:25 +00:00
|
|
|
}
|
2015-03-11 15:42:49 +00:00
|
|
|
|
2017-04-05 22:35:43 +00: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 16:13:12 +00:00
|
|
|
func FromStatT(s *syscall.Stat_t) (*StatT, error) {
|
2015-04-14 19:28:54 +00:00
|
|
|
return fromStatT(s)
|
|
|
|
}
|