Skip to content

Commit

Permalink
no confstr on Android (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
glbrntt committed Jan 19, 2024
1 parent c14d7d6 commit 635b258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/NIOFileSystem/Internal/System Calls/Syscall.swift
Expand Up @@ -308,6 +308,7 @@ public enum Libc {
}
}

#if !os(Android)
static func constr(_ name: CInt) -> Result<String, Errno> {
var buffer = [CInterop.PlatformChar](repeating: 0, count: 128)

Expand All @@ -331,6 +332,7 @@ public enum Libc {
}
} while true
}
#endif

static func ftsOpen(_ path: FilePath, options: FTSOpenOptions) -> Result<CInterop.FTSPointer, Errno> {
// 'fts_open' needs an unsafe mutable pointer to the C-string, `FilePath` doesn't offer this
Expand Down
2 changes: 2 additions & 0 deletions Sources/NIOFileSystem/Internal/System Calls/Syscalls.swift
Expand Up @@ -384,13 +384,15 @@ internal func libc_getcwd(
}

/// confstr(3)
#if !os(Android)
internal func libc_confstr(
_ name: CInt,
_ buffer: UnsafeMutablePointer<CInterop.PlatformChar>,
_ size: Int
) -> Int {
return confstr(name, buffer, size)
}
#endif

/// fts(3)
internal func libc_fts_open(
Expand Down

0 comments on commit 635b258

Please sign in to comment.