diff options
author | Jamie Liu <jamieliu@google.com> | 2019-11-06 17:10:30 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-06 17:11:58 -0800 |
commit | f8ffadddb39e132605f0ef3e3d39e5d7ad6e0ecf (patch) | |
tree | dd66085f179f7702dacaa7686e7b80fdfa4a5ede /pkg/p9/file.go | |
parent | e63db5e7bbf8decc6f799965f54fcf7aa6673527 (diff) |
Add p9.OpenTruncate.
This is required to implement O_TRUNC correctly on filesystems backed by
gofers.
9P2000.L: "lopen prepares fid for file I/O. flags contains Linux open(2) flags
bits, e.g. O_RDONLY, O_RDWR, O_WRONLY."
open(2): "The argument flags must include one of the following access modes:
O_RDONLY, O_WRONLY, or O_RDWR. ... In addition, zero or more file creation
flags and file status flags can be bitwise-or'd in flags."
The reference 9P2000.L implementation also appears to expect arbitrary flags,
not just access modes, in Tlopen.flags:
https://github.com/chaos/diod/blob/master/diod/ops.c#L703
PiperOrigin-RevId: 278972683
Diffstat (limited to 'pkg/p9/file.go')
-rw-r--r-- | pkg/p9/file.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/p9/file.go b/pkg/p9/file.go index 907445e15..96d1f2a8e 100644 --- a/pkg/p9/file.go +++ b/pkg/p9/file.go @@ -116,7 +116,7 @@ type File interface { // N.B. The server must resolve any lazy paths when open is called. // After this point, read and write may be called on files with no // deletion check, so resolving in the data path is not viable. - Open(mode OpenFlags) (*fd.FD, QID, uint32, error) + Open(flags OpenFlags) (*fd.FD, QID, uint32, error) // Read reads from this file. Open must be called first. // |