socketcall(2)

๐Ÿ’– socketcall(2) โ€” the group chat of socket syscalls ๐Ÿ’–

okay bestie, buckle up, because this is a System Calls Manual page and the star of the show is socketcall(2). no cap.


๐ŸŽ€ NAME ๐ŸŽ€

socketcall โ€” socket system calls

๐Ÿ“š LIBRARY ๐Ÿ“š

Standard C library (libc, -lc)

โœจ SYNOPSIS โœจ

#include <linux/net.h>        /* Definition of SYS_* constants */
#include <sys/syscall.h>      /* Definition of SYS_socketcall */
#include <unistd.h>

int syscall(SYS_socketcall, int call, unsigned long *args);
Note: glibc provides no wrapper for socketcall(), necessitating the use of syscall(2). ๐Ÿ’… like, glibc said "not my job" and honestly? fair.

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so socketcall() is literally the common kernel entry point for the socket system calls. it's giving main character energy for the whole sockets API. ๐ŸŒˆ

call tells it which socket function to invoke. args points to a block containing the actual arguments, which get passed through to the appropriate call. ๐Ÿซถ

User programs should call the appropriate functions by their usual names. Only standard library implementors and kernel hackers need to know about socketcall(). that's the vibe check โ€” if that's not you, keep scrolling, iykyk. ๐Ÿ™ˆ

here's the whole roster, the entire friend group, no one left out:

twenty entries, all accounted for, we ate that. ๐Ÿ“


๐Ÿงš VERSIONS ๐Ÿงš

on some architectures โ€” for example, x86-64 and ARM โ€” there is no socketcall() system call at all. ๐Ÿ˜ญ instead socket(2), accept(2), bind(2), and so on really are implemented as separate system calls. so they're not doing the group-chat thing, they're all individual main characters. ๐Ÿ’€


๐Ÿ‘‘ STANDARDS ๐Ÿ‘‘

Linux.

On x86-32, socketcall() was historically the only entry point for the sockets API. but starting in Linux 4.3, direct system calls are provided on x86-32 for the sockets API. โœจ

this facilitates the creation of seccomp(2) filters that filter sockets system calls (for new user-space binaries that are compiled to use the new entry points) and also provides a (very) small performance improvement. like, microscopic. a crumb of speed. but we respect it. ๐Ÿ’œ


๐ŸŒธ SEE ALSO ๐ŸŒธ

accept(2), bind(2), connect(2), getpeername(2), getsockname(2), getsockopt(2), listen(2), recv(2), recvfrom(2), recvmsg(2), send(2), sendmsg(2), sendto(2), setsockopt(2), shutdown(2), socket(2), socketpair(2)


okay that's the whole page, you understood it perfectly, slay. ๐ŸŽ€

this icon was brought to you by Linux man-pages 6.20, dated 2026-02-08 โ€” shoutout to the man-pages girlies keeping the docs โœจ immaculate โœจ. periodt. ๐Ÿ’…๐Ÿ”ฅ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms