提交 4d903a1b authored 作者: Serhij S's avatar Serhij S

print last os error on sched

上级 27728f3e
......@@ -475,6 +475,10 @@ fn apply_thread_params(tid: libc::c_int, params: &RTParams) -> Result<()> {
}
let res = libc::sched_setaffinity(tid, std::mem::size_of::<libc::cpu_set_t>(), &cpuset);
if res != 0 {
eprintln!(
"Error setting CPU affinity: {}",
std::io::Error::last_os_error()
);
return Err(Error::RTSchedSetAffinity(res));
}
}
......@@ -490,6 +494,10 @@ fn apply_thread_params(tid: libc::c_int, params: &RTParams) -> Result<()> {
)
};
if res != 0 {
eprintln!(
"Error setting scheduler: {}",
std::io::Error::last_os_error()
);
return Err(Error::RTSchedSetSchduler(res));
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论