Skip to content

gspawn: Handle ENOSYS from close_range()

Philip Withnall requested to merge pwithnall/glib:close-range-enosys into master

It’s possible that GLib will eventually be compiled against a version of libc which supports close_range() (hence HAVE_CLOSE_RANGE will be defined), but then run against an older kernel which doesn’t support it. In this case, we want to fall back to fdwalk(), which should work on such systems.

This is what cpython does: https://github.com/python/cpython/blob/3529718925f40d14ed48d281d809187bc7314a14/Python/fileutils.c#L2227

Spotted by Allison Karlitskaya in !1688 (merged).

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Merge request reports