---
name: "sctp_peeloff"
section: "2"
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/sctp_peeloff"
---

# sctp\_peeloff(2)

detach an association from a one-to-many socket to its own fd

## NAME

**sctp\_peeloff** – detach an association from a one-to-many socket to its own fd

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/socket.h\>**

**#include \<netinet/sctp.h\>**

*int*\

**sctp\_peeloff**(*int s*, *sctp\_assoc\_t id*);

## DESCRIPTION

The **sctp\_peeloff**() system call attempts detach the association specified by *id* into its own separate socket.

## RETURN VALUES

The call returns -1 on failure and the new socket descriptor upon success.

## ERRORS

The **sctp\_peeloff**() system call can return the following errors:

- \[ENOTCONN\]

  The *id* given to the call does not map to a valid association.

- \[E2BIG\]

  The size of the address list exceeds the amount of data provided.

- \[EBADF\]

  The argument *s* is not a valid descriptor.

- \[ENOTSOCK\]

  The argument *s* is not a socket.

## SEE ALSO

[sctp(4)](/sctp/4.md)

## STANDARDS

The **sctp\_peeloff**() function conforms to RFC 6458.
