Skip to content

Commit a3e5c9b

Browse files
committed
use explicit error set for io_uring
1 parent 4c3fa55 commit a3e5c9b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/backend/io_uring.zig

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,25 @@ pub const Loop = struct {
159159
}
160160
}
161161

162+
/// The errors that can come from submit. This has to be explicit
163+
/// for now since Zig 0.11 has issues with the inferred error set.
164+
/// We should try again someday.
165+
pub const SubmitError = error{
166+
Unexpected,
167+
SystemResources,
168+
FileDescriptorInvalid,
169+
FileDescriptorInBadState,
170+
CompletionQueueOvercommitted,
171+
SubmissionQueueEntryInvalid,
172+
BufferInvalid,
173+
RingShuttingDown,
174+
OpcodeNotSupported,
175+
SignalInterrupt,
176+
};
177+
162178
/// Submit all queued operations. This never does an io_uring submit
163179
/// and wait operation.
164-
pub fn submit(self: *Loop) !void {
180+
pub fn submit(self: *Loop) SubmitError!void {
165181
_ = try self.ring.submit();
166182

167183
// If we have any submissions that failed to submit, we try to

0 commit comments

Comments
 (0)