diff options
author | Ian Gudger <igudger@google.com> | 2018-12-10 17:55:45 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-12-10 17:56:34 -0800 |
commit | 5d87d8865f8771c00b84717d40f27f8f93dda7ca (patch) | |
tree | 86362c16f38874bf4bf3b98e7c47fc1cbba7e396 /test/syscalls/linux/socket_generic.cc | |
parent | d3bc79bc8438206ac6a14fde4eaa288fc07eee82 (diff) |
Implement MSG_WAITALL
MSG_WAITALL requests that recv family calls do not perform short reads. It only
has an effect for SOCK_STREAM sockets, other types ignore it.
PiperOrigin-RevId: 224918540
Change-Id: Id97fbf972f1f7cbd4e08eec0138f8cbdf1c94fe7
Diffstat (limited to 'test/syscalls/linux/socket_generic.cc')
-rw-r--r-- | test/syscalls/linux/socket_generic.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/syscalls/linux/socket_generic.cc b/test/syscalls/linux/socket_generic.cc index fbc3bebed..fdc346d4d 100644 --- a/test/syscalls/linux/socket_generic.cc +++ b/test/syscalls/linux/socket_generic.cc @@ -383,8 +383,6 @@ TEST_P(AllSocketPairTest, RecvmsgTimeoutOneSecondSucceeds) { } TEST_P(AllSocketPairTest, RecvWaitAll) { - SKIP_IF(IsRunningOnGvisor()); // FIXME: Support MSG_WAITALL. - auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); char sent_data[100]; @@ -399,5 +397,14 @@ TEST_P(AllSocketPairTest, RecvWaitAll) { SyscallSucceedsWithValue(sizeof(sent_data))); } +TEST_P(AllSocketPairTest, RecvWaitAllDontWait) { + auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); + + char data[100] = {}; + ASSERT_THAT(RetryEINTR(recv)(sockets->second_fd(), data, sizeof(data), + MSG_WAITALL | MSG_DONTWAIT), + SyscallFailsWithErrno(EAGAIN)); +} + } // namespace testing } // namespace gvisor |