nvme_identify_primary_ctrl(2)

πŸ’– nvme_identify_primary_ctrl(2) πŸ’–

okay bestie, so this one lives in the libnvme API manual, section 2, and it's literally called nvme_identify_primary_ctrl. She's giving "go ask the NVMe Primary Controller who she is" energy. Let's get into it. πŸ¦‹


✨ NAME ✨

nvme_identify_primary_ctrl β€” Retrieve NVMe Primary Controller identification 🌸

Like, that's the whole job. Retrieval. Identification. Primary Controller. Iconic.


✨ SYNOPSIS ✨

int nvme_identify_primary_ctrl (int fd , __u16 cntid , struct
nvme_primary_ctrl_cap *cap );

Three little args, one big slay. πŸ’…


✨ ARGUMENTS ✨

  • fd β€” the file descriptor of your nvme device 🫢. This is your golden ticket, your backstage pass.
  • cntid β€” return controllers starting at this identifier. So you're saying "bestie, start the tea at this number" and she takes it from there. 🌈
  • cap β€” user space destination buffer address where the data gets transferred to. It's the lil box you hand her and go "put the info in here, queen." πŸŽ€

✨ DESCRIPTION ✨

So the deets are: peep struct nvme_primary_ctrl_cap for the definition of the returned structure, cap. πŸ‘‘

That's it. That's the description. The struct is where the real lore lives, go read it, iykyk. πŸ“–βœ¨


✨ RETURN ✨

What do you get back, you ask? Two possibilities, and bestie you want the first one:

  • The nvme command status if a response was received β€” and you can go check enum nvme_status_field if you need the full breakdown of what each status means. πŸ”
  • Or -1, with errno set otherwise. 😭 Not the vibe. Something went wrong. Go check that errno.
fr fr, -1 is your cue to stop and actually read errno instead of staring at the screen like πŸ‘οΈπŸ‘„πŸ‘οΈ

and that's the whole page, periodt πŸ’œ

kisses, this was the libnvme API manual, and our date stamp said July 2026. Go forth and identify those primary controllers, bestie. πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from