aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux
AgeCommit message (Collapse)Author
2022-08-19std.os.linux.bpf: fix compile errorAndrew Kelley
2022-08-05Update Linux syscall list for 5.19Stephen Gregoratto
New changes: memfd_secret implemented for RISC-V.
2022-07-16Fix io_uring tests (#12134)Vincent Rischmann
* 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.
2022-07-05std.os.linux.io_uring: work around LLVM bugAndrew Kelley
See #12014
2022-06-27std.os.linux.clone: upgrade to stage2 fn ptr semanticsAndrew Kelley
2022-06-07add const to msghdr_const iov and control pointersJonathan Marler
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.
2022-06-06std: fix ambiguous referencesVeikka Tuominen
2022-05-25io_uring: replace the readv method with a read on a new ReadBuffer typeVincent Rischmann
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.
2022-05-25io_uring: add tests for automatic buffer selectionVincent Rischmann
2022-05-25io_uring: use the socket test harnessVincent Rischmann
2022-05-25io_uring: add a test harness for server/client TCP socket testsVincent Rischmann
2022-05-25io_uring: change recv() to use a RecvBuffer insteadVincent Rischmann
RecvBuffer is equivalent to ReadBuffer but tailored for recv only.
2022-05-25io_uring: change read() to use a ReadBuffer insteadVincent Rischmann
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.
2022-05-25io_uring: add provide_buffers and remove_buffersVincent Rischmann
These functions are needed to implement automatic buffer selection. This maps to the IORING_OP_PROVIDE_BUFFERS and IORING_OP_PROVIDE_BUFFERS ops.
2022-05-16Generate linux syscalls via. the linux source treeStephen Gregoratto
Previously, updating the `SYS` enum for each architecture required manually looking at the syscall tables and inserting any new additions. This commit adds a tool, `generate_linux_syscalls.zig`, that automates this process using the syscall tables in the Linux source tree. On architectures without a table, it runs `zig cc` as a pre-processor to extract the system-call numbers from the Linux headers.
2022-05-13target: Rename sparcv9 -> sparc64Koakuma
Rename all references of sparcv9 to sparc64, to make Zig align more with other projects. Also, added new function to convert glibc arch name to Zig arch name, since it refers to the architecture as sparcv9. This is based on the suggestion by @kubkon in PR 11847. (https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2022-05-10io_uring cancel test must tolerate CQ reorderingBrian Gold
Fixes #11382. Tested on ArchLinux 5.17.5-arch1-1.
2022-05-05std.os.linux.arm-eabi: upgrade to new fn ptr semanticsAndrew Kelley
2022-04-28Merge pull request #10717 from gh-fork-dump/seccomp-bitsVeikka Tuominen
Add Seccomp bits for linux
2022-04-15update self hosted sources to language changesVeikka Tuominen
2022-03-22Fix ucontext_tLocria Cyber
2022-03-09Add bits for the Linux Secure Computing facilityStephen Gregoratto
2022-03-03os/linux/io_uring: add recvmsg and sendmsg (#10212)Hiroaki Nakamura
* 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
2022-02-15Adds Linux support for POSIX file locking with fcntlAnthony Carrico
On Linux, locking fails with EAGAIN (vs. EACCES on other systems). This commit also adds FcntlErrors for EDEADLK and ENOLCK.
2022-01-04io_uring: improve IO_Uring.copy_cqeVincent Rischmann
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.
2022-01-01io_uring: fix version check in testsVincent Rischmann
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
2021-12-19stage1, stage2: rename c_void to anyopaque (#10316)Isaac Freund
zig fmt now replaces c_void with anyopaque to make updating code easy.
2021-12-18Fix MIPS inline assembly clobbersJens Goldberg
2021-12-12os/linux/io_uring: implement linkatVincent Rischmann
2021-12-12os/linux/io_uring: implement symlinkatVincent Rischmann
2021-12-12os/linux/io_uring: implement mkdiratVincent Rischmann
2021-12-12os/linux/io_uring: implement unlinkatVincent Rischmann
2021-12-12os/linux/io_uring: implement renameatVincent Rischmann
2021-12-12os/linux/io_uring: implement shutdownVincent Rischmann
2021-12-03Merge pull request #9927 from vrischmann/fix-rlimit-resourceAndrew Kelley
Fix rlimit_resource for MIPS and SPARC
2021-12-01Fix test for io_uring link_timeoutHiroaki Nakamura
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.
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-11-29std: add workaround for failing io_uring testAndrew Kelley
See #10247
2021-11-23Merge pull request #10151 from hnakamur/zigHiroaki Nakamura
io_uring: adds link_timeout
2021-11-16io_uring: implement register_files_updateVincent Rischmann
2021-11-16os/linux: fix rlimit_resource for mips/sparcv9Vincent Rischmann
On MIPS and SPARC the RLIMIT kinds have different numbers than the other architectures.
2021-11-14Merge pull request #10081 from hnakamur/lib_std_os_linux_io_uring_cancelAndrew Kelley
std.os.linux: Add cancel and io_uring_prep_cancel
2021-11-14io_uring: add poll_updateKenta Iwasaki
Add method from liburing to queue (but not submit) a SQE to update the user data of an existing poll operation.
2021-11-12Use io_uring_prep_rw in io_uring_prep_cancelHiroaki Nakamura
follow liburing's API as closely as possible. Signed-off-by: Hiroaki Nakamura <hnakamur@gmail.com>
2021-11-12std.os.linux: Add cancel and io_uring_prep_cancelHiroaki Nakamura
Signed-off-by: Hiroaki Nakamura <hnakamur@gmail.com>
2021-11-10Merge pull request #9853 from koachan/sparc64-unittestsAndrew Kelley
SPARCv9: make more tests pass
2021-11-09io_uring: skip statx test failure on older kernelsAndrew Kelley
2021-11-09os/linux/io_uring: implement statxVincent Rischmann
2021-10-23std: Fix edge case in TLS tp calculationLemonBoy
The TLS area may be located in the upper part of the address space and, if the platform expects a constant offset to be applied, may make the tp register calculation overflow. Use +% instead of +, the overflow is harmless.
2021-10-17Linux: Update syscall numbers for 5.14Stephen Gregoratto