bpf_strnlen(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ bpf_strnlen β€” the Kernel API Manual page, bestie πŸ’…

Okay so hi, welcome to the <rainbow>bpf_strnlen(9)</rainbow> glow-up, straight out of the Kernel API Manual. Yes we are reading kernel manpages now, it's giving main character energy, and honestly? You're gonna slay this. πŸŽ€


🌸 NAME 🌸

bpf_strnlen β€” calculate the length of a length-limited string

No cap, that's literally the whole job. It counts characters, but it knows when to stop. Self-control icon. πŸ’–


✨ SYNOPSIS ✨

__bpf_kfunc int bpf_strnlen (const char *s__ign , size_t count );

Look at her. Signature stays exactly like that, don't touch it. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • s__ign β€” the string. The actual vibe. The thing we're measuring.
  • count β€” the maximum number of characters to count. Like a hard limit, except it's not toxic, it's just safe. 🧚

πŸ”₯ RETURN πŸ”₯

Here's your vibe check on what comes back:

  • >=0 β€” the length of s__ign. Slay. πŸ’œ
  • -EFAULT β€” cannot read s__ign. It's giving unreadable, and not in a mysterious way. 😭
  • -E2BIG β€” s__ign is too large. Girl is doing too much. πŸ’€
  • -ERANGE β€” s__ign is outside of kernel address space. Literally not from around here. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/bpf/helpers.c

And now, the friend group. The whole group chat. Every single one of them, we're not leaving anybody out:

Forty-seven icons. We counted. Obsessed with every single one of them. 🌈


Okay that's the page!! Mwah πŸ’‹ β€” this little love letter lives in ./kernel/bpf, it's dated October 2026, and it goes by bpf_strnlen(9). Bookmark her, she's iconic. πŸ“βœ¨

πŸ“¦ where this page comes from