diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2020-11-06 12:53:49 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-06 12:55:29 -0800 |
commit | 53eeb06ef14915eee799e9d7d59603ed2a0fe1c1 (patch) | |
tree | 038f56ca3f0c464d61a4b2ca6f482127c01c613c /test/util | |
parent | 955e09dfbdb8a4cdae0a0b625001a567f6f15758 (diff) |
Fix infinite loop when splicing to pipes/eventfds.
Writes to pipes of size < PIPE_BUF are guaranteed to be atomic, so writes
larger than that will return EAGAIN if the pipe has capacity < PIPE_BUF.
Writes to eventfds will return EAGAIN if the write would cause the eventfd
value to go over the max.
In both such cases, calling Ready() on the FD will return true (because it is
possible to write), but specific kinds of writes will in fact return EAGAIN.
This CL fixes an infinite loop in splice and sendfile (VFS1 and VFS2) by
forcing skipping the readiness check for the outfile in send, splice, and tee.
PiperOrigin-RevId: 341102260
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/timer_util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/util/timer_util.h b/test/util/timer_util.h index 926e6632f..e389108ef 100644 --- a/test/util/timer_util.h +++ b/test/util/timer_util.h @@ -33,6 +33,11 @@ namespace gvisor { namespace testing { +// From Linux's include/uapi/asm-generic/siginfo.h. +#ifndef sigev_notify_thread_id +#define sigev_notify_thread_id _sigev_un._tid +#endif + // Returns the current time. absl::Time Now(clockid_t id); |