swsusp_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŒ€ 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