aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
AgeCommit message (Collapse)Author
2022-02-11std: validate frame-pointer address in stack walkingm
2022-01-29improve comptime windows GUID.parse performanceJonathan Marler
I found that after switching from my custom Guid parser to the one in std that it increased zigwin32 build times substantially (from 40 seconds to over 10 minutes). More information can be found in the benchmark PR I created here: https://github.com/ziglang/gotta-go-fast/pull/21 . This PR ports my GUID parser to std so all projects can leverage the faster comptime performance.
2022-01-29Add bits for the Linux Auditing SystemStephen Gregoratto
Also adds the _CSKY and _FRV ELF machines that are defined in `<linux/elf-em.h>`
2022-01-27fchown: use the 32-bit uid/gid variant of the syscall on 32-bit linux targetsVesim
2022-01-24use explicit integer bit widths for windows GUIDJonathan Marler
The size of a GUID is not platform-dependent, it's always a fixed number of bits. So I've updated guid to use fixed bit integer types rather than platform-dependent C integer types.
2022-01-16std/os/uefi: Don't treat efi status warnings as errorsfifty-six
2022-01-16std/os/uefi: Add util function for opening protocolsfifty-six
2022-01-16std/os/uefi: Fix parameter type mismatch in edid_override_protocolfifty-six
2022-01-16std/os/uefi: Add conversion from Status to EfiErrorfifty-six
Allows handling uefi function errors in a more zig-style way with try and catch, using `try f().err()` when a `Status` is returned.
2022-01-16std/os/uefi: Align first field of EdidOverrideProtocolAttributes to 4fifty-six
This makes the struct align(4), which allows it to be passed as flags more easily.
2022-01-16std/os/uefi: Simplify packed struct padding and default zero-initializefifty-six
Beyond adding default zero-initialization, this commit changes undefined initialization to zero, as some cases reserved the padding and on other cases, I've found some systems act strange when giving uninit instead of zero even when it shouldn't be an issue, one example being FileProtocol.Open's attributes, which *should* be ignored when not creating a file, but ended up giving an unrelated error.
2022-01-15std.os.windows: add ntdll thread information APIsviri
2022-01-15std.os.windows: fix casing for `ntdll.lib`viri
I've seen having this be wrong break some cross-compilers, and it's also how it is in other files so it's best to be consistent. It's also just the actual casing of the file.
2022-01-14std/os/uefi: Refactor getDevicePath()fifty-six
Uses comptime loops over the types instead of writing out a large switch.
2022-01-14std/os/uefi: Complete DevicePathProtocol typesfifty-six
2022-01-13std/os/uefi: Complete AcpiDevicePath and HardwareDevicePathsfifty-six
2022-01-13std/os/uefi: Add parameter names to boot_servicesfifty-six
2022-01-13std/os/uefi: Fill out remaining runtime services and add parameter namesfifty-six
2022-01-13std/os/uefi: Fill out remaining function signatures and docs on boot_servicesfifty-six
2022-01-13std/os/uefi: Use `usingnamespace` to re-export symbolsfifty-six
`uefi/protocols.zig` and `uefi/tables.zig` just re-exported all the public symbols, which is basically the purpose of `usingnamespace` import-wise.
2022-01-11std.fs.path: revert recent public API changeAndrew Kelley
41fd343508880ffdfbc83c7b053237da09199f02 made a breaking change to the public API; this commit reverts the API changes but keeps the improved logic.
2022-01-11std/os/uefi: Add pool_allocator and raw_pool_allocatorfifty-six
2022-01-11std/os/uefi: Add create_file_device_pathfifty-six
This allows users to add file paths to device paths, which is often used in methods like `boot_services.loadImage` and `boot_services.startImage`, which take a device path with an additional file path appended to locate the image.
2022-01-11std/os/uefi: Add methods next() and size() to DevicePathProtocolfifty-six
These are used for more easily dealing with a series of Device Path nodes.
2022-01-11std/os/uefi: Add FileSystemInfofifty-six
2022-01-11std/os/uefi: Move FileInfo guid from FileProtocol to FileInfofifty-six
The GUID on FileProtocol was for EFI_FILE_INFO, FileProtocol itself doesn't have a GUID, there are only those for the requested information types.
2022-01-04Add CANNOT_DELETE as a possible error in os.windows.DeleteFileRyan Liptak
Can happen when e.g. trying to delete a file with the Read Only flag set
2022-01-04io_uring: improve IO_Uring.copy_cqeVincent Rischmann
copy_cqes() is not guaranteed to return as many CQEs as provided in the `wait_nr` argument, meaning the assert in `copy_cqe` can trigger. Instead, loop until we do get at least one CQE returned. This mimics the behaviour of liburing's _io_uring_get_cqe.
2022-01-02std.fs.rename: fix Windows implementationAndrew Kelley
The semantics of this function are that it moves both files and directories. Previously we had this `is_dir` boolean field of `std.os.windows.OpenFile` which required the API user to choose: are we opening a file or directory? And the other kind would either cause error.IsDir or error.NotDir. But that is not a limitation of the Windows file system API; it was self-imposed. On Windows, rename is implemented internally with `NtCreateFile` so we need to allow it to open either files or directories. This is now done by `std.os.windows.OpenFile` accepting enum{file_only,dir_only,any} instead of a boolean.
2022-01-01io_uring: fix version check in testsVincent Rischmann
For renameat, unlinkat, mkdirat, symlinkat and linkat the error code differs between kernel 5.4 which returns EBADF and kernel 5.10 which returns EINVAL. Fixes #10466
2021-12-19stage1, stage2: rename c_void to anyopaque (#10316)Isaac Freund
zig fmt now replaces c_void with anyopaque to make updating code easy.
2021-12-18Fix MIPS inline assembly clobbersJens Goldberg
2021-12-12os/linux/io_uring: implement linkatVincent Rischmann
2021-12-12os/linux/io_uring: implement symlinkatVincent Rischmann
2021-12-12os/linux/io_uring: implement mkdiratVincent Rischmann
2021-12-12os/linux/io_uring: implement unlinkatVincent Rischmann
2021-12-12os/linux/io_uring: implement renameatVincent Rischmann
2021-12-12os/linux/io_uring: implement shutdownVincent Rischmann
2021-12-12os/linux: add more io_uring opcodeVincent Rischmann
2021-12-04Added an explicit type for the termios constants (#10266)Zapolsky Anton
Adds the `tcflag_t` type to the termios constants. This is made to allow bitwise operations on the termios constants without an integer cast, e.g.: ```zig var raw = try std.os.tcgetattr(std.os.STDIN_FILENO); raw.lflag &= std.os.linux.ECHO | std.os.linux.ICANON; ``` instead of ```zig var raw = try std.os.tcgetattr(std.os.STDIN_FILENO); raw.lflag &= ~@intCast(u32, std.os.linux.ECHO | std.os.linux.ICANON); ``` Contributes to #10181
2021-12-03Merge pull request #9927 from vrischmann/fix-rlimit-resourceAndrew Kelley
Fix rlimit_resource for MIPS and SPARC
2021-12-01Fix test for io_uring link_timeoutHiroaki Nakamura
The old test "timeout_link_chain1" was ported from liburing test_timeout_link_chain1 https://github.com/axboe/liburing/blob/509873c4454012c5810c728695c21911c82acdc4/test/link-timeout.c#L539-L628 However it turns out that both fails with EBADF (-9) on Linux kernel 5.4. The this new test skips properly on Linux kernel 5.4 and passes on Linux kernel 5.11.
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-11-29std: add workaround for failing io_uring testAndrew Kelley
See #10247
2021-11-23Merge pull request #10151 from hnakamur/zigHiroaki Nakamura
io_uring: adds link_timeout
2021-11-22feat(uefi): add virtual addressing helpers (#10195)Stephen von Takach
based off definitions in https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
2021-11-16io_uring: implement register_files_updateVincent Rischmann
2021-11-16os: fix getrlimit/setrlimit test for MIPSVincent Rischmann
This test can fail due to a fix in musl for 32 bit MIPS, where musl changes limits greater than -1UL/2 to RLIM_INFINITY. See http://git.musl-libc.org/cgit/musl/commit/src/misc/getrlimit.c?id=8258014fd1e34e942a549c88c7e022a00445c352 Depending on the system where the test is run getrlimit can return RLIM_INFINITY for example if RLIMIT_MEMLOCK is bigger than ~2GiB. If that happens, the setrlimit call will fail with PermissionDenied.