table of contents
rpma_conn_get_completion_fd(3) | RPMA Programmer's Manual | rpma_conn_get_completion_fd(3) |
NAME¶
rpma_conn_get_completion_fd - get the completion file descriptor (deprecated)
SYNOPSIS¶
#include <librpma.h>
struct rpma_conn;
int rpma_conn_get_completion_fd(const struct rpma_conn *conn, int *fd);
DESCRIPTION¶
rpma_conn_get_completion_fd() gets the completion file descriptor of the connection. It is the same file descriptor as the one returned by the rpma_cq_get_fd(3) for the connection's main CQ available via rpma_conn_get_cq(3).
RETURN VALUE¶
The rpma_conn_get_completion_fd() function returns 0 on success or a negative error code on failure. rpma_conn_get_completion_fd() does not set *fd value on failure.
ERRORS¶
rpma_conn_get_completion_fd() can fail with the following error:
- •
- RPMA_E_INVAL - conn or fd is NULL
DEPRECATED¶
Please use rpma_conn_get_cq(3) and rpma_cq_get_fd(3) instead. This is an example snippet of code using the old API:
The above snippet should be replaced with the following one using the new API:
int ret;
int fd;
ret = rpma_conn_get_completion_fd(conn, &fd);
if (ret) { error_handling_code() }
ret = rpma_conn_completion_wait(conn);
if (ret) { error_handling_code() }
struct rpma_completion cmpl;
ret = rpma_conn_completion_get(conn, &cmpl);
if (ret) { error_handling_code() }
rpma_cq *cq;
if (rpma_conn_get_cq(conn, &cq)) { error_handling_code() }
ret = rpma_cq_get_fd(cq, &fd);
if (ret) { error_handling_code() }
ret = rpma_cq_wait(cq);
if (ret) { error_handling_code() }
struct rpma_completion cmpl;
ret = rpma_cq_get_completion(cq, &cmpl);
if (ret) { error_handling_code() }
SEE ALSO¶
rpma_conn_completion_get(3), rpma_conn_completion_wait(3), rpma_conn_req_connect(3), librpma(7) and https://pmem.io/rpma/
26 January 2022 | RPMA |