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

# sysdecode\_sockopt\_name(3)

lookup name of socket option

## NAME

**sysdecode\_sockopt\_name** – lookup name of socket option

## LIBRARY

library “libsysdecode”

## SYNOPSIS

**#include \<sysdecode.h\>**

*const* *char* *\**\

**sysdecode\_sockopt\_name**(*int level*, *int optname*);

## DESCRIPTION

The **sysdecode\_sockopt\_name**() function returns a text description of the socket option name passed in the *optname* argument to [getsockopt(2)](/getsockopt/2.md). **sysdecode\_sockopt\_name**() takes the socket option *level* as well as the option name to uniquely identify the option.

## SEE ALSO

[sysdecode\_sockopt\_level(3)](/sysdecode_sockopt_level/3.md)

## BUGS

Socket option levels and names are protocol-specific. Both **sysdecode\_sockopt\_level**() and **sysdecode\_sockopt\_name**() should possibly accept the protocol family as an additional argument.
