diff --git a/Sources/System/FilePath/FilePathTempPosix.swift b/Sources/System/FilePath/FilePathTempPosix.swift index 2ac7098a..fa88cfe5 100644 --- a/Sources/System/FilePath/FilePathTempPosix.swift +++ b/Sources/System/FilePath/FilePathTempPosix.swift @@ -12,15 +12,15 @@ #if SYSTEM_PACKAGE_DARWIN import Darwin #elseif canImport(Glibc) -import CSystem +internal import CSystem import Glibc #elseif canImport(Musl) -import CSystem +internal import CSystem import Musl #elseif canImport(WASILibc) import WASILibc #elseif canImport(Android) -import CSystem +internal import CSystem import Android #else #error("Unsupported Platform") diff --git a/Sources/System/FileSystem/Stat.swift b/Sources/System/FileSystem/Stat.swift index ce4b6b5a..f1613310 100644 --- a/Sources/System/FileSystem/Stat.swift +++ b/Sources/System/FileSystem/Stat.swift @@ -15,15 +15,15 @@ #if SYSTEM_PACKAGE_DARWIN import Darwin #elseif canImport(Glibc) -import CSystem +internal import CSystem import Glibc #elseif canImport(Musl) -import CSystem +internal import CSystem import Musl #elseif canImport(WASILibc) import WASILibc #elseif canImport(Android) -import CSystem +internal import CSystem import Android #else #error("Unsupported Platform") diff --git a/Sources/System/IORing/IOCompletion.swift b/Sources/System/IORing/IOCompletion.swift index d9e69050..87c2acd9 100644 --- a/Sources/System/IORing/IOCompletion.swift +++ b/Sources/System/IORing/IOCompletion.swift @@ -1,7 +1,7 @@ #if compiler(>=6.2) && $Lifetimes #if os(Linux) -import CSystem +internal import CSystem public extension IORing { struct Completion: ~Copyable { diff --git a/Sources/System/IORing/IORequest.swift b/Sources/System/IORing/IORequest.swift index 4a388c49..a78ed2f5 100644 --- a/Sources/System/IORing/IORequest.swift +++ b/Sources/System/IORing/IORequest.swift @@ -1,7 +1,7 @@ #if compiler(>=6.2) && $Lifetimes #if os(Linux) -import CSystem +internal import CSystem @usableFromInline internal enum IORequestCore { diff --git a/Sources/System/IORing/IORing+Util.swift b/Sources/System/IORing/IORing+Util.swift index be258867..d373568d 100644 --- a/Sources/System/IORing/IORing+Util.swift +++ b/Sources/System/IORing/IORing+Util.swift @@ -10,7 +10,7 @@ #if compiler(>=6.2) && $Lifetimes #if os(Linux) -import CSystem +internal import CSystem #if canImport(Glibc) import Glibc #elseif canImport(Musl) diff --git a/Sources/System/IORing/IORing.swift b/Sources/System/IORing/IORing.swift index 27d27a0e..0346f0fc 100644 --- a/Sources/System/IORing/IORing.swift +++ b/Sources/System/IORing/IORing.swift @@ -1,7 +1,7 @@ #if compiler(>=6.2) && $Lifetimes #if os(Linux) -import CSystem +internal import CSystem // needed for mmap #if canImport(Glibc) import Glibc diff --git a/Sources/System/IORing/RawIORequest.swift b/Sources/System/IORing/RawIORequest.swift index 40156ddc..aca0f5c8 100644 --- a/Sources/System/IORing/RawIORequest.swift +++ b/Sources/System/IORing/RawIORequest.swift @@ -1,7 +1,7 @@ #if compiler(>=6.2) && $Lifetimes #if os(Linux) -import CSystem +internal import CSystem #if canImport(Glibc) import Glibc #elseif canImport(Musl) diff --git a/Sources/System/Internals/CInterop.swift b/Sources/System/Internals/CInterop.swift index 5570d1e0..8ef0f128 100644 --- a/Sources/System/Internals/CInterop.swift +++ b/Sources/System/Internals/CInterop.swift @@ -10,18 +10,18 @@ #if SYSTEM_PACKAGE_DARWIN import Darwin #elseif os(Windows) -import CSystem +internal import CSystem import ucrt #elseif canImport(Glibc) -import CSystem +internal import CSystem import Glibc #elseif canImport(Musl) -import CSystem +internal import CSystem import Musl #elseif canImport(WASILibc) import WASILibc #elseif canImport(Bionic) -import CSystem +internal import CSystem import Bionic #else #error("Unsupported Platform") diff --git a/Sources/System/Internals/Constants.swift b/Sources/System/Internals/Constants.swift index 656e2c38..7b08d933 100644 --- a/Sources/System/Internals/Constants.swift +++ b/Sources/System/Internals/Constants.swift @@ -27,7 +27,11 @@ import Android #error("Unsupported Platform") #endif -import CSystem +#if os(FreeBSD) +public import CSystem +#else +internal import CSystem +#endif // MARK: errno #if SYSTEM_PACKAGE_DARWIN diff --git a/Sources/System/Internals/Exports.swift b/Sources/System/Internals/Exports.swift index 088a3251..f2e1cbc6 100644 --- a/Sources/System/Internals/Exports.swift +++ b/Sources/System/Internals/Exports.swift @@ -15,18 +15,18 @@ #if SYSTEM_PACKAGE_DARWIN import Darwin #elseif os(Windows) -import CSystem +internal import CSystem import ucrt #elseif canImport(Glibc) -import CSystem +internal import CSystem import Glibc #elseif canImport(Musl) -import CSystem +internal import CSystem import Musl #elseif canImport(WASILibc) import WASILibc #elseif canImport(Android) -import CSystem +internal import CSystem import Android #else #error("Unsupported Platform") diff --git a/Sources/System/Internals/Syscalls.swift b/Sources/System/Internals/Syscalls.swift index b0d9dae1..09090299 100644 --- a/Sources/System/Internals/Syscalls.swift +++ b/Sources/System/Internals/Syscalls.swift @@ -7,7 +7,7 @@ See https://swift.org/LICENSE.txt for license information */ -import CSystem +internal import CSystem #if SYSTEM_PACKAGE_DARWIN import Darwin #elseif canImport(Glibc) diff --git a/Tests/SystemTests/FileTypesTest.swift b/Tests/SystemTests/FileTypesTest.swift index 0ddcb0de..76f99113 100644 --- a/Tests/SystemTests/FileTypesTest.swift +++ b/Tests/SystemTests/FileTypesTest.swift @@ -55,6 +55,15 @@ final class FileDescriptorTest: XCTestCase { #if SYSTEM_PACKAGE_DARWIN XCTAssertEqual(O_SYMLINK, FileDescriptor.OpenOptions.symlink.rawValue) XCTAssertEqual(O_EVTONLY, FileDescriptor.OpenOptions.eventOnly.rawValue) + + if #available(macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, visionOS 27.0, *) { + XCTAssertEqual( + O_CLOFORK, FileDescriptor.PipeOptions.closeOnFork.rawValue + ) + XCTAssertEqual( + O_CLOFORK, FileDescriptor.DuplicateOptions.closeOnFork.rawValue + ) + } #endif #if os(FreeBSD)