diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-06-15 15:51:19 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-06-15 15:51:19 +0000 |
commit | ab5435e8bc9b10ed3dc05787c10d28bb8957a42a (patch) | |
tree | bac695c2898deaa067e90200d1d6b59a4235c86a | |
parent | 06850b29100ac94a90b6d1ee736f2097235379b6 (diff) | |
parent | d50f569c32238f81c4aa3ee0ec0191c11bfcfe6e (diff) | |
download | nix-ab5435e8bc9b10ed3dc05787c10d28bb8957a42a.zip |
Merge #600
600: Change sched_setaffinity's PID argument to pid_t r=asomers
I might be missing something as to why this argument was made `isize`, but there's nothing obvious from the commit history, and other calls that work with thread IDs in this library return `pid_t`, so hopefully this is a nit and not noise.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/sched.rs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b97155d..9eb9b913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ([#542](https://github.com/nix-rust/nix/pull/542)) - Changed type signature of `sys::select::FdSet::contains` to make `self` immutable ([#564](https://github.com/nix-rust/nix/pull/564)) +- Changed type of `sched::sched_setaffinity`'s `pid` argument to `pid_t` ### Removed - Removed io::Error from nix::Error and conversion from nix::Error to Errno diff --git a/src/sched.rs b/src/sched.rs index dee3107e..eefd29b2 100644 --- a/src/sched.rs +++ b/src/sched.rs @@ -91,9 +91,9 @@ mod ffi { } } -pub fn sched_setaffinity(pid: isize, cpuset: &CpuSet) -> Result<()> { +pub fn sched_setaffinity(pid: pid_t, cpuset: &CpuSet) -> Result<()> { let res = unsafe { - libc::sched_setaffinity(pid as libc::pid_t, + libc::sched_setaffinity(pid, mem::size_of::<CpuSet>() as libc::size_t, mem::transmute(cpuset)) }; |