summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2017-06-15 15:51:19 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2017-06-15 15:51:19 +0000
commitab5435e8bc9b10ed3dc05787c10d28bb8957a42a (patch)
treebac695c2898deaa067e90200d1d6b59a4235c86a
parent06850b29100ac94a90b6d1ee736f2097235379b6 (diff)
parentd50f569c32238f81c4aa3ee0ec0191c11bfcfe6e (diff)
downloadnix-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.md1
-rw-r--r--src/sched.rs4
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))
};