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:

Spotted by Allison Karlitskaya in !1688 (merged).

Signed-off-by: Philip Withnall

Merge request reports