2018-02-05 16:05:59 -05:00
|
|
|
package system // import "github.com/docker/docker/pkg/system"
|
2014-02-21 10:12:25 +01:00
|
|
|
|
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-08-24 13:11:44 -04:00
|
|
|
mode: s.Mode,
|
2014-11-13 12:36:05 -08:00
|
|
|
uid: s.Uid,
|
|
|
|
gid: s.Gid,
|
2019-08-01 16:48:48 +08:00
|
|
|
// the type is 32bit on mips
|
|
|
|
rdev: uint64(s.Rdev), // nolint: unconvert
|
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)
|
|
|
|
}
|