net: add Linux epoll fdwatch backend
Some checks failed
build / Linux asan (push) Has been cancelled
build / Linux release (push) Has been cancelled
build / FreeBSD build (push) Has been cancelled

This commit is contained in:
server
2026-04-14 07:57:02 +02:00
parent e638816026
commit e2c43240ec
4 changed files with 284 additions and 2 deletions

View File

@@ -297,7 +297,11 @@ void TestFdwatchBackendMetadata()
LPFDWATCH fdw = fdwatch_new(4096);
Expect(fdw != nullptr, "fdwatch_new for backend metadata failed");
#ifdef __USE_SELECT__
#ifdef __linux__
Expect(fdwatch_get_backend(fdw) == FDWATCH_BACKEND_EPOLL, "Expected epoll backend");
Expect(std::strcmp(fdwatch_backend_name(fdwatch_get_backend(fdw)), "epoll") == 0, "Unexpected epoll backend name");
Expect(fdwatch_get_descriptor_limit(fdw) == 4096, "Unexpected epoll descriptor limit");
#elif defined(__USE_SELECT__)
Expect(fdwatch_get_backend(fdw) == FDWATCH_BACKEND_SELECT, "Expected select backend");
Expect(std::strcmp(fdwatch_backend_name(fdwatch_get_backend(fdw)), "select") == 0, "Unexpected select backend name");
Expect(fdwatch_get_descriptor_limit(fdw) == std::min(4096, static_cast<int>(FD_SETSIZE)), "Unexpected select descriptor limit");