NVME_SET_FEATURES_WRITE_ATOMIC(2)

✨ NAME ✨

nvme_set_features_write_atomic β€” the lil function that sets the write atomic feature on your NVMe device πŸ’– it's giving "yes bestie, let's configure that atomicity"

Okay so real talk, this is from the libnvme API manual, section 2 of the manual pages, and it's lowkey one of those functions you call when you wanna tell your drive how to behave around write atomicity. Periodt.


🌸 SYNOPSIS 🌸

int nvme_set_features_write_atomic (int fd , bool dn , bool save , __u32 *result );

That's it, that's the whole vibe check. Four args, one int coming back at you 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • fd β€” File descriptor of nvme device. Like, the handle to your drive. You gotta have one of these or we're not going anywhere, fr fr πŸ¦‹
  • dn β€” Disable Normal. Yep, that's the flag name, it's literally "Disable Normal" and it's a bool so it's either on or off, no in-between πŸ’…
  • save β€” Save value across power states. So if you want this setting to survive a reboot / power cycle situation, you set this. Main character energy: persistent. ✨
  • result β€” The command completion result from CQE dword0. It's a __u32 * pointer, so the answer gets written back through here. The CQE is the completion queue entry, and dword0 is where the good stuff lives πŸ‘‘

πŸ’œ RETURN πŸ’œ

So here's what you get back:

  • The nvme command status if a response was received β€” and bestie, you check that status against enum nvme_status_field to actually decode what happened πŸ”₯
  • Or -1 with errno set otherwise 😭 (that's the "something went sideways" path, and errno will tell you the tea)
ngl, if you're getting -1, go read errno before you spiral. The info is right there. πŸ™ˆ

That's the whole page, no notes. πŸ’…

Sign-off time: this iconic lil page came from the libnvme API manual, and its date stamp is July 2026 β€” so yeah, it's got that future-fresh energy ⭐🌸 no cap, slay, bye bestie πŸ«ΆπŸ’–

πŸ“¦ where this page comes from