_SC_OPEN_MAX is quite high on FreeBSD, which makes this close() loop a quite obvious problem when attempting to do any kind of debugging in a process that uses StartSubprocess. Switch to using close_range(2) instead to close them all in a single syscall and dramatically reduce the runtime and syscall trace noise Linux has an equivalent syscall, but I do not have the capacity to test that it works there, so this is limited to SANITIZER_FREEBSD for the time being.
88 KiB
88 KiB