To observe events on file descriptors IO_URING supports the `pollAdd` operation. This is useful when you want to observe a file descriptor becoming ready to read or write
This PR adds a new `IORing.Request.PollEvents` option set to model the poll masks. Furthermore, it adds a new `static func pollAdd` to the `IORing.Request`.
We can now use IO_URING to poll for events on file descriptors.
Make OpenOptions.closeOnExec available on Windows, where it maps to
_O_CLOEXEC (O_NOINHERIT). The Windows open adapter already decodes
O_NOINHERIT into a non-inheritable handle, so this produces the
expected close-on-exec semantics. Also add the deprecated O_NOINHERIT
alias, matching the PipeOptions treatment from #312.
Make OpenOptions.closeOnExec available on Windows, where it maps to
_O_CLOEXEC (O_NOINHERIT). The Windows open adapter already decodes
O_NOINHERIT into a non-inheritable handle, so this produces the
expected close-on-exec semantics. Also add the deprecated O_NOINHERIT
alias, matching the PipeOptions treatment from #312.
`true` and `false` import differently with C23 than before, so the swift-side test `(__SWIFT_IORING_SUPPORTED != 0)` became dependent on the toolchain. Integer constants are more reliable for this.
This causes a compilation error because OpenBSD headers that refer to
this aren't `#ifdef` but `#if`, so the define must have a value.
This doesn't actually seem to be necessary on OpenBSD, so let's just
remove it on OpenBSD.
FileDescriptor.open traps when options contains .create but permissions
is nil. The previous precondition could elide its message in optimized
builds, leaving users to hunt through source to diagnose the crash.
Use fatalError with a descriptive message so the reason is always
present in the crash dump, and document the trapping behavior.
Fixes#78
The compiler now imports these as their canonical type, allowing us to
directly use without the explicit type cast. Due to the floor of Swift
6.3, we must preserve the type cast values. Introduce an overlay to
explicitly cast the values in the older compilers.