.\" Automatically generated by Pandoc 1.19.2.4
.\"
.TH "IBV_GET_DEVICE_LIST" "3" "2006\-10\-31" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
.hy
.SH NAME
.PP
ibv_get_device_list, ibv_free_device_list \- get and release list of
available RDMA devices
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <infiniband/verbs.h>
struct\ ibv_device\ **ibv_get_device_list(int\ *num_devices);
void\ ibv_free_device_list(struct\ ibv_device\ **list);
\f[]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_get_device_list()\f[] returns a NULL\-terminated array of RDMA
devices currently available.
The argument \f[I]num_devices\f[] is optional; if not NULL, it is set to
the number of devices returned in the array.
.PP
\f[B]ibv_free_device_list()\f[] frees the array of devices \f[I]list\f[]
returned by \f[B]ibv_get_device_list()\f[].
.SH RETURN VALUE
.PP
\f[B]ibv_get_device_list()\f[] returns the array of available RDMA
devices, or sets \f[I]errno\f[] and returns NULL if the request fails.
If no devices are found then \f[I]num_devices\f[] is set to 0, and
non\-NULL is returned.
.PP
\f[B]ibv_free_device_list()\f[] returns no value.
.SH ERRORS
.TP
.B \f[B]EPERM\f[]
Permission denied.
.RS
.RE
.TP
.B \f[B]ENOSYS\f[]
No kernel support for RDMA.
.RS
.RE
.TP
.B \f[B]ENOMEM\f[]
Insufficient memory to complete the operation.
.RS
.RE
.SH NOTES
.PP
Client code should open all the devices it intends to use with
\f[B]ibv_open_device()\f[] before calling
\f[B]ibv_free_device_list()\f[].
Once it frees the array with \f[B]ibv_free_device_list()\f[], it will be
able to use only the open devices; pointers to unopened devices will no
longer be valid.
.PP
Setting the environment variable \f[B]IBV_SHOW_WARNINGS\f[] will cause
warnings to be emitted to stderr if a kernel verbs device is discovered,
but no corresponding userspace driver can be found for it.
.SH STATIC LINKING
.PP
If \f[B]libibverbs\f[] is statically linked to the application then all
provider drivers must also be statically linked.
The library will not load dynamic providers when static linking is used.
.PP
To link the providers set the \f[B]RDMA_STATIC_PROVIDERS\f[] define to
the comma separated list of desired providers when compiling the
application.
The special keyword \[aq]all\[aq] will statically link all supported
\f[B]libibverbs\f[] providers.
.PP
This is intended to be used along with \f[B]pkg\-config(1)\f[] to setup
the proper flags for \f[B]libibverbs\f[] linking.
.PP
If this is not done then \f[B]ibv_get_device_list\f[] will always return
an empty list.
.PP
Using only dynamic linking for \f[B]libibverbs\f[] applications is
strongly recommended.
.SH SEE ALSO
.PP
\f[B]ibv_fork_init\f[](3), \f[B]ibv_get_device_guid\f[](3),
\f[B]ibv_get_device_name\f[](3), \f[B]ibv_open_device\f[](3)
.SH AUTHOR
.PP
Dotan Barak <dotanba@gmail.com>