[libc-commits] [libc] [libc] Disable epoll_create fail test when SYS_epoll_create1 is used internally (PR #99785)
via libc-commits
libc-commits at lists.llvm.org
Sat Jul 20 14:41:17 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Mikhail R. Gadelha (mikhailramalho)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/99785.diff
1 Files Affected:
- (modified) libc/test/src/sys/epoll/linux/epoll_create_test.cpp (+3)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/99785
More information about the libc-commits
mailing list