nvme_io(2)

πŸ’… nvme_io β€” bestie's guide to submitting an NVMe user I/O command πŸ’…

okay so. you want to send an actual I/O command to your NVMe device straight from userspace? iconic. this is the libnvme API manual page for nvme_io, and it's literally the door you knock on when you wanna yeet a command at the drive yourself. no cap. πŸ¦‹


✨ NAME ✨

nvme_io β€” Submit an nvme user I/O command

like. that's it. that's the whole job. submit the command. slay. πŸ‘‘


🌸 SYNOPSIS 🌸

int nvme_io (struct nvme_io_args *args , __u8 opcode );

look at her. two arguments, one int return. main character energy fr fr. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • args β€” this is your struct nvme_io_args argument structure. it's the little bundle of everything you're telling the command: the details live in here, bestie, not in the function call itself. so pack it right. 🫢
  • opcode β€” the opcode to execute. type is __u8, which is the fancy way of saying "one little byte." it's the actual command you're asking the device to run. this is the vibe check of your whole submission. ✨

πŸ’€ RETURN πŸ’€

okay so here's what you get back, and it's giving two very different moods:

  • if a response was received, you get the nvme command status β€” and yes, that's the one from enum nvme_status_field, so go look at that enum if you wanna know what your status actually means. iykyk. πŸ”₯
  • otherwise, you get -1 and errno gets set. so check errno when things go sideways, because that's where the tea is. 😭
lowkey important: the -1 path only happens when there's no response at all. if you got a response, you're reading a status, not an errno. don't mix them up bestie. πŸ’…

🌈 that's the whole page 🌈

genuinely a short one, and honestly? we love a tight manpage. go forth and submit your I/O, you absolute legend. πŸ§šπŸ’–

anyway, this was nvme_io from the libnvme API manual, dated July 2026, living at section nvme_io(2) β€” so when you're deep in the docs at 3am, that's the address to find her at. periodt. πŸŽ€β­

πŸ“¦ where this page comes from