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()