---
name: "rdma_set_option"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/rdma_set_option"
---

# rdma\_set\_option(3)

Set communication options for an rdma\_cm\_id.

## NAME

rdma\_set\_option - Set communication options for an rdma\_cm\_id.

## SYNOPSIS

**#include \<rdma/rdma\_cma.h\>**

**int rdma\_set\_option** **(struct rdma\_cm\_id \****id***,** **int** *level***,** **int** *optname***,** **void \****optval***,** **size\_t** *optlen***);**

## ARGUMENTS

- id

  RDMA identifier.

- level

  Protocol level of the option to set.

- optname

  Name of the option, relative to the level, to set.

- optval

  Reference to the option data.  The data is dependent on the level and optname.

- optlen

  The size of the %optval buffer.

## DESCRIPTION

Sets communication options for an rdma\_cm\_id.  This call is used to override the default system settings.

## RETURN VALUE

Returns 0 on success, or -1 on error.  If an error occurs, errno will be set to indicate the failure reason.

## NOTES

Option details may be found in the relevant header files.

## SEE ALSO

[rdma\_create\_id(3)](/rdma_create_id/3.md)
