是否有必要在关闭 epoll 实例本身之前删除兴趣列表中的所有文件描述符?

Is it necessary to remove all file descriptors in the interest list before closing the epoll instance itself?

前提是:

manual page 没有说明我是否必须 EPOLL_CTL_DEL close(epfd) 之前的所有文件描述符。

所以,我的问题是:

是否有必要在关闭epoll实例本身之前删除兴趣列表中的所有文件描述符?

不,没有必要手动删除它们。

来自epoll_create(2) manpage(强调已添加)

When all file descriptors referring to an epoll instance have been closed, the kernel destroys the instance and releases the associated resources for reuse.