summaryrefslogtreecommitdiff
path: root/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
diff options
context:
space:
mode:
authorMikhail R. Gadelha <mikhail@igalia.com>2025-07-20 15:40:55 -0300
committerGitHub <noreply@github.com>2025-07-20 15:40:55 -0300
commit04b4f62e2f91a66ad47276f6e344afd0be17a325 (patch)
tree56a53259c1f023549b7ec21833fb75406a5802a1 /libc/test/src/sys/epoll/linux/epoll_create_test.cpp
parentc045caae86a60cdcdd10ed693cfd5c507c743801 (diff)
[libc] Fix epoll_create behavior when only epoll_create1 is available (#149713)
In PR #99785, I disabled a test for `epoll_create` that was intended to fail on systems where only `epoll_create1` is available. This is because `epoll_create1` cannot fail in the same way that `epoll_create` does. Specifically, calling `epoll_create(0)` should result in an EINVAL error. So, when only `epoll_create1` is available, we should simply check if the argument is zero and return the error accordingly.
Diffstat (limited to 'libc/test/src/sys/epoll/linux/epoll_create_test.cpp')
-rw-r--r--libc/test/src/sys/epoll/linux/epoll_create_test.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/libc/test/src/sys/epoll/linux/epoll_create_test.cpp b/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
index 06c17c6cf29e..2bbfe4fbe81f 100644
--- a/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
+++ b/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
@@ -10,7 +10,6 @@
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <sys/syscall.h> // For syscall numbers.
using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
using LlvmLibcEpollCreateTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
@@ -23,8 +22,6 @@ TEST_F(LlvmLibcEpollCreateTest, Basic) {
ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds());
}
-#ifdef SYS_epoll_create
TEST_F(LlvmLibcEpollCreateTest, Fails) {
ASSERT_THAT(LIBC_NAMESPACE::epoll_create(0), Fails(EINVAL));
}
-#endif