Skip to content

Libbpf userspace function btf__add_func_proto

0.2.0

Append new BTF_KIND_FUNC_PROTO type to BTF object.

Definition

int btf__add_func_proto(struct btf *btf, int ret_type_id);

Parameters

  • btf: pointer to a struct btf object
  • ret_type_id: type ID for return result of a function

Return

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

Usage

Function prototype initially has no arguments, but they can be added by btf__add_func_param one by one, immediately after btf__add_func_proto succeeded.

Example

Docs could be improved

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