Skip to content

Commit b4ffeac

Browse files
committed
Change sched_setaffinity's PID argument to pid_t
The officially documented type, and the type in sched.h, for this argument is pid_t.
1 parent 8498bd9 commit b4ffeac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2020
([#542](https://github.com/nix-rust/nix/pull/542))
2121
- Changed type signature of `sys::select::FdSet::contains` to make `self`
2222
immutable ([#564](https://github.com/nix-rust/nix/pull/564))
23+
- Changed type of `sched::sched_setaffinity`'s `pid` argument to `pid_t`
2324

2425
### Fixed
2526
- Fixed multiple issues compiling under different archetectures and OSes.

src/sched.rs

Lines changed: 2 additions & 2 deletions
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)