Skip to content

KFunc bpf_strrchr

v6.17

Find the last occurrence of a character in a string

Definition

Parameters

s__ign: The string to be searched

c: The character to search for

Return

  • >=0 - Index of the last occurrence of c within s__ign
  • -ENOENT - c not found in 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_strrchr(const char *s__ign, int c)

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