summaryrefslogtreecommitdiffstats
path: root/tools/lib/vsprintf.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-07-08 03:53:14 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2020-07-09 00:44:44 +0200
commit81372e121802fd57892a0b44d93cc747d9568627 (patch)
tree08df7675a75b4633d886ad3c740fd1845bc27294 /tools/lib/vsprintf.c
parentlibbpf: Make BTF finalization strict (diff)
downloadlinux-81372e121802fd57892a0b44d93cc747d9568627.tar.xz
linux-81372e121802fd57892a0b44d93cc747d9568627.zip
libbpf: Add btf__set_fd() for more control over loaded BTF FD
Add setter for BTF FD to allow application more fine-grained control in more advanced scenarios. Storing BTF FD inside `struct btf` provides little benefit and probably would be better done differently (e.g., btf__load() could just return FD on success), but we are stuck with this due to backwards compatibility. The main problem is that it's impossible to load BTF and than free user-space memory, but keep FD intact, because `struct btf` assumes ownership of that FD upon successful load and will attempt to close it during btf__free(). To allow callers (e.g., libbpf itself for BTF sanitization) to have more control over this, add btf__set_fd() to allow to reset FD arbitrarily, if necessary. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20200708015318.3827358-3-andriin@fb.com
Diffstat (limited to 'tools/lib/vsprintf.c')
0 files changed, 0 insertions, 0 deletions