Rust nightly update - cache_side_channel
This commit is contained in:
parent
e4c838e8b0
commit
26538fe913
@ -7,4 +7,4 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nix = "0.18.0"
|
nix = "0.20.0"
|
||||||
|
@ -41,10 +41,10 @@ pub fn restore_affinity(cpu_set: &CpuSet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[must_use = "This result must be used to restore affinity"]
|
#[must_use = "This result must be used to restore affinity"]
|
||||||
pub fn set_affinity(cpu_set: &CpuSet) -> CpuSet {
|
pub fn set_affinity(cpu_set: &CpuSet) -> Result<CpuSet, nix::Error> {
|
||||||
let old = sched_getaffinity(Pid::from_raw(0)).unwrap();
|
let old = sched_getaffinity(Pid::from_raw(0))?;
|
||||||
sched_setaffinity(Pid::from_raw(0), &cpu_set).unwrap();
|
sched_setaffinity(Pid::from_raw(0), &cpu_set)?;
|
||||||
old
|
Ok(old)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait SingleAddrCacheSideChannel: CoreSpec + Debug {
|
pub trait SingleAddrCacheSideChannel: CoreSpec + Debug {
|
||||||
|
Loading…
Reference in New Issue
Block a user