diff --git a/Sources/Commands/SwiftRunCommand.swift b/Sources/Commands/SwiftRunCommand.swift index 5bc94fb8bdc..1acf3ddebaa 100644 --- a/Sources/Commands/SwiftRunCommand.swift +++ b/Sources/Commands/SwiftRunCommand.swift @@ -312,16 +312,20 @@ public struct SwiftRunCommand: AsyncSwiftCommand { sigfillset(&sig_set_all) sigprocmask(SIG_UNBLOCK, &sig_set_all, nil) + #if os(FreeBSD) || os(OpenBSD) + closefrom(3) + #else #if os(Android) let number_fds = Int32(sysconf(_SC_OPEN_MAX)) #else let number_fds = getdtablesize() - #endif + #endif /* os(Android) */ // 2. close all file descriptors. for i in 3..