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 forsocketcall(), necessitating the use ofsyscall(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:
callโ Man pageSYS_SOCKETโsocket(2)SYS_BINDโbind(2)SYS_CONNECTโconnect(2)SYS_LISTENโlisten(2)SYS_ACCEPTโaccept(2)SYS_GETSOCKNAMEโgetsockname(2)SYS_GETPEERNAMEโgetpeername(2)SYS_SOCKETPAIRโsocketpair(2)SYS_SENDโsend(2)SYS_RECVโrecv(2)SYS_SENDTOโsendto(2)SYS_RECVFROMโrecvfrom(2)SYS_SHUTDOWNโshutdown(2)SYS_SETSOCKOPTโsetsockopt(2)SYS_GETSOCKOPTโgetsockopt(2)SYS_SENDMSGโsendmsg(2)SYS_RECVMSGโrecvmsg(2)SYS_ACCEPT4โaccept4(2)SYS_RECVMMSGโrecvmmsg(2)SYS_SENDMMSGโsendmmsg(2)
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
- Copyright 1995, Michael Chastain <mec@shell.portal.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms