STRUCT KUNIT_LOC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct kunit_loc(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’– today's main character is struct kunit_loc, and honestly? she's giving "tiny but crucial." This one identifies the source location of a line of code. iykyk β€” like a little name tag for where a thing happened πŸ’…


🌸 NAME 🌸

struct kunit_loc β€” identifies the source location of a line of code ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct kunit_loc {
    int line;
    const char *file;
 };

no cap, that's the whole struct. two members. she's lowkey minimal and that's her brand πŸŽ€


πŸ’œ Members πŸ’œ

  • line β€” the line number in the file. literally just the number of the line, bestie πŸ“
  • file β€” the file name. which file? this file. the one we're talking about πŸ—‚οΈ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/kunit/assert.h β€” go check her out, she's iconic πŸ‘‘

  • enum kunit_assert_type(9)
  • struct kunit_assert(9)
  • struct kunit_fail_assert(9)
  • struct kunit_unary_assert(9)
  • struct kunit_ptr_not_err_assert(9)
  • struct kunit_binary_assert_text(9)
  • struct kunit_binary_assert(9)
  • struct kunit_binary_ptr_assert(9)
  • struct kunit_binary_str_assert(9)
  • struct kunit_mem_assert(9)

like, the whole assert friend group fr fr 🫢


mwah πŸ’‹ this page lives at ./include/kunit, it's the October 2026 edition, and yes β€” she's still signing her name struct kunit_loc(9) at the bottom like the queen she is πŸ‘‘βœ¨

πŸ“¦ where this page comes from