libnvme_open(9) libnvme API manual libnvme_open(9)

libnvme_open - Open an nvme controller or namespace device

int libnvme_open (struct libnvme_global_ctx *ctx , const char *name , int flags , struct libnvme_transport_handle **hdl );

struct libnvme_global_ctx object
The basename of the device to open
Flags to pass to the underlying open(2) call, e.g. O_RDONLY or O_RDONLY | O_EXCL
Transport handle to return

This will look for the handle in /dev/ and validate the name and filetype match linux conventions.

0 on success, negative error code otherwise.

libnvme_open September 2026