.\" Automatically generated by Pandoc 1.16.0.2
.\"
.TH "ibv_import_device" "3" "2020\-5\-3" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
.hy
.SH NAME
.PP
ibv_import_device \- import a device from a given command FD
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <infiniband/verbs.h>

struct\ ibv_context\ *ibv_import_device(int\ cmd_fd);
\f[]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_import_device()\f[] returns an \f[I]ibv_context\f[] pointer
that is associated with the given \f[I]cmd_fd\f[].
.PP
The \f[I]cmd_fd\f[] is obtained from the ibv_context cmd_fd member,
which must be dup\[aq]d (eg by dup(), SCM_RIGHTS, etc) before being
passed to ibv_import_device().
.PP
Once the \f[I]ibv_context\f[] usage has been ended
\f[I]ibv_close_device()\f[] should be called.
This call may cleanup whatever is needed/opposite of the import
including closing the command FD.
.SH RETURN VALUE
.PP
\f[B]ibv_import_device()\f[] returns a pointer to the allocated RDMA
context, or NULL if the request fails.
.SH SEE ALSO
.PP
\f[B]ibv_open_device\f[](3), \f[B]ibv_close_device\f[](3),
.SH AUTHOR
.PP
Yishai Hadas <yishaih@mellanox.com>
