diff --git a/Sources/Testing/ExitTests/SpawnProcess.swift b/Sources/Testing/ExitTests/SpawnProcess.swift index 66143a7e0..fe51a7086 100644 --- a/Sources/Testing/ExitTests/SpawnProcess.swift +++ b/Sources/Testing/ExitTests/SpawnProcess.swift @@ -137,7 +137,7 @@ func spawnExecutable( // standardized in POSIX.1-2024 (see https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_spawn_file_actions_adddup2.html // and https://www.austingroupbugs.net/view.php?id=411). _ = posix_spawn_file_actions_adddup2(fileActions, fd, fd) -#if canImport(Glibc) +#if canImport(Glibc) && !os(FreeBSD) && !os(OpenBSD) if _slowPath(glibcVersion.major < 2 || (glibcVersion.major == 2 && glibcVersion.minor < 29)) { // This system is using an older version of glibc that does not // implement FD_CLOEXEC clearing in posix_spawn_file_actions_adddup2(), diff --git a/Sources/Testing/Support/Versions.swift b/Sources/Testing/Support/Versions.swift index 1229e80b0..7f190ebb2 100644 --- a/Sources/Testing/Support/Versions.swift +++ b/Sources/Testing/Support/Versions.swift @@ -153,7 +153,7 @@ let swiftStandardLibraryVersion: String = { return "unknown" }() -#if canImport(Glibc) +#if canImport(Glibc) && !os(FreeBSD) && !os(OpenBSD) /// The (runtime, not compile-time) version of glibc in use on this system. /// /// This value is not part of the public interface of the testing library.