Number of file descriptors viewed inside epoll

I am looking for a way to check the current number of file descriptors controlled by an epoll instance. I use the following to create and populate an epoll instance

epoll_create
epoll_ctl

The platform is Gnu / Linux.

+5
source share
1 answer

As far as I know, there is no system call that can provide the number of file descriptors tracked by epoll. You can achieve this by maintaining a single counter variable. Increase / decrease this variable after successfully adding / removing a file descriptor to epoll using epoll_ctl ().

+1
source

All Articles