Skip to content

Libbpf userspace function bpf_link__pin

0.0.8

Pins the BPF link to a file in the BPFFS specified by a path.

Definition

int bpf_link__pin(struct bpf_link *link, const char *path);

Parameters

  • link: BPF link to pin, must already be loaded
  • path: file path in a BPF file system

Return

0, on success; negative error code, otherwise

Usage

This increments the links reference count, allowing it to stay loaded after the process which loaded it has exited.

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome