Skip to content

KFunc bpf_strnlen

unknown

Calculate the length of a length-limited string

Definition

Parameters

s__ign: The string

count`: The maximum number of characters to count

Return

  • >=0 - The length of s__ign
  • -EFAULT - Cannot read s__ign
  • -E2BIG - s__ign is too large
  • -ERANGE - s__ign is outside of kernel address space

Signature

int bpf_strnlen(const char *s__ign, size_t count)

Usage

Docs could be improved

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

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

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