Skip to content

Commit ab5435e

Browse files
committed
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.
2 parents 06850b2 + d50f569 commit ab5435e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3131
([#542](https://github.com/nix-rust/nix/pull/542))
3232
- Changed type signature of `sys::select::FdSet::contains` to make `self`
3333
immutable ([#564](https://github.com/nix-rust/nix/pull/564))
34+
- Changed type of `sched::sched_setaffinity`'s `pid` argument to `pid_t`
3435

3536
### Removed
3637
- Removed io::Error from nix::Error and conversion from nix::Error to Errno

src/sched.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ mod ffi {
9191
}
9292
}
9393

94-
pub fn sched_setaffinity(pid: isize, cpuset: &CpuSet) -> Result<()> {
94+
pub fn sched_setaffinity(pid: pid_t, cpuset: &CpuSet) -> Result<()> {
9595
let res = unsafe {
96-
libc::sched_setaffinity(pid as libc::pid_t,
96+
libc::sched_setaffinity(pid,
9797
mem::size_of::<CpuSet>() as libc::size_t,
9898
mem::transmute(cpuset))
9999
};

0 commit comments

Comments
 (0)