diff --git a/Sources/NIOPosix/System.swift b/Sources/NIOPosix/System.swift index c221bd40d..b320f20ce 100644 --- a/Sources/NIOPosix/System.swift +++ b/Sources/NIOPosix/System.swift @@ -86,15 +86,17 @@ let S_IFBLK = UInt32(SwiftGlibc.S_IFBLK) private let sysClose = close private let sysShutdown = shutdown private let sysBind = bind -private let sysFcntl: (CInt, CInt, CInt) -> CInt = fcntl +private let sysFcntl: @Sendable @convention(c) (CInt, CInt, CInt) -> CInt = { fcntl($0, $1, $2) } private let sysSocket = socket private let sysSetsockopt = setsockopt private let sysGetsockopt = getsockopt private let sysListen = listen private let sysAccept = accept private let sysConnect = connect -private let sysOpen: (UnsafePointer, CInt) -> CInt = open -private let sysOpenWithMode: (UnsafePointer, CInt, mode_t) -> CInt = open +private let sysOpen: @Sendable @convention(c) (UnsafePointer, CInt) -> CInt = { open($0, $1) } +private let sysOpenWithMode: @Sendable @convention(c) (UnsafePointer, CInt, mode_t) -> CInt = { + open($0, $1, $2) +} private let sysFtruncate = ftruncate private let sysWrite = write private let sysPwrite = pwrite @@ -444,7 +446,7 @@ internal func syscallForbiddingEINVAL( } @usableFromInline -internal enum Posix { +internal enum Posix: Sendable { #if canImport(Darwin) @usableFromInline static let UIO_MAXIOV: Int = 1024 @@ -1059,7 +1061,7 @@ extension Posix { #if canImport(Darwin) @usableFromInline -internal enum KQueue { +internal enum KQueue: Sendable { // TODO: Figure out how to specify a typealias to the kevent struct without run into trouble with the swift compiler