| author | |
| committer | |
| log | dcaaa241dfb7ce77b7070df8d6a939a9f0749e2c |
| tree | 64041d0e295206b5dd9653e8fdb3ad472bdab2a6 |
| parent | c2a08d7c516899b4c794bd6c3fc07ddb22d5876a |
syscall0() returns usize, but we were trying to @bitCast to i32.2 files changed, 5 insertions(+), 1 deletions(-)
std/os/linux/index.zig+1-1| ... | ... | @@ -944,7 +944,7 @@ pub fn setgroups(size: usize, list: *const u32) usize { |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | pub fn getpid() i32 { |
| 947 | return @bitCast(i32, u32(syscall0(SYS_getpid))); | |
| 947 | return @bitCast(i32, @truncate(u32, syscall0(SYS_getpid))); | |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | pub fn sigprocmask(flags: u32, noalias set: *const sigset_t, noalias oldset: ?*sigset_t) usize { |
std/os/linux/test.zig+4| ... | ... | @@ -3,6 +3,10 @@ const builtin = @import("builtin"); |
| 3 | 3 | const linux = std.os.linux; |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | 5 | |
| 6 | test "getpid" { | |
| 7 | assert(linux.getpid() != 0); | |
| 8 | } | |
| 9 | ||
| 6 | 10 | test "timer" { |
| 7 | 11 | const epoll_fd = linux.epoll_create(); |
| 8 | 12 | var err = linux.getErrno(epoll_fd); |