Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Number of watched file descriptors inside a epoll

Tags:

linux

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.

like image 294
Yordan Pavlov Avatar asked Nov 02 '22 23:11

Yordan Pavlov


1 Answers

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().

like image 158
Noushad Avatar answered Dec 05 '22 14:12

Noushad