glob_match_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay bestie, welcome to the Kernel API Manual πŸ’– β€” the main character here is glob_match_len(9), and it does exactly what it says on the tin: a glob match against a length-bounded string. no cap, that's the whole vibe check πŸŽ€

🌸 SYNOPSIS 🌸

       bool __pure glob_match_len (char const *pat , char const *str , size_t
       len );

πŸŽ€ ARGUMENTS πŸŽ€

  • pat β€” the shell-style pattern you're matching against. slay πŸ’…
  • str β€” the string being matched. it literally need not be NUL-terminated 🫢
  • len β€” how many bytes of str may be read. that's the boundary, bestie πŸ¦‹

πŸ¦‹ DESCRIPTION πŸ¦‹

so it's like glob_match, except str is only read up to len bytes β€” which means it can be used on buffers that are not NUL-terminated (e.g. trace event fields). iconic use case, honestly πŸ”₯

and yes: a NUL byte within len still terminates the string. important detail, don't sleep on it πŸ’€

🌈 SEE ALSO 🌈

  • Kernel file ./lib/glob.c β€” and the related glob_match(9) πŸ‘‘

mwah πŸ’‹ this page's source/version footer is ./lib, it's dated October 2026, and it stars glob_match_len(9) β€” bye bestie, go read those bounded bytes 🫢✨

πŸ“¦ where this page comes from