.TH "iscsi_session_get" 3 "iscsi_session_get" "June 2023" "API Manual" LINUX .SH NAME iscsi_session_get \- Retrieve specified iSCSI sessions. .SH SYNOPSIS .B "int" iscsi_session_get .BI "(struct iscsi_context *" ctx "," .BI "uint32_t " sid "," .BI "struct iscsi_session **" se ");" .SH ARGUMENTS .IP "ctx" 12 Pointer of 'struct iscsi_context'. If this pointer is NULL, your program will be terminated by assert. .IP "sid" 12 uint32_t, iSCSI session ID. .IP "se" 12 Output pointer of 'struct iscsi_session' pointer. Its memory should be freed by \fBiscsi_session_free\fP. 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. .SH "DESCRIPTION" Retrieves specified iSCSI sessions. For the properties of 'struct iscsi_session', please refer to the functions defined in 'libopeniscsiusr_session.h' file. .SH "RETURN" 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 \fBiscsi_strerror\fP.