aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux
AgeCommit message (Collapse)Author
2023-05-11fix incorrect use of mutable pointers to temporary valuesVeikka Tuominen
2023-05-03bpf: correct return type of ringbuf_output helperTw
Signed-off-by: Tw <weii.tan>
2023-04-30std: fix a bunch of typosLinus Groh
The majority of these are in comments, some in doc comments which might affect the generated documentation, and a few in parameter names - nothing that should be breaking, however.
2023-04-28std: update to use `@memcpy` directlyAndrew Kelley
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-23Improvements to docs and textzooster
* docs(std.math): elaborate on difference between absCast and absInt * docs(std.rand.Random.weightedIndex): elaborate on likelihood I think this makes it easier to understand. * langref: add small reminder * docs(std.fs.path.extension): brevity * docs(std.bit_set.StaticBitSet): mention the specific types * std.debug.TTY: explain what purpose this struct serves This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging. * langref(package listing): brevity * langref: explain what exactly `threadlocal` causes to happen * std.array_list: link between swapRemove and orderedRemove Maybe this can serve as a TLDR and make it easier to decide. * PrefetchOptions.locality: clarify docs that this is a range This confused me previously and I thought I can only use either 0 or 3. * fix typos and more * std.builtin.CallingConvention: document some CCs * langref: explain possibly cryptic names I think it helps knowing what exactly these acronyms (@clz and @ctz) and abbreviations (@popCount) mean. * variadic function error: add missing preposition * std.fmt.format docs: nicely hyphenate * help menu: say what to optimize for I think this is slightly more specific than just calling it "optimizations". These are speed optimizations. I used the word "performance" here.
2023-04-22doc: fix minor grammar issues-k
2023-04-19work around an intermittent io_uring test failureAndrew Kelley
See #15362
2023-04-03x86_64: remove returns from naked functionsJacob Young
2023-03-30Change ordering of prep provide buffers argsbing
2023-03-28bpf: add missing *const for helper functionsTw
Signed-off-by: Tw <tw19881113@gmail.com>
2023-03-15std lib tests: avoid cwd races by using std.testing.tmpDirAndrew Kelley
2023-03-15disable std lib unit tests that hard code port numbersAndrew Kelley
See tracking issue #14907
2023-02-05Update Linux syscall list for 6.1, support Mips64Stephen Gregoratto
Follow up for #14541.
2023-02-04Add support for mips64/mips64elSuirad
2023-01-24std: remove meta.assumeSentinelIsaac Freund
All but 3 callsites of this function in the standard library and compiler were unnecessary and were removed in faf2fd18. In this commit, the remaining 3 callsites are removed. One of them turned out to also be unnecessary and has been replaced by slicing directly with the length.. The 2 remaining callsites were in the very pointer-math heavy std/os/linux/vdso.zig code which should perhaps be refactored to better utilize slices. These 2 callsites are replaced with a plain @ptrCast([*:0]u8, ptr) though could likely use std.mem.sliceTo() if the surrounding code was refactored.
2023-01-16std.os.linux.io_uring: fix ABI errorVeikka Tuominen
`register_files_update` was passing a pointer to a Zig struct to the kernel.
2023-01-02remove the experimental std.x namespaceAndrew Kelley
Playtime is over. I'm working on networking now.
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
2022-11-27linux.bpf: expose map_get_next_keybfredl
Returning a bool allows to conveniently use it as the condition of a while loop. Also remove restriction that ST cannot be double-word. While imm is only 32-bit, this value is extended into a 64-bit memory location.
2022-11-18run zig fmt on everything checked by CIStevie Hryciw
2022-11-09Fixes to linux/bpf/btf.zigbfredl
- the meaning of packed structs changed in zig 0.10. adjust accordingly. Use "extern struct" for the cases that directly map to C structs. - Add new type info kinds, like enum64 and DeclTag - change the Type enum to use the canonical names from libbpf. This is more predictable when comparing with external BPF documentation (than invented synonyms that need to be guessed)
2022-11-04all: rename i386 to x86Ali Chraghi
2022-10-25std: add cbe hacks to more targetsJacob Young
These are needed because clang doesn't support anything in naked functions, not even assembly register inputs.
2022-10-25cbe: get enough things working to support basic programsJacob Young
* Enable advanced start support. * Enable advanced test_runner support. * Zig Language Reference's Hello World now works.
2022-10-16os.linux: some fixes to BPF modulebfredl
- For ALU operations, src should be allowed to be an explicit Reg. - Expose AluOp and JmpOp as public types. This makes code generation using BPF as a backend easier, as AluOp and JmpOp can be used directly as part of an IR
2022-10-13io_uring: ignore SOCK_NONEMPTY for reproducible testsJacob Young
Fixes #12670
2022-10-11io_uring: allow for nullable argumentsmllken
2022-09-29std: Replace use of stage1 function pointersominitay
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