Skip to content

Libbpf userspace function bpf_object__kversion

0.0.1

Get the kernel version associated with the BPF object.

Definition

unsigned int bpf_object__kversion(const struct bpf_object *obj);

Returns

The kernel version, encoded as an integer. See KERNEL_VERSION details.

Usage

This version number is gotten from the version ELF section and indicates the kernel version the object was built against. If the ELF file does not contain a version section, the kernel version is probed at load time.

This version number is passed to the kernel when loading the program, see kern_version.

Example

Docs could be improved

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