---
name: "rpma_conn_get_cq"
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_conn_get_cq"
---

# rpma\_conn\_get\_cq(3)

get the connection's main CQ

## NAME

**rpma\_conn\_get\_cq** - get the connection's main CQ

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_conn;
      struct rpma_cq;
      int rpma_conn_get_cq(const struct rpma_conn *conn, struct rpma_cq **cq_ptr);
```

## DESCRIPTION

**rpma\_conn\_get\_cq**() gets the main CQ from the connection. When the receive CQ is not present the main CQ allows handling all completions within the connection. When the receive CQ is present the main CQ allows handling all completions except [**rpma\_recv**(3)](/rpma_recv/3.md) completions within the connection. Please see [**rpma\_conn\_get\_rcq**(3)](/rpma_conn_get_rcq/3.md) for details about the receive CQ.

## RETURN VALUE

The **rpma\_conn\_get\_cq**() function returns 0 on success or a negative error code on failure. **rpma\_conn\_get\_cq**() does not set \*cq\_ptr value on failure.

## ERRORS

**rpma\_conn\_get\_cq**() can fail with the following error:

- •

  RPMA\_E\_INVAL - conn or cq\_ptr is NULL

## SEE ALSO

[**rpma\_conn\_req\_connect**(3)](/rpma_conn_req_connect/3.md), [**rpma\_conn\_get\_rcq**(3)](/rpma_conn_get_rcq/3.md), [**rpma\_cq\_wait**(3)](/rpma_cq_wait/3.md), [**rpma\_cq\_get\_wc**(3)](/rpma_cq_get_wc/3.md), [**rpma\_cq\_get\_fd**(3)](/rpma_cq_get_fd/3.md), [**rpma\_recv**(3)](/rpma_recv/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
