aboutsummaryrefslogtreecommitdiff
path: root/lib/std/c/linux.zig
AgeCommit message (Collapse)Author
2020-12-23std.ResetEvent: pthreads sem_t cannot be statically initializedAndrew Kelley
because it is allowed for the implementation to use a file descriptor, which would require making a syscall at runtime.
2020-12-23std.ResetEvent: use sem_t when linking against pthreadsAndrew Kelley
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-11-18Merge pull request #6385 from LemonBoy/callocatorAndrew Kelley
std: Make C allocator respect the required alignment
2020-11-05Implement a fallback mechanism for posix_memalignLemonBoy
Do the alignment dance by ourselves whenever posix_memalign is not available. Don't try to use malloc as it has too many edge cases, figuring out whether a block of memory is manually aligned by the mechanism above or is directly coming from malloc becomes too hard to be valuable.
2020-11-01Add libc signatureJoran Dirk Greef
2020-10-04implement {get, set}rlimit for linuxxackus
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-17std: signalfd: fix the types of things; add testAndrew Kelley
2020-08-17add signalfd to std.c.linuxLuna
2020-08-11copy_file_range linux syscall (#6010)Maciej Walczak
2020-05-05zig fmtTadeo Kondrak
2020-03-12std: Add setEndPos to fs.fileLemonBoy
Allow the user to shrink/grow the file size as needed.
2020-03-03breaking: std.os read/write functions + sendfileAndrew Kelley
* rework os.sendfile and add macosx support, and a fallback implementation for any OS. * fix sendto compile error * std.os write functions support partial writes. closes #3443. * std.os pread / pwrite functions can now return `error.Unseekable`. * std.fs.File read/write functions now have readAll/writeAll variants which loop to complete operations even when partial reads/writes happen. * Audit std.os read/write functions with respect to Linux returning EINVAL for lengths greater than 0x7fff0000. * std.os read/write shim functions do not unnecessarily loop. Since partial reads/writes are part of the API, the caller will be forced to loop anyway, and so that would just be code bloat. * Improve doc comments * Add a non-trivial test for std.os.sendfile * Fix std.os.pread on 32 bit Linux * Add missing SYS_sendfile bit on aarch64
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-01-18std: turn EAI_ constants into a non-exhaustive enumdaurnimator
2019-12-31c.linux: add memfd_createLuna
2019-12-10improve dynamic library APIAndrew Kelley
2019-11-08fixups and zig fmtAndrew Kelley
2019-10-28move libc/linux bits aroundAndrew Kelley
2019-09-27support Android NDK and bionicmeme
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221