.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "ibv_import_device" "3" "2020\-5\-3" "libibverbs" "Libibverbs Programmer\[cq]s Manual"
.SH NAME
ibv_import_device \- import a device from a given command FD
.SH SYNOPSIS
.IP
.EX
#include <infiniband/verbs.h>

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