Libbpf userspace function bpf_map__pin
Creates a file that serves as a 'pin' for the BPF map. This increments the reference count on the BPF map which will keep the BPF map loaded even after the userspace process which loaded it has exited.
Definition
int bpf_map__pin(struct bpf_map *map, const char *path);
Parameters
map
: The bpf_map to pinpath
: A file path for the 'pin'
Return
0
, on success; negative error, otherwise
Usage
If path
is NULL
the maps pin_path
attribute will be used. If this is also NULL
, an error will be returned and the map will not be pinned.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome