Commit Graph

17 Commits

Author SHA1 Message Date
Frank Denis 6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
Andreas Linz 7e63f7ad03 Truncate user and group ids for 64 bit Linux systems (#7466)
* 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 38f93dc89e.

* Skip user and group test if builtin.link_libc
2020-12-23 11:16:27 +02:00
Vexu 7e30e83900 small fixes and zig fmt 2020-12-09 13:54:26 +02:00
Andrew Kelley c9551652b0 Merge pull request #6978 from LemonBoy/statshit
Decouple kernel and libc stat definitions
2020-11-05 17:27:22 -05:00
LemonBoy 0e95fa455c std: Split kernel&libc definitions of stat struct
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-05 09:38:50 +01:00
Joran Dirk Greef 8193f55820 Support 32-bit big-endian targets 2020-11-03 06:03:38 +02:00
Joran Dirk Greef 78e9e131e0 Pending #5127 2020-11-02 12:37:55 +02:00
Joran Dirk Greef 067bd7e424 Switch back to writing Zig 2020-11-02 09:55:25 +02:00
Joran Dirk Greef 9dec310826 Debug unhandled errno 2020-11-02 09:52:42 +02:00
Joran Dirk Greef a67f140d2f Add test 2020-11-01 11:55:27 +02:00
Andrew Kelley 4a69b11e74 add license header to all std lib files
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Andrew Kelley 413f9a5cfc move std.fs.Dir.cwd to std.fs.cwd
update to non-deprecated std.fs APIs throughout the codebase

Related: #3811
2019-11-30 15:35:27 -05:00
Andrew Kelley 47f06be369 string literals are now null terminated
this also deletes C string literals from the language, and then makes
the std lib changes and compiler changes necessary to get the behavior
tests and std lib tests passing again.
2019-11-21 20:43:41 -05:00
Andrew Kelley aa0daea541 update more of the std lib to use @as 2019-11-08 15:57:25 -05:00
Andrew Kelley 5181970807 improve docs and field names of Statx struct 2019-10-16 17:24:42 -04:00
LemonBoy 40fc7a1fda Add support for the statx syscall 2019-10-12 20:51:51 +02:00
Andrew Kelley ed36dbbd9c mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00