[libc-commits] [libc] ae2012d - [libc] Disable epoll_create fail test when SYS_epoll_create1 is used internally (#99785)

via libc-commits libc-commits at lists.llvm.org
Sat Jul 20 15:30:35 PDT 2024


Author: Mikhail R. Gadelha
Date: 2024-07-20T19:30:31-03:00
New Revision: ae2012d701827f224df04d0ae57e89472c1322d2

URL: https://github.com/llvm/llvm-project/commit/ae2012d701827f224df04d0ae57e89472c1322d2
DIFF: https://github.com/llvm/llvm-project/commit/ae2012d701827f224df04d0ae57e89472c1322d2.diff

LOG: [libc] Disable epoll_create fail test when SYS_epoll_create1 is used internally (#99785)

The fail test case only makes sense if SYS_epoll_create is used internally to implement epoll_create, since the only argument to epoll_create (size) is dropped if SYS_epoll_create1 is used.

Added: 
    

Modified: 
    libc/test/src/sys/epoll/linux/epoll_create_test.cpp

Removed: 
    


################################################################################
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 fdcdcf8eb4271..9c4bad10c8384 100644
--- a/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
+++ b/libc/test/src/sys/epoll/linux/epoll_create_test.cpp
@@ -10,6 +10,7 @@
 #include "src/unistd/close.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
+#include <sys/syscall.h> // For syscall numbers.
 
 using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
 
@@ -21,6 +22,8 @@ TEST(LlvmLibcEpollCreateTest, Basic) {
   ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds());
 }
 
+#ifdef SYS_epoll_create
 TEST(LlvmLibcEpollCreateTest, Fails) {
   ASSERT_THAT(LIBC_NAMESPACE::epoll_create(0), Fails(EINVAL));
 }
+#endif


        


More information about the libc-commits mailing list