Libbpf userspace function bpf_map__delete_elem
Allows to delete element in BPF map that corresponds to provided key.
Definition
int bpf_map__delete_elem(const struct bpf_map *map, const void *key, size_t key_sz, __u64 flags);
Parameters
map
: BPF map to delete element fromkey
: pointer to memory containing bytes of the keykey_sz
: size in bytes of key data, needs to match BPF map definition'skey_size
flags
: flags passed to kernel for this operation
Return
0
, on success; negative error, otherwise
Usage
bpf_map__delete_elem()
is high-level equivalent of bpf_map_delete_elem()
API with added check for key size.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome