zig/lib/std/os/linux
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
..
bpf Update zig files for opaque type syntax 2020-10-06 22:08:25 -06:00
arm-eabi.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
arm64.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
bpf.zig added helper definitions 2020-09-12 23:45:35 -07:00
i386.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
io_uring.zig Merge pull request #7369 from jorangreef/io_uring_timeout 2020-12-10 15:45:38 -05:00
mips.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
powerpc64.zig std/*: add missing MIT license headers 2020-10-26 17:41:29 +01:00
riscv64.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
sparc64.zig Add a comment to explain the fork return values on sparc64 2020-11-28 13:24:24 +07:00
start_pie.zig Minor code cleanup in start_pie.zig 2020-11-23 12:36:40 +01:00
test.zig Truncate user and group ids for 64 bit Linux systems (#7466) 2020-12-23 11:16:27 +02:00
tls.zig std.crypto.random: introduce fork safety 2020-12-18 15:54:01 -07:00
vdso.zig std.meta: add assumeSentinel 2020-11-29 10:36:02 -08:00
x86_64.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00