Libbpf userspace function libbpf_probe_bpf_prog_type
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 foropts
: reserved for future extensibility, should beNULL
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