Maxfd is really only useful to poll() and select(), yet epoll and
kqueue reference it almost by mistake :
- cloning of the initial FDs (maxsock should be used here)
- max polled events, it's maxpollevents which should be used here.
Let's fix these places.
* fd for this thread. Let's just mark them as updated, the poller will
* do the rest.
*/
- for (fd = 0; fd < maxfd; fd++)
+ for (fd = 0; fd < global.maxsock; fd++)
updt_fd_polling(fd);
return 1;
else
activity[tid].poll_exp++;
- fd = MIN(maxfd, global.tune.maxpollevents);
+ fd = global.tune.maxpollevents;
gettimeofday(&before_poll, NULL);
status = kevent(kqueue_fd[tid], // int kq
NULL, // const struct kevent *changelist
* fd for this thread. Let's just mark them as updated, the poller will
* do the rest.
*/
- for (fd = 0; fd < maxfd; fd++)
+ for (fd = 0; fd < global.maxsock; fd++)
updt_fd_polling(fd);
return 1;
int fork_poller()
{
int fd;
- for (fd = 0; fd <= maxfd; fd++) {
+ for (fd = 0; fd < global.maxsock; fd++) {
if (fdtab[fd].owner) {
fdtab[fd].cloned = 1;
}