MCPcopy
hub / github.com/google/gvisor / newFakeExecutable

Function newFakeExecutable

pkg/sentry/fsimpl/testutil/kernel.go:170–182  ·  view source on GitHub ↗
(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, root vfs.VirtualDentry)

Source from the content-addressed store, hash-verified

168}
169
170func newFakeExecutable(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, root vfs.VirtualDentry) (*vfs.FileDescription, error) {
171 const name = "executable"
172 pop := &vfs.PathOperation{
173 Root: root,
174 Start: root,
175 Path: fspath.Parse(name),
176 }
177 opts := &vfs.OpenOptions{
178 Flags: linux.O_RDONLY | linux.O_CREAT,
179 Mode: 0777,
180 }
181 return vfsObj.OpenAt(ctx, creds, pop, opts)
182}
183
184func createMemoryFile() (*pgalloc.MemoryFile, error) {
185 const memfileName = "test-memory"

Callers 1

CreateTaskFunction · 0.85

Calls 2

ParseFunction · 0.92
OpenAtMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…