DOKK / manpages / debian 12 / libopeniscsiusr-dev / iscsi_session_get.3.en
iscsi_session_get(3) API Manual iscsi_session_get(3)

iscsi_session_get - Retrieve specified iSCSI sessions.

int iscsi_session_get (struct iscsi_context *ctx, uint32_t sid, struct iscsi_session **se);

Pointer of 'struct iscsi_context'. If this pointer is NULL, your program will be terminated by assert.
uint32_t, iSCSI session ID.
Output pointer of 'struct iscsi_session' pointer. Its memory should be freed by iscsi_session_free. If this pointer is NULL, your program will be terminated by assert. If specified iSCSI session does not exist, this pointer will be set to NULL with LIBISCSI_OK returned.

Retrieves specified iSCSI sessions. For the properties of

int. Valid error codes are:

* LIBISCSI_OK

* LIBISCSI_ERR_BUG

* LIBISCSI_ERR_NOMEM

* LIBISCSI_ERR_ACCESS

* LIBISCSI_ERR_SYSFS_LOOKUP

* LIBISCSI_ERR_SESS_NOT_FOUND

Error number could be converted to string by iscsi_strerror.

iscsi_session_get October 2022