Skip to content

Libbpf userspace function libbpf_probe_bpf_prog_type

0.7.0

Detects if host kernel supports BPF programs of a given type.

Definition

int libbpf_probe_bpf_prog_type(enum bpf_prog_type prog_type, const void *opts);

Parameters

  • prog_type: BPF program type to detect kernel support for
  • opts: reserved for future extensibility, should be NULL

Return

1, if given program type is supported; 0, if given program type is not supported; negative error code if feature detection failed or can't be performed

Usage

Make sure the process has required set of CAP_* permissions (or runs as root) when performing feature checking.

Example

Docs could be improved

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