Yordan Pavlov
Yordan Pavlov

Reputation: 1333

Number of watched file descriptors inside a epoll

I am looking for a way to check the current number of file descriptors being monitored by an epoll instance. I use the following for creating and populating the epoll instance

epoll_create
epoll_ctl

Platform is Gnu/Linux.

Upvotes: 5

Views: 1750

Answers (1)

Noushad
Noushad

Reputation: 106

As far as I know, there is no system call available which can provide the count of file descriptors which are getting monitored by epoll. You can achieve this by maintaining one counter variable. Increment/decrement this variable after successfully adding/removing the file descriptor to the epoll using epoll_ctl().

Upvotes: 2

Related Questions