From 635b2589494c97e48c62514bc8b37ced762e0a62 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Fri, 19 Jan 2024 10:43:19 +0000 Subject: [PATCH] no confstr on Android (#2627) --- Sources/NIOFileSystem/Internal/System Calls/Syscall.swift | 2 ++ Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Sources/NIOFileSystem/Internal/System Calls/Syscall.swift b/Sources/NIOFileSystem/Internal/System Calls/Syscall.swift index 5fcc8861c9..423dd56bb9 100644 --- a/Sources/NIOFileSystem/Internal/System Calls/Syscall.swift +++ b/Sources/NIOFileSystem/Internal/System Calls/Syscall.swift @@ -308,6 +308,7 @@ public enum Libc { } } + #if !os(Android) static func constr(_ name: CInt) -> Result { var buffer = [CInterop.PlatformChar](repeating: 0, count: 128) @@ -331,6 +332,7 @@ public enum Libc { } } while true } + #endif static func ftsOpen(_ path: FilePath, options: FTSOpenOptions) -> Result { // 'fts_open' needs an unsafe mutable pointer to the C-string, `FilePath` doesn't offer this diff --git a/Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift b/Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift index 7f42c3e796..be043e9dec 100644 --- a/Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift +++ b/Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift @@ -384,6 +384,7 @@ internal func libc_getcwd( } /// confstr(3) +#if !os(Android) internal func libc_confstr( _ name: CInt, _ buffer: UnsafeMutablePointer, @@ -391,6 +392,7 @@ internal func libc_confstr( ) -> Int { return confstr(name, buffer, size) } +#endif /// fts(3) internal func libc_fts_open(