---
name: "rpma_cq_wait"
section: "3"
platform: "linux"
package: "librpma-dev"
version: "1.3.0-2+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rpma_cq_wait"
---

# rpma\_cq\_wait(3)

wait for a completion and ack it

## NAME

**rpma\_cq\_wait** - wait for a completion and ack it

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_cq;
      int rpma_cq_wait(struct rpma_cq *cq);
```

## DESCRIPTION

**rpma\_cq\_wait**() waits for an incoming completion event and acks it. If **rpma\_cq\_wait**() succeeds, then all available completions should be collected using [**rpma\_cq\_get\_wc**(3)](/rpma_cq_get_wc/3.md) before the next **rpma\_cq\_wait**() call.

## RETURN VALUE

The **rpma\_cq\_wait**() function returns 0 on success or a negative error code on failure.

## ERRORS

**rpma\_cq\_wait**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - cq is NULL

- •

  RPMA\_E\_PROVIDER - [**ibv\_req\_notify\_cq**(3)](/ibv_req_notify_cq/3.md) failed with a provider error

- •

  RPMA\_E\_NO\_COMPLETION - no completions available

- •

  RPMA\_E\_SHARED\_CHANNEL - the completion event channel is shared and cannot be handled by any particular CQ

## SEE ALSO

[**rpma\_conn\_get\_cq**(3)](/rpma_conn_get_cq/3.md), [**rpma\_conn\_get\_rcq**(3)](/rpma_conn_get_rcq/3.md), [**rpma\_cq\_get\_wc**(3)](/rpma_cq_get_wc/3.md), [**rpma\_cq\_get\_fd**(3)](/rpma_cq_get_fd/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
