Skip to content

Libbpf userspace function btf__add_fwd

0.2.0

Append new BTF_KIND_FWD type to BTF object.

Definition

int btf__add_fwd(struct btf *btf, const char *name, enum btf_fwd_kind fwd_kind);

Parameters

  • btf: pointer to a struct btf object
  • name: name of the forward declaration, can't be NULL or empty;
  • fwd_kind: kind of forward declaration, one of BTF_FWD_STRUCT, BTF_FWD_UNION, or BTF_FWD_ENUM.

Return

>0, type ID of newly added BTF type; <0, on error.

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome