Skip to content

Libbpf userspace function libbpf_probe_bpf_map_type

0.7.0

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

Definition

int libbpf_probe_bpf_map_type(enum bpf_map_type map_type, const void *opts);

Parameters

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

Return

1, if given map type is supported; 0, if given map 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