summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc/filesystem.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-01-16 12:28:44 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-16 12:30:21 -0800
commit7b7c31820b83abcfe43f7170eff1f7953f3f27e2 (patch)
tree7a01db872d9c026b4a35437469e5c1ec94c7a1bf /pkg/sentry/fsimpl/proc/filesystem.go
parentfea1ce655de92a5411589d2f4a6b8973cd911a77 (diff)
Add remaining /proc/* and /proc/sys/* files
Except for one under /proc/sys/net/ipv4/tcp_sack. /proc/pid/* is still incomplete. Updates #1195 PiperOrigin-RevId: 290120438
Diffstat (limited to 'pkg/sentry/fsimpl/proc/filesystem.go')
-rw-r--r--pkg/sentry/fsimpl/proc/filesystem.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/proc/filesystem.go b/pkg/sentry/fsimpl/proc/filesystem.go
index d09182c77..e9cb7895f 100644
--- a/pkg/sentry/fsimpl/proc/filesystem.go
+++ b/pkg/sentry/fsimpl/proc/filesystem.go
@@ -67,3 +67,14 @@ func newDentry(creds *auth.Credentials, ino uint64, perm linux.FileMode, inode d
d.Init(inode)
return d
}
+
+type staticFile struct {
+ kernfs.DynamicBytesFile
+ vfs.StaticData
+}
+
+var _ dynamicInode = (*staticFile)(nil)
+
+func newStaticFile(data string) *staticFile {
+ return &staticFile{StaticData: vfs.StaticData{Data: data}}
+}