Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use up-to-date system call to create epoll context #5821

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/ae_epoll.c
Expand Up @@ -45,7 +45,13 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
zfree(state);
return -1;
}
state->epfd = epoll_create(1024); /* 1024 is just a hint for the kernel */
#ifdef EPOLL_CLOEXEC
state->epfd = epoll_create1(EPOLL_CLOEXEC);
#else
/* Create the kernel epoll using the old interface.
* Since Linux 2.6.8, the size argument is ignored */
state->epfd = epoll_create(1024);
#endif
if (state->epfd == -1) {
zfree(state->events);
zfree(state);
Expand Down