Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc/src/sys/epoll/linux/epoll_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ LLVM_LIBC_FUNCTION(int, epoll_create, ([[maybe_unused]] int size)) {
#ifdef SYS_epoll_create
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_epoll_create, size);
#elif defined(SYS_epoll_create1)
if (size == 0) {
libc_errno = EINVAL;
return -1;
}

int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_epoll_create1, 0);
#else
#error \
Expand Down
3 changes: 0 additions & 3 deletions libc/test/src/sys/epoll/linux/epoll_create_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Loading