Skip to content

Commit

Permalink
libbpf-rs: add map freeze
Browse files Browse the repository at this point in the history
Signed-off-by: Joanne Koong <joannekoong@gmail.com>
  • Loading branch information
insearchoflosttime committed Jul 26, 2022
1 parent 19b146a commit 2d728a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libbpf-rs/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,12 @@ impl Map {
util::parse_ret(ret)
}

pub fn freeze(&self) -> Result<()> {
let ret = unsafe { libbpf_sys::bpf_map_freeze(self.fd) };

util::parse_ret(ret)
}

/// Returns an iterator over keys in this map
///
/// Note that if the map is not stable (stable meaning no updates or deletes) during iteration,
Expand Down

0 comments on commit 2d728a9

Please # to comment.