mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-29 04:39:06 +08:00
libbpf: Add bpf_link detach APIs
Add low-level bpf_link_detach() API. Also add higher-level bpf_link__detach() one. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20200731182830.286260-3-andriin@fb.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
80a52e3252
commit
2d97d4097f
@@ -7748,6 +7748,11 @@ struct bpf_link *bpf_link__open(const char *path)
|
||||
return link;
|
||||
}
|
||||
|
||||
int bpf_link__detach(struct bpf_link *link)
|
||||
{
|
||||
return bpf_link_detach(link->fd) ? -errno : 0;
|
||||
}
|
||||
|
||||
int bpf_link__pin(struct bpf_link *link, const char *path)
|
||||
{
|
||||
int err;
|
||||
|
||||
Reference in New Issue
Block a user