Skip to content

Libbpf userspace function bpf_linker__add_buf

1.6.0

Add a ELF file as memory buffer to the linker.

Definition

int bpf_linker__add_buf(struct bpf_linker *linker, void *buf, size_t buf_sz, const struct bpf_linker_file_opts *opts);

Parameters

  • linker: pointer to a struct bpf_linker object
  • buf: pointer to the ELF file buffer
  • buf_sz: size of the ELF file buffer
  • opts: pointer to a struct bpf_linker_file_opts object that contains options for the file

Return

0, on success; On error negative error code, and errno is set to the error code.

struct bpf_linker_file_opts

struct bpf_linker_file_opts {
    /* size of this struct, for forward/backward compatibility */
    size_t sz;
};

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