diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-07-31 11:28:27 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-01 20:38:28 -0700 |
commit | 2e49527e52486dac910460b1b3f6fce6e21c6b48 (patch) | |
tree | 49e845274097de42bf2d254945120233936f196a /tools/lib/bpf/libbpf.c | |
parent | 73b11c2ab072d5b0599d1e12cc126f55ee306daf (diff) |
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
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index b9f11f854985..7be04e45d29c 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -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; |