Libbpf userspace function bpf_obj_pin_opts
Low level wrapper around the BPF_OBJ_PIN
syscall command.
Definition
int bpf_obj_pin_opts(int fd, const char *pathname, const struct bpf_obj_pin_opts *opts);
Parameters
fd
: file descriptor of the object to pinpathname
: path to the directory where the object will be pinnedopts
: pointer to abpf_obj_pin_opts
structure
Return
0
, on success; negative error code, otherwise
struct bpf_obj_pin_opts
struct bpf_obj_pin_opts {
size_t sz; /* size of this struct for forward/backward compatibility */
__u32 file_flags;
int path_fd;
size_t :0;
};
file_flags
path_fd
Usage
This function should only be used if you need precise control over the object pinning process. In most cases the bpf_object__pin
function should be used instead.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome