I'm rewriting a multithread Linux-2.6.32+ application to replace select
with epoll
.
The man pages for epoll_create1(2) declare that:
If flags is 0, then, other than the fact that the obsolete size argument is dropped, epoll_create1() is the same as epoll_create().
Yet, isn't this obsolete size argument used in epoll_wait(2)
as maxevents
?
epoll_wait(int epfd, struct epoll_event *events,
int maxevents, int timeout);
This means when using epoll we can avoid declaring the maximum number of events in epoll_create1
but sooner or later we have to reference it when calling epoll_wait
? If so, what's the point of bringing epoll_create1
into the game?
Thanks for enlighten me on this subject.
epoll_create1
I just let the kernel itself to dimension it's internal structures, alright. I was thinking themaxevents
parameter was going to be dropped as well but that's not the case. – Whitelivered