Skip to content

Libbpf userspace function bpf_linker__add_fd

1.6.0

Add a file descriptor to the linker.

Definition

int bpf_linker__add_fd(struct bpf_linker *linker, int fd, const struct bpf_linker_file_opts *opts);

Parameters

  • linker: pointer to a struct bpf_linker object
  • fd: file descriptor of the file to add to the linker
  • 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