diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-11-20 23:12:35 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-20 23:12:35 +0000 |
commit | bd17bba359ecf2749e18c98b354a2633d35f88ac (patch) | |
tree | 6fa4eb4e27ff058123d24decbd1f0ccac8d126b1 /pkg/sentry/fs/flags.go | |
parent | a98f44c8726eeec97e8b1e43978dd40d04d0b705 (diff) | |
parent | 012102eefd2b145ddee774cba28e4fa889fadd49 (diff) |
Merge release-20191114.0-16-g012102e (automated)
Diffstat (limited to 'pkg/sentry/fs/flags.go')
-rw-r--r-- | pkg/sentry/fs/flags.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/fs/flags.go b/pkg/sentry/fs/flags.go index 0fab876a9..4338ae1fa 100644 --- a/pkg/sentry/fs/flags.go +++ b/pkg/sentry/fs/flags.go @@ -64,6 +64,10 @@ type FileFlags struct { // NonSeekable indicates that file.offset isn't used. NonSeekable bool + + // Truncate indicates that the file should be truncated before opened. + // This is only applicable if the file is regular. + Truncate bool } // SettableFileFlags is a subset of FileFlags above that can be changed @@ -118,6 +122,9 @@ func (f FileFlags) ToLinux() (mask uint) { if f.LargeFile { mask |= linux.O_LARGEFILE } + if f.Truncate { + mask |= linux.O_TRUNC + } switch { case f.Read && f.Write: |