From 6ef5bdab21e1e700a362a38435b57c9a1010aaf4 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Tue, 9 Mar 2021 17:36:02 -0800 Subject: Allow reading from PTY into bad buffer to return EAGAIN. Kernels after 3b830a9c return EAGAIN in this case. PiperOrigin-RevId: 361936327 --- test/syscalls/linux/pty.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/syscalls/linux') diff --git a/test/syscalls/linux/pty.cc b/test/syscalls/linux/pty.cc index 294b9f6fd..8d15c491e 100644 --- a/test/syscalls/linux/pty.cc +++ b/test/syscalls/linux/pty.cc @@ -1255,8 +1255,11 @@ TEST_F(PtyTest, PartialBadBuffer) { // Read from the replica into bad_buffer. ASSERT_NO_ERRNO(WaitUntilReceived(replica_.get(), size)); - EXPECT_THAT(ReadFd(replica_.get(), bad_buffer, size), - SyscallFailsWithErrno(EFAULT)); + // Before Linux 3b830a9c this returned EFAULT, but after that commit it + // returns EAGAIN. + EXPECT_THAT( + ReadFd(replica_.get(), bad_buffer, size), + AnyOf(SyscallFailsWithErrno(EFAULT), SyscallFailsWithErrno(EAGAIN))); EXPECT_THAT(munmap(addr, 2 * kPageSize), SyscallSucceeds()) << addr; } -- cgit v1.2.3