15 Commits

Author SHA1 Message Date
Joran Dirk Greef
77903f8d4e Test structs and offsets 2020-09-20 18:45:44 +02:00
Joran Dirk Greef
e51728a1b4 Make enter(), flush_sq(), sq_ring_needs_enter(), cq_ring_needs_flush() public
These will also be needed by any custom helpers
2020-09-20 15:54:31 +02:00
Joran Dirk Greef
40293a0643 Add safety checks 2020-09-20 15:41:22 +02:00
Joran Dirk Greef
f22eea82c4 Fix opcode support detection for read/write test 2020-09-20 15:33:48 +02:00
Joran Dirk Greef
b672dc7abf Use os.fd_t instead of i32 and assert against c_int for syscall safety 2020-09-20 14:59:40 +02:00
Joran Dirk Greef
abebacda32 Handle all possible syscall errors and bring errors in line with os.zig 2020-09-20 14:21:44 +02:00
Joran Dirk Greef
4bc1b7a7ac Fix io_uring_sqe to use the names of the first member of each union
Now we're really future-proof... no more `opflags` creeping in.

When anonymous unions land, we can start using `accept_flags` etc.

Until then, code using this struct won't break when the kernel adds features.

Refs: https://github.com/ziglang/zig/issues/6349
Refs: https://github.com/ziglang/zig/issues/985
2020-09-19 18:50:24 +02:00
Joran Dirk Greef
92407bfcd7 Upgrade check_errno() to an exhaustive switch (safer) 2020-09-19 18:29:50 +02:00
Joran Dirk Greef
ba18420b27 Zero the SQE slot and assign, instead of initializing with default values 2020-09-19 18:17:06 +02:00
Joran Dirk Greef
f4df2f091a Allow the kernel to drive feature detection 2020-09-19 17:31:39 +02:00
Joran Dirk Greef
64ae9a6a87 Rename to error.SubmissionQueueFull 2020-09-19 16:54:44 +02:00
Joran Dirk Greef
c1f9d10b6a Remove unused import aliases 2020-09-19 16:51:35 +02:00
Joran Dirk Greef
9fabae2a28 Return error.UnsupportedKernel for ENOSYS 2020-09-19 16:47:05 +02:00
Joran Dirk Greef
cb591285d7 Use linux.IORING_SQ_CQ_OVERFLOW 2020-09-19 16:20:21 +02:00
Joran Dirk Greef
31533eb743 Move to std/os/linux 2020-09-19 16:18:04 +02:00