Skip to content

Libbpf userspace function bpf_obj_get_info_by_fd

0.0.1

Low level wrapper around the BPF_OBJ_GET_INFO_BY_FD syscall command.

Definition

int bpf_obj_get_info_by_fd(int bpf_fd, void *info, __u32 *info_len);

Parameters

  • bpf_fd: file descriptor of the BPF object
  • info: buffer to store the information about the BPF object
  • info_len: size of the info buffer

Return

>0, amount of information written to the info buffer; negative error code, otherwise

Usage

This function allows you to retrieve information about a BPF object by its file descriptor. The information will be written to info, the structure of the info depends on the underlying object type.

Example

Docs could be improved

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