| Age | Commit message (Collapse) | Author |
|
* io_uring: fix the timeout_remove test
The test does a IORING_OP_TIMEOUT followed with a IORING_OP_TIMEOUT_REMOVE
and assumed we would get the CQEs in the same order.
Linux v5.18 changed how this works and we now get them in the reverse order.
The documentation doesn't explicitly say which CQE we should get first
so just make the test work with both cases.
* io_uring: fix the remove_buffers test
The original test was buggy but accidentally worked with kernels < 5.18
The test assumed that IORING_OP_REMOVE_BUFFERS removed from the start of
but in fact the documentation doesn't specify which buffer is removed,
only that a certain number of buffers are removed.
Starting with the kernel 5.18 the check for the `used_buffer_id` fails.
Turns out that previous kernels removed buffers in such a way that the
remaining buffer for this read would always be 0, however this isn't
true anymore.
Instead of checking a specific value just check that the `used_buffer_id`
corresponds to a valid ID.
|
|
See #12014
|
|
alongside the typical msghdr struct, Zig has added a msghdr_const
type that can be used with sendmsg which allows const data to
be provided. I believe that data pointed to by the iov and control
fields in msghdr are also left unmodified, in which case they can
be marked const as well.
|
|
|
|
readv() is essentially identical to read() except for the buffer type,
this simplifies the API for the caller at the cost of not clearly mapping to the liburing C API.
|
|
|
|
|
|
|
|
RecvBuffer is equivalent to ReadBuffer but tailored for recv only.
|
|
Reads can be done in two ways with io_uring:
* using a simple buffer
* using a automatic buffer selection which requires the user to have
provided a number of buffers before
ReadBuffer let's the caller choose where the data should be read.
|
|
These functions are needed to implement automatic buffer selection.
This maps to the IORING_OP_PROVIDE_BUFFERS and IORING_OP_PROVIDE_BUFFERS ops.
|
|
Fixes #11382. Tested on ArchLinux 5.17.5-arch1-1.
|
|
* os/linux/io_uring: add recvmsg and sendmsg
* Use std.os.iovec and std.os.iovec_const
* Remove msg_ prefix in msghdr and msghdr_const in arm64 etc
* Strip msg_ prefix in msghdr and msghdr_const for linux arm-eabi
* Copy msghdr and msghdr_const from i386 to mips
* Add sockaddr to lib/std/os/linux/mips.zig
* Copy msghdr and msghdr_const from x86_64 to riscv64
|
|
copy_cqes() is not guaranteed to return as many CQEs as provided in the
`wait_nr` argument, meaning the assert in `copy_cqe` can trigger.
Instead, loop until we do get at least one CQE returned.
This mimics the behaviour of liburing's _io_uring_get_cqe.
|
|
For renameat, unlinkat, mkdirat, symlinkat and linkat the error code
differs between kernel 5.4 which returns EBADF and kernel 5.10 which returns EINVAL.
Fixes #10466
|
|
zig fmt now replaces c_void with anyopaque to make updating
code easy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The old test "timeout_link_chain1" was ported from liburing test_timeout_link_chain1
https://github.com/axboe/liburing/blob/509873c4454012c5810c728695c21911c82acdc4/test/link-timeout.c#L539-L628
However it turns out that both fails with EBADF (-9) on Linux kernel 5.4.
The this new test skips properly on Linux kernel 5.4
and passes on Linux kernel 5.11.
|
|
See #10247
|
|
io_uring: adds link_timeout
|
|
|
|
std.os.linux: Add cancel and io_uring_prep_cancel
|
|
Add method from liburing to queue (but not submit) a SQE to update the
user data of an existing poll operation.
|
|
follow liburing's API as closely as possible.
Signed-off-by: Hiroaki Nakamura <hnakamur@gmail.com>
|
|
Signed-off-by: Hiroaki Nakamura <hnakamur@gmail.com>
|
|
|
|
|
|
closes #9388
closes #9321
|
|
|
|
I incorrectly assumed that __kernel_timespec was used when not linking
libc, however that is not the case. `std.os.timespec` is used both for
libc and non-libc cases. `__kernel_timespec` is a special struct that is
used only for io_uring.
|
|
Also move some usingnamespace test cases from compare_output to
behavior.
|
|
The proposal #9629 is now accepted, usingnamespace stays but no longer
puts identifiers in scope.
|
|
* std lib tests are passing on x86_64-linux with and without -lc
* stage2 is building from source on x86_64-linux
* down to 38 remaining uses of `usingnamespace`
|
|
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.
Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
|
|
The primary purpose of this change is to eliminate one usage of
`usingnamespace` in the standard library - specifically the usage for
errno values in `std.os.linux`.
This is accomplished by truncating the `E` prefix from error values, and
making errno a proper enum.
A similar strategy can be used to eliminate some other `usingnamespace`
sites in the std lib.
|
|
* Expose register_eventfd, register_eventfd_async, unregister_eventfd in the IO URing API
* Fixing formatting
* Fixing typo
* Removing unnecessary casts and adding better comments for a single registration of eventfd
* Update lib/std/os/linux/io_uring.zig
Co-authored-by: Joran Dirk Greef <joran@coil.com>
* Update lib/std/os/linux/io_uring.zig
Co-authored-by: Joran Dirk Greef <joran@coil.com>
* Updating util function name
Co-authored-by: Joran Dirk Greef <joran@coil.com>
|
|
Implement io_uring submission queue entry preparation methods for
epoll_ctl, poll_add and poll_remove.
Poll masks are designated as 32-bit little-endian integers as
specified in liburing's definitions.
Updated io_uring_prep_rw to take in an unsigned 64-bit address instead
of an anytype. io_uring_sqe by default assumes that the address
specified in a submission queue entry is an unsigned 64-bit integer.
|
|
|
|
|
|
|
|
|
|
|
|
Beside handling NaNs and other non-numeric values better we finally
offer the same pair of testing predicates in math and testing.
|
|
liburing commit: https://github.com/axboe/liburing/commit/1bafb3ce5f5eeb11cd982c7540f6aa74e3f381d4
As stated in the liburing commit message, this fixes a regression,
reverting code that was added specutively to avoid a syscall in some
cases.
|
|
According to the io_uring PDF (https://kernel.dk/io_uring.pdf) the
timeout struct must be 64 bits on both 32 and 64 bit architectures.
|