GNOME Bugzilla – Bug 796227
[PATCH] fdwalk: use rlim_cur not rlim_max
Last modified: 2018-05-18 00:42:38 UTC
The current limit on number of open files, as returned by getrlimit, is in rlim_cur (and rlim_max is the ceiling for rlim_cur, i.e. how much it can be raised). This should improve performance of g_spawn_*() in (a practically pretty rare) case when /proc is not available.
On a second thought, I think that the following scenario is possible: - open many fds - lower the rlim_current - call fdwalk() and in this case some fds might be left out. Ergo my patch is wrong.