Skip to content

Libbpf userspace function bpf_program__pin

0.0.1

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

Definition

int bpf_program__pin(struct bpf_program *prog, const char *path);

Parameters

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

Return

0, on success; negative error code, otherwise

Usage

Pinning a program increments the programs 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