From a6675d7e5c54d7a9dfdae14451aa48b6d86f819c Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 10 Jul 2025 23:22:11 +0000 Subject: [PATCH] timespec should be compatible here, let's try it to fix the Ubuntu 22 build --- Sources/System/IORing.swift | 12 ++++++------ Sources/System/RawIORequest.swift | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/System/IORing.swift b/Sources/System/IORing.swift index cb47e34..6a281a0 100644 --- a/Sources/System/IORing.swift +++ b/Sources/System/IORing.swift @@ -479,9 +479,9 @@ public struct IORing: ~Copyable { timeout: Duration? = nil ) throws(Errno) -> Completion { if let timeout { - var ts = __kernel_timespec( - tv_sec: timeout.components.seconds, - tv_nsec: timeout.components.attoseconds / 1_000_000_000 + var ts = timespec( + tv_sec: Int(timeout.components.seconds), + tv_nsec: Int(timeout.components.attoseconds / 1_000_000_000) ) return try withUnsafePointer(to: &ts) { (tsPtr) throws(Errno) -> Completion in var args = swift_io_uring_getevents_arg( @@ -505,9 +505,9 @@ public struct IORing: ~Copyable { consumer: (consuming Completion?, Errno?, Bool) throws(Err) -> Void ) throws(Err) { if let timeout { - var ts = __kernel_timespec( - tv_sec: timeout.components.seconds, - tv_nsec: timeout.components.attoseconds / 1_000_000_000 + var ts = timespec( + tv_sec: Int(timeout.components.seconds), + tv_nsec: Int(timeout.components.attoseconds / 1_000_000_000) ) try withUnsafePointer(to: &ts) { (tsPtr) throws(Err) in var args = swift_io_uring_getevents_arg( diff --git a/Sources/System/RawIORequest.swift b/Sources/System/RawIORequest.swift index 461bae0..b22c1c7 100644 --- a/Sources/System/RawIORequest.swift +++ b/Sources/System/RawIORequest.swift @@ -184,9 +184,9 @@ extension RawIORequest { opEntry.pointee.flags |= Flags.linkRequest.rawValue opEntry.pointee.off = 1 - var ts = __kernel_timespec( - tv_sec: duration.components.seconds, - tv_nsec: duration.components.attoseconds / 1_000_000_000 + var ts = timespec( + tv_sec: Int(duration.components.seconds), + tv_nsec: Int(duration.components.attoseconds / 1_000_000_000) ) return try withUnsafePointer(to: &ts) { tsPtr in var req: RawIORequest = RawIORequest()