glob_match_len(9)
β¨ 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 ofstrmay 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 relatedglob_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms