check_mul_overflow(9)
π check_mul_overflow β like, the Kernel API Manual, section 9, bestie π
okay so bestie, welcome to check_mul_overflow(9) β yes it's a section 9 kernel API page, and yes it's lowkey iconic. pull up a chair, grab your iced coffee, and let's get into it π«Ά
β¨ NAME β¨
check_mul_overflow β does your multiplication and also tells you if it overflowed. like a math bestie who does the work AND the vibe check π
πΈ SYNOPSIS πΈ
check_mul_overflow (a , b , d );
that's it. three args. no notes. slay.
π ARGUMENTS π
aβ the first factor, aka the first number you're multiplying. main character number #1 β¨bβ the second factor, the other number. main character number #2 β¨dβ a pointer where the product gets stored. it's giving "put the result here please" π
π¦ DESCRIPTION π¦
okay so here's the tea, and it's actually a really good tea:
Returns true on wrap-around, and false otherwise. that's the whole vibe check β did the multiplication wrap around or not π₯
and here's the part that matters: *d holds the results of the attempted multiplication, regardless of whether wrap-around occurred. like, it's gonna write the product either way. it doesn't withhold. it's not petty. it tells you the answer and whether it wrapped. no cap π
ngl this is the important bit β even if wrap-around happened,*dstill got written. don't go assuming*dis untouched just because you got atrueback π
π SEE ALSO π
real ones know the whole overflow family, and here's the entire crew β go say hi π
- Kernel file
./include/linux/overflow.hβ that's where all this magic lives bestie π check_add_overflow(9)wrapping_add(9)wrapping_assign_add(9)check_sub_overflow(9)wrapping_sub(9)wrapping_assign_sub(9)wrapping_mul(9)check_shl_overflow(9)overflows_type(9)range_overflows(9)range_overflows_t(9)range_end_overflows(9)range_end_overflows_t(9)castable_to_type(9)size_mul(9)size_add(9)size_sub(9)array_size(9)array3_size(9)flex_array_size(9)struct_size(9)struct_size_t(9)struct_offset(9)__DEFINE_FLEX(9)_DEFINE_FLEX(9)DEFINE_RAW_FLEX(9)DEFINE_FLEX(9)STACK_FLEX_ARRAY_SIZE(9)typeof_flex_counter(9)overflows_flex_counter_type(9)__set_flex_counter(9)
and that's the page, bestie! π§ this one ships out of ./include/linux and it's dated October 2026 β so yeah, mark your calendar, this manual page is literally from the future and it ate π
π
π¦ 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