---
name: "rpma_srq_new"
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_srq_new"
---

# rpma\_srq\_new(3)

create a new shared RQ object

## NAME

**rpma\_srq\_new** - create a new shared RQ object

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_peer;
      struct rpma_srq_cfg;
      struct rpma_srq;
      int rpma_srq_new(struct rpma_peer *peer, const struct rpma_srq_cfg *cfg,
                      struct rpma_srq **srq_ptr);
```

## DESCRIPTION

**rpma\_srq\_new**() creates a new shared RQ object including a new shared RQ and a new shared receive CQ. It does not create the shared receive CQ if the size of the receive CQ in cfg equals 0.

## RETURN VALUE

The **rpma\_srq\_new**() function returns 0 on success or a negative error code on failure. **rpma\_srq\_new**() does not set \*srq\_ptr value on failure. If cfg is NULL, then the default values are used

- •

  see [**rpma\_srq\_cfg\_new**(3)](/rpma_srq_cfg_new/3.md) for more details.

## ERRORS

**rpma\_srq\_new**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - peer or srq\_ptr is NULL

- •

  RPMA\_E\_NOMEM - out of memory

- •

  RPMA\_E\_PROVIDER - [**ibv\_create\_srq**(3)](/ibv_create_srq/3.md), [**ibv\_create\_comp\_channel**(3)](/ibv_create_comp_channel/3.md), [**ibv\_create\_cq**(3)](/ibv_create_cq/3.md) or [**ibv\_req\_notify\_cq**(3)](/ibv_req_notify_cq/3.md) failed

## SEE ALSO

[**rpma\_srq\_delete**(3)](/rpma_srq_delete/3.md), [**rpma\_srq\_get\_rcq**(3)](/rpma_srq_get_rcq/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
