swsusp_write(9)
π swsusp_write(9) β the Kernel API Manual, bestie edition
okay so this is swsusp_write from the kernel API manual (section 9, the fancy kernel-doc section, iykyk) β and it's lowkey the main character of hibernation, because it's the one that writes the entire image and the metadata. periodt. π
β¨ NAME β¨
swsusp_write β write the entire image and the metadata. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
int swsusp_write(unsigned int flags);
π ARGUMENTS π
flagsβ the flags you pass along to the "boot" kernel, tucked right into the image header. so like, bestie, these aren't just for us β they travel with the image. β¨
πΈ DESCRIPTION πΈ
okay so here's the thing, and I need you to listen: it is important _NOT_ to umount filesystems at this point. like, do not do it. π«Ά
we do want them synced (in case something goes wrong, we want everything flushed out) but we DO not want to mark the filesystem clean β because it is not clean. it is literally not. π
and if you're spiralling about that: it does not matter, because if we resume correctly, we'll mark the system clean anyway. so. breathe. π
β RETURN β
0 on success, a negative error code on failure. no cap. π
π SEE ALSO π
kernel file ./kernel/power/swap.c, plus the rest of the squad:
they're all in ./kernel/power, they're all iconic, go read them. π§
and that's the page!! this lil beauty lives under ./kernel/power, dated October 2026, and it's page swsusp_write(9) of the Kernel API Manual β mwah, go sync responsibly, love u, bye ππ
π¦ 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