Skip to content

Libbpf userspace function bpf_object__open_mem

0.0.6

creates a struct bpf_object by reading the BPF objects raw bytes from a memory buffer containing a valid BPF ELF object file.

Definition

struct bpf_object * bpf_object__open_mem(const void *obj_buf, size_t obj_buf_sz, const struct bpf_object_open_opts *opts);

Parameters

  • obj_buf: pointer to the buffer containing ELF file bytes
  • obj_buf_sz: number of bytes in the buffer
  • opts: options for how to load the bpf object

Return

pointer to the new struct bpf_object; or NULL is returned on error, error code is stored in errno

Usage

Docs could be improved

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

Example

Docs could be improved

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