LibVNC / libvncserver

LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
GNU General Public License v2.0
1.07k stars 481 forks source link

Stop counting fds after enough free ones are encountered #601

Open Earlopain opened 7 months ago

Earlopain commented 7 months ago

On systems with incredibly high RLIMIT_NOFILE (either intentionally or by accident) this can take quite a large amount of time. Instead of checking them all, just stop after enough free ones have been encountered. 100k is a rather large number for that but the time needed to do this is quite low. My system does about about 7 million per second.

Closes #600

Disclaimer: I haven't properly tested this since I don't know how. I'd love some pointers on that.