Skip to content

Libbpf userspace function bpf_program__set_attach_target

0.0.8

Sets BTF-based attach target for supported BPF program types:

Definition

int bpf_program__set_attach_target(struct bpf_program *prog, int attach_prog_fd, const char *attach_func_name);

Parameters

  • prog: BPF program to set the attach type for
  • attach_prog_fd: the file descriptor of the BPF program to attach to, 0 if not attaching to another BPF program
  • attach_func_name: the name of the function to attach to

Return

error code; or 0 if no error occurred.

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