timespec should be compatible here, let's try it to fix the Ubuntu 22 build

This commit is contained in:
David Smith committed 2025-07-10 23:22:11 +00:00
1 parent 329c5f59a2
commit a6675d7e5c
2 files changed
+9 -9

No files matched your search

+6 -6
View File
@@ -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(
+3 -3
View File
@@ -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()