Libbpf userspace function bpf_object__set_kversion
Set the kernel version associated with the BPF object.
Definition
int bpf_object__set_kversion(struct bpf_object *obj, __u32 kern_version);
Parameters
obj
: The BPF object to set the kernel version for.kern_version
: The kernel version to set, encoded as an integer. SeeKERNEL_VERSION
details.
Returns
- 0 on success, or a negative error code on failure.
Usage
This function allows you to override the kernel version associated with the BPF object. This version number is used when loading the object into the kernel, see kern_version
.
Note
This value was once used for cross-kernel compatibility, but is now unused. CO-RE has replaced this functionality.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome