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

Function waitForRequest

pkg/sentry/syscalls/linux/sys_aio.go:163–180  ·  view source on GitHub ↗
(ctx *mm.AIOContext, t *kernel.Task, haveDeadline bool, deadline ktime.Time)

Source from the content-addressed store, hash-verified

161}
162
163func waitForRequest(ctx *mm.AIOContext, t *kernel.Task, haveDeadline bool, deadline ktime.Time) (any, error) {
164 for {
165 if v, ok := ctx.PopRequest(); ok {
166 // Request was readily available. Just return it.
167 return v, nil
168 }
169
170 // Need to wait for request completion.
171 done := ctx.WaitChannel()
172 if done == nil {
173 // Context has been destroyed.
174 return nil, linuxerr.EINVAL
175 }
176 if err := t.BlockWithDeadline(done, haveDeadline, deadline); err != nil {
177 return nil, err
178 }
179 }
180}
181
182// memoryFor returns appropriate memory for the given callback.
183func memoryFor(t *kernel.Task, cb *linux.IOCallback) (usermem.IOSequence, error) {

Callers 1

IoGeteventsFunction · 0.85

Calls 3

PopRequestMethod · 0.80
WaitChannelMethod · 0.80
BlockWithDeadlineMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…