Libbpf userspace function bpf_map_update_elem
Low level wrapper around the BPF_MAP_UPDATE_ELEM syscall command.
Note
This function is part of the libbpf userspace library, but has the same name as the bpf_map_update_elem helper function, which can only be used from an eBPF program.
Definition
int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags);
Parameters
fd: file descriptor of the map to updatekey: pointer to memory containing bytes of the keyvalue: pointer to memory containing bytes of the valueflags: flags passed to kernel for this operation
Return
0, on success; negative error, otherwise
Usage
This function should only be used if you need precise control over the map element update process. In most cases the bpf_map__update_elem function should be used instead.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome