authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-12-22 12:25:45+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-12-22 20:20:58+11:00
log95c83388e452d83e407fbaaf1431d5a19cfca4a3
treefdd22e3c54748a6a7a8d33fc3ee7f08bf0ae5543
parent59348240d751ca45c64f19346ff4ca6ad686f2d9
signature Commit is signed but in an unrecognized format.

std: use pid_t where appropriate


1 files changed, 7 insertions(+), 7 deletions(-)

lib/std/os/linux.zig+7-7
...@@ -464,7 +464,7 @@ pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize {...@@ -464,7 +464,7 @@ pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize {
464 return syscall3(SYS_getrandom, @ptrToInt(buf), count, flags);464 return syscall3(SYS_getrandom, @ptrToInt(buf), count, flags);
465}465}
466466
467pub fn kill(pid: i32, sig: i32) usize {467pub fn kill(pid: pid_t, sig: i32) usize {
468 return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig)));468 return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig)));
469}469}
470470
...@@ -488,7 +488,7 @@ pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize {...@@ -488,7 +488,7 @@ pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize {
488 return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags);488 return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags);
489}489}
490490
491pub fn waitpid(pid: i32, status: *u32, flags: u32) usize {491pub fn waitpid(pid: pid_t, status: *u32, flags: u32) usize {
492 return syscall4(SYS_wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0);492 return syscall4(SYS_wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0);
493}493}
494494
...@@ -665,12 +665,12 @@ pub fn setgroups(size: usize, list: *const u32) usize {...@@ -665,12 +665,12 @@ pub fn setgroups(size: usize, list: *const u32) usize {
665 }665 }
666}666}
667667
668pub fn getpid() i32 {668pub fn getpid() pid_t {
669 return @bitCast(i32, @truncate(u32, syscall0(SYS_getpid)));669 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_getpid)));
670}670}
671671
672pub fn gettid() i32 {672pub fn gettid() pid_t {
673 return @bitCast(i32, @truncate(u32, syscall0(SYS_gettid)));673 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_gettid)));
674}674}
675675
676pub fn sigprocmask(flags: u32, noalias set: ?*const sigset_t, noalias oldset: ?*sigset_t) usize {676pub fn sigprocmask(flags: u32, noalias set: ?*const sigset_t, noalias oldset: ?*sigset_t) usize {
...@@ -965,7 +965,7 @@ pub fn sched_yield() usize {...@@ -965,7 +965,7 @@ pub fn sched_yield() usize {
965 return syscall0(SYS_sched_yield);965 return syscall0(SYS_sched_yield);
966}966}
967967
968pub fn sched_getaffinity(pid: i32, size: usize, set: *cpu_set_t) usize {968pub fn sched_getaffinity(pid: pid_t, size: usize, set: *cpu_set_t) usize {
969 const rc = syscall3(SYS_sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set));969 const rc = syscall3(SYS_sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set));
970 if (@bitCast(isize, rc) < 0) return rc;970 if (@bitCast(isize, rc) < 0) return rc;
971 if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc);971 if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc);