diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-03 18:47:30 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-03 18:47:30 -0400 |
| commit | 2680f9ab48e041108a29271f55a69d9f869461b9 (patch) | |
| tree | c5f7c0ae8f71c4423373b686fa354751104b6d58 /std/os | |
| parent | c5f1925bc801c34133437d0d78de6b1d520f9f12 (diff) | |
| parent | 9bd8b01650f9cf21e601117951711b21aa5fd216 (diff) | |
| download | zig-2680f9ab48e041108a29271f55a69d9f869461b9.tar.gz zig-2680f9ab48e041108a29271f55a69d9f869461b9.zip | |
Merge remote-tracking branch 'origin/master' into async-fs
Diffstat (limited to 'std/os')
| -rw-r--r-- | std/os/linux/index.zig | 2 | ||||
| -rw-r--r-- | std/os/linux/test.zig | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/std/os/linux/index.zig b/std/os/linux/index.zig index 2b0e5e8288..1e11c8b25c 100644 --- a/std/os/linux/index.zig +++ b/std/os/linux/index.zig @@ -999,7 +999,7 @@ pub fn setgroups(size: usize, list: *const u32) usize { } pub fn getpid() i32 { - return @bitCast(i32, u32(syscall0(SYS_getpid))); + return @bitCast(i32, @truncate(u32, syscall0(SYS_getpid))); } pub fn sigprocmask(flags: u32, noalias set: *const sigset_t, noalias oldset: ?*sigset_t) usize { diff --git a/std/os/linux/test.zig b/std/os/linux/test.zig index e7dae3a584..4de26012c7 100644 --- a/std/os/linux/test.zig +++ b/std/os/linux/test.zig @@ -3,6 +3,10 @@ const builtin = @import("builtin"); const linux = std.os.linux; const assert = std.debug.assert; +test "getpid" { + assert(linux.getpid() != 0); +} + test "timer" { const epoll_fd = linux.epoll_create(); var err = linux.getErrno(epoll_fd); |
