aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux.zig
AgeCommit message (Collapse)Author
2024-09-26std.os.linux: extend rtattr.type to support IFA_*pseudoc
This is a breaking change which updates the `rtattr.type` from `IFLA` to `union { IFLA, IFA }`. `IFLA` is for the `RTM_*LINK` messages and `IFA` is for the `RTM_*ADDR` messages.
2024-09-24std: add arch bits for s390x-linux (#21342)Meghan Denny
see #21402
2024-09-19std.os.linux: Fix tc_oflag_t for PowerPCLinus Groh
std/os/linux.zig:6504:20: error: expected type 'os.linux.NLDLY__enum_11313', found 'comptime_int'
2024-09-06std.os.linux: Add clock_nanosleep() syscall wrapper.Alex Rønne Petersen
2024-08-31std.os.linux: Make nanosleep() a compile error on riscv32.Alex Rønne Petersen
This should eventually be converted to the void/{} pattern along with the other syscalls that are compile errors for riscv32.
2024-08-31std.os.linux: Also use kernel_timespec for riscv32 when libc is linked.Alex Rønne Petersen
Both glibc and musl use time64 as the base ABI for riscv32. This fixes the `sleep` test in `std.time` hanging forever due to the libc functions reading bogus values.
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-27lib,test,tools,doc: update usages of @exportmlugg
2024-08-23std.os.linux: Fix bunch of compilation errors (#21138)Michał Drozd
* Correct layout of IntInfo according to https://www.kernel.org/doc/html/latest/bpf/btf.html#btf-kind-int * Fix VFS errors * Fix std.os.linux.sendmmsg * Fix std.os.linux.sigismember. Add tests * Fix futex2 functions
2024-08-23Merge pull request #21137 from Aransentin/af_packetAndrew Kelley
std.os.linux: Add support for AF_PACKET V3
2024-08-22Merge pull request #21095 from alexrp/mips64-testsAndrew Kelley
Get `mips64(el)-linux` working and start testing it
2024-08-21Inline the variant unionJens Goldberg
2024-08-20Add tpacket_hdr and tpacket_block variant unionsJens Goldberg
2024-08-19Added Constants Related To Ioctl (sockios.h)Mohanavel S K
2024-08-19Remove FASTROUTE; invisible to userspace, and collides with USERJens Goldberg
2024-08-19std.os.linux: Add support for AF_PACKET V3Jens Goldberg
2024-08-18std.os.linux: Fix rlimit_resource for mips64; move out of arch bits.Alex Rønne Petersen
It is usually generic, so no point having it in arch bits.
2024-08-18std.os.linux: Fix E definition for mips64.Alex Rønne Petersen
2024-08-14std.os.linux: add mseal syscallreokodoku
2024-08-12std.os.linux: Fix definition of tc_lflag_t on MIPSLinus Groh
Regressed in #21000.
2024-08-09std.os.linux: Retranslate and port some ioctl-related types and values.Alex Rønne Petersen
2024-08-09std: add loongarch64 support (#20915)YANG Xudong
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2024-08-07loongarch: various architecture specific fixes (#20912)YANG Xudong
2024-08-07POSIX link() syscall only takes two arguments (no flags)Pat Tullmann
The signature is documented as: int link(const char *, const char *); (see https://man7.org/linux/man-pages/man2/link.2.html or https://man.netbsd.org/link.2) And its not some Linux extension, the [syscall implementation](https://github.com/torvalds/linux/blob/21b136cc63d2a9ddd60d4699552b69c214b32964/fs/namei.c#L4794-L4797) only expects two arguments too. It probably *should* have a flags parameter, but its too late now. I am a bit surprised that linking glibc or musl against code that invokes a 'link' with three parameters doesn't fail (at least, I couldn't get any local test cases to trigger a compile or link error). The test case in std/posix/test.zig is currently disabled, but if I manually enable it, it works with this change.
2024-08-07Add getppid to std.c and std.os.linux.Jeffrey C. Ollie
The std lib is missing getppid, this patch adds it.
2024-08-07std.os.linux: Move clone() here and stop exporting it.Alex Rønne Petersen
2024-08-07Merge pull request #20922 from alexrp/vdsoAndrew Kelley
`std.os.linux`: Fix VDSO for mips, add VDSO for riscv
2024-08-03std.os.linux: Replace `@hasDecl()` with `!= void` check for VDSO.Alex Rønne Petersen
If there is a VDSO, it will have clock_gettime(). The main thing we're concerned about is architectures that don't have a VDSO at all, of which there are a few.
2024-08-01std.os.linux: Fix arm check in fadvise() to also include thumb.Alex Rønne Petersen
2024-08-01std.os.linux: Fix require_aligned_register_pair to check isMIPS32().Alex Rønne Petersen
Only 32-bit architectures need this.
2024-08-01std.Target: Rework isPPC()/isPPC64() functions.Alex Rønne Petersen
* Rename isPPC() -> isPowerPC32(). * Rename isPPC64() -> isPowerPC64(). * Add new isPowerPC() function which covers both. There was confusion even in the standard library about what isPPC() meant. This change makes these functions work how I think most people actually expect them to work, and makes them consistent with isMIPS(), isSPARC(), etc. I chose to rename from PPC to PowerPC because 1) it's more consistent with the other functions, and 2) it'll cause loud rather than silent breakage for anyone who might have been depending on isPPC() while misunderstanding it.
2024-08-01std.os.linux: Unbreak the buildAlex Rønne Petersen
Happened because I wrote #20869 before #20870.
2024-08-01Merge pull request #20870 from alexrp/target-cleanup-3Andrew Kelley
`std.Target`: Remove more dead OS/architecture tags
2024-08-01Merge pull request #20869 from alexrp/linux-syscallsAndrew Kelley
`std.os.linux`: Add syscall enums for all remaining architectures
2024-07-30std.Target: Remove `sparcel` architecture tag.Alex Rønne Petersen
What is `sparcel`, you might ask? Good question! If you take a peek in the SPARC v8 manual, §2.2, it is quite explicit that SPARC v8 is a big-endian architecture. No little-endian or mixed-endian support to be found here. On the other hand, the SPARC v9 manual, in §3.2.1.2, states that it has support for mixed-endian operation, with big-endian mode being the default. Ok, so `sparcel` must just be referring to SPARC v9 running in little-endian mode, surely? Nope: * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L226 * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L104 So, `sparcel` in LLVM is referring to some sort of fantastical little-endian SPARC v8 architecture. I've scoured the internet and I can find absolutely no evidence that such a thing exists or has ever existed. In fact, I can find no evidence that a little-endian implementation of SPARC v9 ever existed, either. Or any SPARC version, actually! The support was added here: https://reviews.llvm.org/D8741 Notably, there is no mention whatsoever of what CPU this might be referring to, and no justification given for the "but some are little" comment added in the patch. My best guess is that this might have been some private exercise in creating a little-endian version of SPARC that never saw the light of day. Given that SPARC v8 explicitly doesn't support little-endian operation (let alone little-endian instruction encoding!), and no CPU is known to be implemented as such, I think it's very reasonable for us to just remove this support.
2024-07-30std.os.linux: Hook up newly added syscall enums.Alex Rønne Petersen
2024-07-30std.os.linux: Adjust for rename of mips syscall enums.Alex Rønne Petersen
2024-07-30std.os.linux.AUDIT: Rewrite ARCH in terms of std.elf.EM.Alex Rønne Petersen
Closes #20743.
2024-07-29std: Stop supporting Linux/glibc versions older than declared in std.Target.Alex Rønne Petersen
2024-07-29std.os.linux: Remove the sparc64 workaround in fadvise().Alex Rønne Petersen
This does not seem to be needed anymore, and it's unclear if it was ever truly needed or if it was just there to deal with a QEMU/strace bug. See: https://github.com/ziglang/zig/pull/8301#issuecomment-2184995749
2024-07-29std.os.linux: Define timespec as kernel_timespec (64-bit) for riscv32.Alex Rønne Petersen
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem.
2024-07-29std.os.linux: Add riscv32 support.Alex Rønne Petersen
2024-07-29std.os.linux: Some adjustments after syscall generation strategy changes.Alex Rønne Petersen
2024-07-26std.os.linux: Fix default value for perf_event_attr.clockid field.Alex Rønne Petersen
Closes #20810.
2024-07-23std.os.linux.AUDIT: Fix s390x; add loongarch64 and xtensa.Alex Rønne Petersen
2024-07-23std.os.linux: Also define O for armeb and thumbeb.Alex Rønne Petersen
2024-07-23std.os.linux: Also define MAP for armeb and thumbeb.Alex Rønne Petersen
2024-07-23std.os.linux: Define (MIN)SIGSTKSZ for all supported Linux architectures.Alex Rønne Petersen
2024-07-23std.os.linux: Define syscalls for armeb and thumbeb too.Alex Rønne Petersen
2024-07-23std.os.linux: Import arch bits for armeb and thumbeb too.Alex Rønne Petersen