Handle BSD Too many open files in system (os error 23)
We currently handle inotify limits.
We should also handle this for BSD as code 23. Not sure if this is with kqueue, and where exactly this error comes up. Would need a BSD person to check this.
Origin: https://github.com/extrawurst/gitui/issues/1439
It's an error with kqueue (or the kqueue implementation) and I received it on macOS as well when I was using RecommendedWatcher with features = [ "macos_kqueue" ]. The file limit seems relatively low, as I experienced this with a directory with "only" 28,850 files/entries across its descendants.
Note that every folder counts too. It is an inode limit enforced by the OS which we can only gracefully hand to the user of the lib.
The count included folders as well, fwiw. Edit: Or maybe not, I’d have to double check.
I imagine it’s possible to paper around this by watching the root directly non-recursively and child directories recursively individually but almost certainly out of scope for the crate.