diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-14 14:16:52 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-14 14:16:52 +0000 |
commit | 5ab873abf7fa0ffa670484cf8e3bf982e86aa573 (patch) | |
tree | 2734bd72fccbc425ebc62a1d9e9502efd3def7b8 /pkg/abi | |
parent | 08915768a189082b7122de5605931911761d7a07 (diff) | |
parent | 5e413cad10d2358a21dd08216953faee70e62a0b (diff) |
Merge release-20200219.0-177-g5e413ca (automated)
Diffstat (limited to 'pkg/abi')
-rw-r--r-- | pkg/abi/linux/file.go | 3 | ||||
-rwxr-xr-x | pkg/abi/linux/linux_abi_autogen_unsafe.go | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/pkg/abi/linux/file.go b/pkg/abi/linux/file.go index e229ac21c..dbe58acbe 100644 --- a/pkg/abi/linux/file.go +++ b/pkg/abi/linux/file.go @@ -266,6 +266,9 @@ type Statx struct { DevMinor uint32 } +// SizeOfStatx is the size of a Statx struct. +var SizeOfStatx = binary.Size(Statx{}) + // FileMode represents a mode_t. type FileMode uint16 diff --git a/pkg/abi/linux/linux_abi_autogen_unsafe.go b/pkg/abi/linux/linux_abi_autogen_unsafe.go index 46f7c1197..5257a99ce 100755 --- a/pkg/abi/linux/linux_abi_autogen_unsafe.go +++ b/pkg/abi/linux/linux_abi_autogen_unsafe.go @@ -126,7 +126,7 @@ func (s *Statx) Packed() bool { // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (s *Statx) MarshalUnsafe(dst []byte) { - if s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() && s.Btime.Packed() { + if s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(s)) } else { s.MarshalBytes(dst) @@ -144,7 +144,7 @@ func (s *Statx) UnmarshalUnsafe(src []byte) { // CopyOut implements marshal.Marshallable.CopyOut. func (s *Statx) CopyOut(task marshal.Task, addr usermem.Addr) error { - if !s.Mtime.Packed() && s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() { + if !s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() && s.Btime.Packed() { // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. buf := task.CopyScratchBuffer(s.SizeBytes()) s.MarshalBytes(buf) @@ -175,7 +175,7 @@ func (s *Statx) CopyOut(task marshal.Task, addr usermem.Addr) error { // CopyIn implements marshal.Marshallable.CopyIn. func (s *Statx) CopyIn(task marshal.Task, addr usermem.Addr) error { - if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { + if !s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() { // Type Statx doesn't have a packed layout in memory, fall back to UnmarshalBytes. buf := task.CopyScratchBuffer(s.SizeBytes()) _, err := task.CopyInBytes(addr, buf) |