|rpma_cq_get_fd(3)||RPMA Programmer's Manual||rpma_cq_get_fd(3)|
rpma_cq_get_fd - get the completion queue's file descriptor
int rpma_cq_get_fd(const struct rpma_cq *cq, int *fd);
rpma_cq_get_fd() gets the file descriptor of the completion queue (CQ in short). When a next completion in the CQ is ready to be consumed by rpma_cq_get_wc(3), the notification is delivered via the file descriptor. The default mode of the file descriptor is blocking but it can be changed to non-blocking mode using fcntl(2). The CQ is either the connection's main CQ or the receive CQ or CQ of shared RQ, please see rpma_conn_get_cq(3), rpma_conn_get_rcq(3) or rpma_srq_get_rcq() for details.
Note after spotting the notification using the provided file descriptor you do not have to call rpma_cq_wait(3) before consuming the completion but it may cause that the next call to rpma_cq_wait(3) will notify you of already consumed completion.
The rpma_cq_get_fd() function returns 0 on success or a negative error code on failure. rpma_cq_get_fd() does not set *fd value on failure.
rpma_cq_get_fd() can fail with the following error:
- RPMA_E_INVAL - cq or fd is NULL
|29 May 2023||RPMA|