Skip to content

Libbpf userspace function bpf_link__disconnect

0.0.7

Release "ownership" of underlying BPF resource

Definition

void bpf_link__disconnect(struct bpf_link *link);

Parameters

  • link: BPF link to disconnect

Usage

Disconnected link, when destructed through bpf_link__destroy call won't attempt to detach/unregister that BPF resource. This is useful in situations where, say, attached BPF program has to outlive userspace program that attached it in the system. Depending on type of BPF program, though, there might be additional steps (like pinning BPF program in BPFFS) necessary to ensure exit of userspace program doesn't trigger automatic detachment and clean up inside the kernel.

Example

Docs could be improved

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