nc 0.9.8

Access system calls directly
Documentation
1
2
3
4
5
6
7
/// Perform a command on an extended BPF map or program
pub unsafe fn bpf(cmd: i32, attr: &mut bpf_attr_t, size: u32) -> Result<i32, Errno> {
    let cmd = cmd as usize;
    let attr_ptr = core::ptr::from_mut(attr) as usize;
    let size = size as usize;
    unsafe { syscall3(SYS_BPF, cmd, attr_ptr, size).map(|ret| ret as i32) }
}