diff --git a/Sources/System/FileSystem/FileFlags.swift b/Sources/System/FileSystem/FileFlags.swift index 8fb5493..5a905ed 100644 --- a/Sources/System/FileSystem/FileFlags.swift +++ b/Sources/System/FileSystem/FileFlags.swift @@ -39,10 +39,6 @@ // |------------------|---------------|---------------|---------------| #if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD) -@available(System 99, *) -extension CInterop { - public typealias FileFlags = UInt32 -} /// File-specific flags found in the `st_flags` property of a `stat` struct /// or used as input to `chflags()`. diff --git a/Sources/System/Internals/CInterop.swift b/Sources/System/Internals/CInterop.swift index 7a35b09..4640663 100644 --- a/Sources/System/Internals/CInterop.swift +++ b/Sources/System/Internals/CInterop.swift @@ -78,12 +78,18 @@ public enum CInterop { /// on API. public typealias PlatformUnicodeEncoding = UTF8 #endif +} - #if !os(Windows) +#if !os(Windows) +@available(System 99, *) +extension CInterop { public typealias Stat = stat public typealias DeviceID = dev_t public typealias Inode = ino_t public typealias UserID = uid_t public typealias GroupID = gid_t + #if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD) + public typealias FileFlags = UInt32 #endif } +#endif diff --git a/Sources/System/Internals/Exports.swift b/Sources/System/Internals/Exports.swift index 58d0db8..15ee45c 100644 --- a/Sources/System/Internals/Exports.swift +++ b/Sources/System/Internals/Exports.swift @@ -91,15 +91,19 @@ internal func system_strlen(_ s: UnsafeMutablePointer) -> Int { } #if !os(Windows) +@available(System 99, *) internal func system_stat(_ p: UnsafePointer, _ s: inout CInterop.Stat) -> Int32 { stat(p, &s) } +@available(System 99, *) internal func system_lstat(_ p: UnsafePointer, _ s: inout CInterop.Stat) -> Int32 { lstat(p, &s) } +@available(System 99, *) internal func system_fstat(_ fd: CInt, _ s: inout CInterop.Stat) -> Int32 { fstat(fd, &s) } +@available(System 99, *) internal func system_fstatat(_ fd: CInt, _ p: UnsafePointer, _ s: inout CInterop.Stat, _ flags: CInt) -> Int32 { fstatat(fd, p, &s, flags) }