Skip to content

Libbpf userspace function btf__add_array

0.2.0

Append new BTF_KIND_ARRAY type to BTF object.

Definition

int btf__add_array(struct btf *btf, int index_type_id, int elem_type_id, __u32 nr_elems);

Parameters

  • btf: pointer to a struct btf object
  • index_type_id: type ID of the type describing array index;
  • elem_type_id: type ID of the type describing array element;
  • nr_elems: the size of the array;

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