nvme_scan_topology(2)

✨ nvme_scan_topology(2) ✨

okay bestie, welcome to the libnvme API manual πŸ’– this one's short, sweet, and honestly kind of iconic. let's get into it 🫢


🌸 NAME 🌸

nvme_scan_topology β€” scan the NVMe topology and apply a filter πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int nvme_scan_topology (nvme_root_t r , nvme_scan_filter_t f , void
*f_args );

like... she's giving three arguments and a dream, no cap ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • r β€” your nvme_root_t object. the whole main-character of the operation, fr fr πŸ‘‘
  • f β€” the filter you wanna apply. yes queen, decide what you're keeping πŸŽ€
  • f_args β€” a user-specified argument that gets handed off to f. it's literally her little sidekick πŸ’œ

🌈 DESCRIPTION 🌈

so the way this works: she scans the NVMe topology, then filters out the resulting elements by applying f. that's it. that's the whole vibe check. not me thinking it would be more complicated 😭


⭐ RETURN ⭐

  • 0 β€” success. slay, we ate πŸ“
  • -1 β€” failure, and errno is set because of course she left a note explaining herself πŸ™ˆ
lowkey important: if it fails, always check errno, bestie. the error message isn't gonna read itself ✨

and that's the whole page!! written up in the libnvme API manual, dated July 2026 β€” nvme_scan_topology serving nvme_scan_topology(2) realness from top to bottom πŸ’– ily, go scan something πŸ¦‹

πŸ“¦ where this page comes from