summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/host
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-07-01 20:26:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-07-01 20:26:09 +0000
commit68f56161e21a352989caf23fb965ad82d9836622 (patch)
treeed6b8ef35e1ff9cc7a1b825df822d1abaeca8020 /pkg/sentry/fsimpl/host
parentcb5ca78e5ed54b255c0b46ea5e179094fbe755d3 (diff)
parent6a90c88b97481a6d81b05f09d5c8ed7158225dd5 (diff)
Merge release-20200622.1-52-g6a90c88b9 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/host')
-rw-r--r--pkg/sentry/fsimpl/host/host.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/host/host.go b/pkg/sentry/fsimpl/host/host.go
index d5e73ddae..007b3332e 100644
--- a/pkg/sentry/fsimpl/host/host.go
+++ b/pkg/sentry/fsimpl/host/host.go
@@ -543,6 +543,16 @@ func (f *fileDescription) Release() {
// noop
}
+// Allocate implements vfs.FileDescriptionImpl.
+func (f *fileDescription) Allocate(ctx context.Context, mode, offset, length uint64) error {
+ if !f.inode.seekable {
+ return syserror.ESPIPE
+ }
+
+ // TODO(gvisor.dev/issue/2923): Implement Allocate for non-pipe hostfds.
+ return syserror.EOPNOTSUPP
+}
+
// PRead implements FileDescriptionImpl.
func (f *fileDescription) PRead(ctx context.Context, dst usermem.IOSequence, offset int64, opts vfs.ReadOptions) (int64, error) {
i := f.inode