SCTP_GENERIC_SENDMSG(2)

✨ SCTP_GENERIC_SENDMSG ✨

okay bestie, buckle up, this is the manual page for sctp_generic_sendmsg and sctp_generic_sendmsg_iov β€” and their whole entire job is sending data to a peer. that's it. that's the vibe. πŸ’Œ


πŸ“š LIBRARY

Standard C Library (libc, -lc) β€” yes she's fancy, yes she's built in πŸŽ€


🫢 SYNOPSIS

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

int
sctp_generic_sendmsg(int s, void *msg, int msglen, struct sockaddr *to,
    socklen_t len, struct sctp_sndrcvinfo *sinfo, int flags);

int
sctp_generic_sendmsg_iov(int s, struct iovec *iov, int iovlen,
    struct sockaddr *to, struct sctp_sndrcvinfo *sinfo, int flags);

like. look at those signatures. gorgeous. immaculate. 🌸


πŸ’… DESCRIPTION

okay so here's the tea β˜• β€” sctp_generic_sendmsg() and sctp_generic_sendmsg_iov() are the true system calls that live underneath the sctp_sendmsg(3) and sctp_send(3) function calls. the way that they're more efficient because they're true system calls?? iconic. they really said "we're not doing the wrapper thing, we're going straight to the kernel" and honestly? respect. πŸ‘‘

but β€” and this is the part where I need you to focus β€” they are specific to FreeBSD. like, only FreeBSD. they can be expected not to be present on any other operating system. so if you're out here on Linux expecting to find these, bestie, no. she's not there. 😭

for detailed usage, please go see either the sctp_send(3) or sctp_sendmsg(3) function calls. they've got the full rundown, this page is just the ✨ lore ✨.


πŸ¦‹ RETURN VALUES

  • success β†’ the call returns the number of bytes written πŸ’–
  • failure β†’ the call returns -1 πŸ’€

that's it, that's the whole story.


🚨 ERRORS

here's where things can go wrong, and I need you to know them all, no skipping:

  • [EBADF] β€” the argument s is not a valid descriptor. like, that's not a socket, bestie, that's a random number. πŸ™ˆ
  • [ENOTSOCK] β€” the argument s is not a socket. fr fr. whatever you handed over is not a socket and she's not gonna pretend otherwise. βœ‹
if you see either of these, vibe check your file descriptor first. that's usually where the problem is. 😌

πŸ‘€ SEE ALSO

go read these too, they're all part of the same little friend group:


and that's the page!! sending love, sending bytes, sending SCTP packets to your peer 🫢✨

this one came to you from Debian, dated October 30, 2007 β€” yeah she's an elder but she's still serving πŸ’œ

πŸ“¦ where this page comes from