Skip to content

Libbpf userspace function bpf_prog_detach2

0.0.1

Low level wrapper around the BPF_PROG_DETACH syscall command.

Definition

int bpf_prog_detach2(int prog_fd, int attachable_fd, enum bpf_attach_type type);

Parameters

  • prog_fd: file descriptor of the program to detach
  • attachable_fd: file descriptor of the attachable object
  • type: type of the attachment

Return

0, on success; negative error code, otherwise

Usage

This function should only be used for specific program types that need to be detached via the BPF_PROG_DETACH syscall command and you need specific control over this process. In most cases, the bpf_link__detach or bpf_link__destroy function should be used.

Example

Docs could be improved

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