aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux
AgeCommit message (Collapse)Author
2021-01-03Improve uring definitionsdaurnimator
2020-12-31Year++Frank Denis
2020-12-24std: clenup, fixes, fmtVeikka Tuominen
2020-12-23Truncate user and group ids for 64 bit Linux systems (#7466)Andreas Linz
* Truncate user and group ids Calls to `getuid`, `getgid` and their `eid` variants fail to compile on 64bit Linux systems because the return value of the syscall is of `usize` and needs to be truncated to fit the size of `uid_t` that is 32 bit. Thanks to @FireFox317 for figuring this out in Zig's Discord channel! * Add a regression test for user and group ids * Replace @truncate with @intCast This should be safe because `uid_t` will be 32-bit. * Add missing import for getauxval * Add missing package names * Revert "Add missing import for getauxval" This reverts commit 38f93dc89effdf657f2b81a56b96527ce4083f52. * Skip user and group test if builtin.link_libc
2020-12-18std.crypto.random: introduce fork safetyAndrew Kelley
Everybody gets what they want! * AT_RANDOM is completely ignored. * On Linux, MADV_WIPEONFORK is used to provide fork safety. * On pthread systems, `pthread_atfork` is used to provide fork safety. * For systems that do not have the capability to provide fork safety, the implementation falls back to calling getrandom() every time. * If madvise is unavailable or returns an error, or pthread_atfork fails for whatever reason, it falls back to calling getrandom() every time. * Applications may choose to opt-out of fork safety. * Applications may choose to opt-in to unconditionally calling getrandom() for every call to std.crypto.random.fillFn. * Added `std.meta.globalOption`. * Added `std.os.madvise` and related bits. * Bumped up the size of the main thread TLS buffer. See the comment there for justification. * Simpler hot path in TLS initialization.
2020-12-18std: Properly fix the TLS alignment problemLemonBoy
ad05509 introduced a fix for the wrong problem, the logic to align the start of main_thread_tls_buffer was already there but was flawed. Fix it for good and avoid wasting too many bytes for alignment purposes.
2020-12-17std: align(16) main_thread_tls_bufferAndrew Kelley
Before this change, thread local variables were landmines if LLVM decided to optimize any writes to them using vector instructions.
2020-12-10Merge pull request #7369 from jorangreef/io_uring_timeoutAndrew Kelley
Add io_uring TIMEOUT and TIMEOUT_REMOVE operations:
2020-12-10Skip timeout_remove test where not supported by the kernelJoran Dirk Greef
2020-12-10Debug CI io_uring unsupported opJoran Dirk Greef
2020-12-09Add io_uring TIMEOUT and TIMEOUT_REMOVE operations:Joran Dirk Greef
ring.timeout() to queue a IORING_OP_TIMEOUT operation ring.timeout_remove() to queue a IORING_OP_TIMEOUT_REMOVE operation io_uring_prep_timeout() to prep a IORING_OP_TIMEOUT sqe io_uring_prep_timeout_remove() to prep a IORING_OP_TIMEOUT_REMOVE sqe
2020-12-09small fixes and zig fmtVexu
2020-11-29std.meta: add assumeSentinelJonathan Marler
2020-11-28Add a comment to explain the fork return values on sparc64Koakuma
2020-11-27Fix fork() on Linux/sparc64Koakuma
fork() on Linux/sparc64 seems to return its result in two registers, with %o0 always holding the current process' PID, and the parent/child status returned in %o1. Add some glue code to convert those into the libc-style return value.
2020-11-23Minor code cleanup in start_pie.zigLemonBoy
Thanks @daurnimator for catching this.
2020-11-22modernize the PIE patch for the latest master branchAndrew Kelley
This is the part of #3960 that has to be rewritten to apply to latest master branch code.
2020-11-22Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pieAndrew Kelley
Conflicts: lib/std/dynamic_library.zig (fixed in this commit) src/all_types.hpp src/codegen.cpp src/link.cpp src/main.cpp Will manually apply the diffs to these deleted files to the new zig code in a followup commit.
2020-11-05Merge pull request #6978 from LemonBoy/statshitAndrew Kelley
Decouple kernel and libc stat definitions
2020-11-05Merge pull request #6895 from jorangreef/fallocateAndrew Kelley
linux: add fallocate()
2020-11-05std: Split kernel&libc definitions of stat structLemonBoy
There's no guarantee for the kernel definition to be ABI compatible with the libc one (and vice versa). There's also no guarantee of ABI compatibility between musl/glibc. Fun, isn't it?
2020-11-04std: Fix pipe syscall stub for sparc64LemonBoy
2020-11-03Support 32-bit big-endian targetsJoran Dirk Greef
2020-11-02Pending #5127Joran Dirk Greef
2020-11-02Switch back to writing ZigJoran Dirk Greef
2020-11-02Debug unhandled errnoJoran Dirk Greef
2020-11-01Merge pull request #6792 from koachan/sparc64-linuxAndrew Kelley
Initial sparc64-linux bringup
2020-11-01Add testJoran Dirk Greef
2020-10-29Merge pull request #6356 from jorangreef/io_uringAndrew Kelley
std: add io_uring library
2020-10-26std/*: add missing MIT license headersFrank Denis
2020-10-25Predict error-less path on syscallsKoakuma
2020-10-25Add back ppc input/output/clobber definitionsKoakuma
Accidentally removed when rebasing, this adds it back.
2020-10-24Add TLS implementation for sparc64Koakuma
2020-10-24Add pipe(2) supportKoakuma
2020-10-24Account for the delay slotKoakuma
2020-10-24Fix register namingKoakuma
2020-10-24Add sparc64 syscall interfaceKoakuma
2020-10-21std: Slim down the error code path in initStaticTLSLemonBoy
Calling @panic made the executable ~30x times bigger, use a simple `abort()` and let the user figure out what went wrong. Supporting ARMv6 (and earlier?) platforms is not a priority. Closes #6676
2020-10-06Update zig files for opaque type syntaxTadeo Kondrak
2020-10-05Test the range of user_data bitsJoran Dirk Greef
2020-10-04Split openat/close test into two separate testsJoran Dirk Greef
If an older kernel fails the `openat` test because of `AT_FDCWD` then we don't want to skip the `close` test.
2020-10-04Use const wherever possibleJoran Dirk Greef
2020-10-04Skip openat test only for older kernels that do not fully support AT_FDCWDJoran Dirk Greef
2020-10-04Improve openat/accept test debuggingJoran Dirk Greef
2020-10-04Add openat(), close(), connect(), send(), recv(), as well as testsJoran Dirk Greef
Removes non-essential .hardlink_with_next_sqe() and .drain_previous_sqes().
2020-10-04Use load relaxed semantics when reading the SQPOLL wakeup flagJoran Dirk Greef
2020-10-04Allow for advanced non-sequential SQE allocation schemesJoran Dirk Greef
Decouples SQE queueing and SQE prepping methods to allow for non-sequential SQE allocation schemes as suggested by @daurnimator. Adds essential SQE prepping methods from liburing to reduce boilerplate. Removes non-essential .link_with_next_sqe() and .use_registered_fd().
2020-10-04Limit entries to u12, add errors for invalid entries, use mem.zeroInitJoran Dirk Greef
2020-10-04Expose available kernel featuresJoran Dirk Greef
2020-10-03Use load acquire semantics when reading the SQPOLL wakeup flagJoran Dirk Greef
Ensures that the wakeup flag is read after the tail pointer has been written. It's important to use memory load acquire semantics for the flags read, otherwise the application and the kernel might not agree on the consistency of the wakeup flag, leading to I/O starvation. Refs: https://github.com/axboe/liburing/commit/6768ddcc562adb6ea141cf508bccecb6be8ce666 Refs: https://github.com/axboe/liburing/issues/219