SCTP_PEELOFF(2)

πŸ’– SCTP_PEELOFF(2) πŸ’–

okay so bestie, welcome to the System Calls Manual β€” this one lives in section 2, so it's a real-deal syscall, not some lil shell command. it's literally called sctp_peeloff and i'm obsessed πŸ¦‹


✨ NAME ✨

sctp_peeloff β€” detach an association from a one-to-many socket so it gets its own fd πŸ’…


πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc)

like yes, it's just chillin' in libc, nothing extra to link, you're welcome 🫢


🌸 SYNOPSIS 🌸

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>

int
sctp_peeloff(int s, sctp_assoc_t id);

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the tea β˜• β€” the sctp_peeloff() system call attempts to detach the association specified by id into its own separate socket. that's it, that's the whole vibe. one-to-many socket in, independent socket out, main character energy for everybody 🌈


πŸŽ€ RETURN VALUES πŸŽ€

  • failure β†’ the call returns -1 😭
  • success β†’ it returns the new socket descriptor ✨

periodt. no in-between.


πŸ’€ ERRORS πŸ’€

the sctp_peeloff() system call can return the following errors, and ngl some of these are giving "check ur args bestie":

  • [ENOTCONN] β€” the id you handed 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 😭 like bestie that's just not a socket

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, mwah πŸ’‹ this little gem comes to you from Debian, dated October 30, 2007 β€” yeah she's an elder but she still slays, okurrr πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from