copy_mc_to_kernel(9)
πΈ copy_mc_to_kernel(9) πΈ
okay bestie, welcome to the Kernel API Manual, grab a strawberry π and let's talk about the memory copy that handles source exceptions β yes, that's the whole vibe of this page π
β¨ NAME β¨
copy_mc_to_kernel β a memory copy that handles source exceptions π«Ά
π SYNOPSIS π
unsigned long copy_mc_to_kernel (void *dst, const void *src, unsigned len );
like, that's the whole signature, no cap β¨
π ARGUMENTS π
dstβ the destination address πsrcβ the source address πlenβ number of bytes to copy, literally the whole count π’
π¦ DESCRIPTION π¦
So here's the tea: this thing calls into the 'fragile' version on systems that benefit from avoiding corner case poison consumption scenarios π for example, accessing poison across 2 cachelines with a single instruction β yeah, exactly that kind of cursed energy π
Almost all other uses case can use copy_mc_enhanced_fast_string for a fast recoverable copy, or fallback to plain memcpy π iykyk.
It returns 0 for success, or the number of bytes not copied if there was an exception π so like, always check the return value bestie, fr fr.
π SEE ALSO π
- Kernel file
./arch/x86/lib/copy_mc.cπ
okay that's the whole page, go forth and copy safely π§
this one came to you from ./arch/x86/lib, October 2026, and the page itself is copy_mc_to_kernel(9) β mwah, slay, periodt π
π
π¦ 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