Skip to content

KFunc bpf_strcmp

v6.17

Compare two strings

Definition

Parameters

s1__ign: One string

s2__ign: Another string

Returns

  • 0 - Strings are equal
  • -1 - s1__ign is smaller
  • 1 - s2__ign is smaller
  • -EFAULT - Cannot read one of the strings
  • -E2BIG - One of strings is too large
  • -ERANGE - One of strings is outside of kernel address space

Signature

int bpf_strcmp(const char *s1__ign, const char *s2__ign)

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