Rust nightly update - cache_side_channel

This commit is contained in:
Guillume DIDIER 2021-06-10 11:18:19 +02:00
parent e4c838e8b0
commit 26538fe913
2 changed files with 5 additions and 5 deletions

View File

@ -7,4 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nix = "0.18.0"
nix = "0.20.0"

View File

@ -41,10 +41,10 @@ pub fn restore_affinity(cpu_set: &CpuSet) {
}
#[must_use = "This result must be used to restore affinity"]
pub fn set_affinity(cpu_set: &CpuSet) -> CpuSet {
let old = sched_getaffinity(Pid::from_raw(0)).unwrap();
sched_setaffinity(Pid::from_raw(0), &cpu_set).unwrap();
old
pub fn set_affinity(cpu_set: &CpuSet) -> Result<CpuSet, nix::Error> {
let old = sched_getaffinity(Pid::from_raw(0))?;
sched_setaffinity(Pid::from_raw(0), &cpu_set)?;
Ok(old)
}
pub trait SingleAddrCacheSideChannel: CoreSpec + Debug {