[go: up one dir, main page]

auxv 0.3.2

Access the ELF auxiliary vector (aka auxv or auxval).
Documentation
#[cfg(target_os = "linux")]
extern crate auxv;

#[test]
#[cfg(target_os = "linux")]
fn search_procfs_finds_hwcap() {
    let map = auxv::procfs::search_procfs_auxv(&[auxv::AT_HWCAP]).unwrap();
    // there should be SOMETHING in the value
    assert!(*map.get(&auxv::AT_HWCAP).unwrap() > 0);
}

#[test]
#[cfg(target_os="linux")]
fn iterate_procfs_finds_hwcap() {
    let iter = auxv::procfs::iterate_procfs_auxv().unwrap();

    assert_eq!(1, iter.map(|r| r.unwrap())
        .filter(|p| p.key == auxv::AT_HWCAP)
        .count());
}