aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
AgeCommit message (Collapse)Author
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-23openbsd: fix siginfo_t struct definitionSébastien Marie
`_proc` struct part contains an union for kill/cld parts. see [siginfo_t](https://github.com/openbsd/src/blob/77c6c13150aaa9f0a29fe29b233c4436d1da01c0/sys/sys/siginfo.h#L132)
2020-12-23Enable segfault handling on FreeBSD.Alex Cameron
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-17Add EV_ERROR to FreeBSD bitsAlexandros Naskos
2020-12-17Add baudrate constantsTau
This adds the missing baudrate constants for linux where I've used them directly.
2020-12-17Add process_madvise to Linux syscalls (#7450)Dmitry Atamanov
2020-12-17Only check for evented mode in windows.OpenFile when in async modeAlexandros Naskos
2020-12-15openbsd: correct few structsSébastien Marie
- addrinfo: addr and canonname are switched (wrong layout) - addrinfo, Flock, msghdr struct: use proper c_xxx type instead of fixed size. it should help using struct on all architectures supported by openbsd
2020-12-14Implement std.fs.Watch on WindowsAlexandros Naskos
Use unmanaged containers in std.fs.Watch
2020-12-14Add missed Linux syscallsdata-man
2020-12-13Fix compilation error on OpenBSDLemonBoy
2020-12-13Fix compilation error on FreeBSDLemonBoy
2020-12-13std: Drop struct prefixes in FreeBSD siginfoLemonBoy
I'm not sure this prefix-free style is a good idea, but let's roll with it for the moment.
2020-12-13Fix Sigaction struct on FreeBSD.Alex Cameron
2020-12-13Disable sigaction test on i386 because of #7427LemonBoy
2020-12-13std: Update more siginfo bits for BSDsLemonBoy
2020-12-13std: Fixes for siginfo test on macosLemonBoy
Xnu's sigaction() only supports fetching a limited set of sa_flags, test SA_SIGINFO instead of SA_RESETHAND as that's supported everywhere. Add another check to make sure SA_RESETHAND works. Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2020-12-12std: Further siginfo refinementsLemonBoy
* Define siginfo and sigaction for Darwin * Define sigaction/handler union for maximum libc compatibility * Minor correction to some type definitions
2020-12-12std: Correct check in signal testLemonBoy
Ooops.
2020-12-12std: Improve sigaction interfaceLemonBoy
Add a smoke test to prevent regressions.
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-09MoveFileEx can return ACCESS_DENIEDAndrew Kelley
I observed this on Windows 10, trying to use MoveFileEx with MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH to overwrite a running executable.
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-30add std.os.shutdown function for socketsJonathan Marler
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-25std/os: fix prctl constantsIsaac Freund
2020-11-23Fix the ELF base calculationLemonBoy
Find the effective ELF load address in dl_iterate_phdr by computing the difference between the in-memory phdr and its p_vaddr specified in the ELF file. This makes the dl_iterate_phdr test pass and restores the stack traces.
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-22UnregisterClassW needs WINAPI as wellAransentin
2020-11-22Fixed bugs, style suggestionsAransentin
2020-11-22Ensure the dynamic function has the same type as the static oneJens Goldberg
Co-authored-by: daurnimator <quae@daurnimator.com>
2020-11-22user32 cleanup, added wrappers and additional functionsAransentin
2020-11-21std: add support for ppollŽiga Željko
2020-11-20Merge pull request #7165 from LemonBoy/ppc64finalAndrew Kelley
Make the PPC64 port usable
2020-11-20std/os: define and use dev_t for linux x86_64Isaac Freund
2020-11-20std/os: add time_t definiton for x86_64 linuxIsaac Freund
2020-11-20std: Use newfstatat on PPC64LemonBoy
One more variation in the syscall table, hooray!
2020-11-19Merge pull request #6829 from tadeokondrak/error-unsupported-callconvVeikka Tuominen
stage1: Compile error instead of falling back to C for unsupported cc
2020-11-19Add builtin.Signedness, use it instead of is_signedTadeo Kondrak
2020-11-19Update code to not use unsupported calling conventions for targetTadeo Kondrak