.TH "iscsi_sessions_get" 3 "iscsi_sessions_get" "October 2022" "API Manual" LINUX
.SH NAME
iscsi_sessions_get \- Retrieve all iSCSI sessions.
.SH SYNOPSIS
.B "int" iscsi_sessions_get
.BI "(struct iscsi_context *" ctx ","
.BI "struct iscsi_session ***" ses ","
.BI "uint32_t *" se_count ");"
.SH ARGUMENTS
.IP "ctx" 12
Pointer of 'struct iscsi_context'.
If this pointer is NULL, your program will be terminated by assert.
.IP "ses" 12
Output pointer of 'struct iscsi_session' pointer array. Its memory
should be freed by \fBiscsi_sessions_free\fP.
If this pointer is NULL, your program will be terminated by assert.
.IP "se_count" 12
Output pointer of uint32_t. Will store the size of
'struct iscsi_session' pointer array.
.SH "DESCRIPTION"

Retrieves all 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

Error number could be converted to string by \fBiscsi_strerror\fP.