Could you confirm that it works on OpenBSD and that there’s no performance regression? Andrew: it removes the /proc/self/fd loop you added to fix , but it reduces the number of ‘close’ calls in the child. Could you check whether that’s okay performance-wise? Eventually I plan to use ‘posix_spawn_file_actions_addclosefrom_np’ on glibc >= 2.34, but I have yet to test it. That will be the best solution. Josselin: I simplified the ‘dup2’ logic somewhat. Feedback welcome! > The regress passes and while this workaround may be temporarly > acceptable I -personally- don't like it much. There's a reason guile > can't set CLOEXEC for all the file descriptors > 2 obtained via open, > socket, pipe, ... like perl -for example- does? Guile does that for file descriptors it opens internally, but applications using ‘open-file’ without the recently-added “e” flag, or ‘socket’ without ‘SOCK_CLOEXEC’, etc., end up with more file descriptors that need to be taken care of. I wish the default were close-on-exec, but we’re not there yet. Thanks, Ludo’.