On 3/14/22 1:15 PM, Grant Seltzer Richman wrote:
Hi there, If I call `bpf_map_create()` successfully I'll have a file descriptor and not a `struct bpf_map`. This stifles me from using a lot of the `bpf_map__` API functions, for example `bpf_map__pin()`. What's the reason for this? Is there a way to get a `struct bpf_map` that I'm missing?
To use bpf_map__* apis, you need a bpf program which conforms to libbpf bpf program/map format (see selftests/bpf/) and from there you can use bpf_map__* or other libbpf api's. If you use bpf_map_create(), you can use bpf_obj_pin().
Thanks so much, Grant Seltzer P.s. been a while since I've worked on adding docs, but I will finally be getting back to it!