STRUCT SOCKET(9)
π NAME π
okay so bestie, welcome to the struct socket(9) page in the Kernel API Manual β this is literally all about the general BSD socket πβ¨. Weβre gonna go through every single field, no skipping, no cap π
.
β¨ SYNOPSIS β¨
hereβs the whole struct, copied exactly, do not touch the formatting bestie π«Ά:
struct socket {
socket_state state;
short type;
unsigned long flags;
struct file *file;
struct sock *sk;
const struct proto_ops *ops;
struct socket_wq wq;
};
π«Ά Members π«Ά
okay now the members, one by one, because every field is iconic in its own way π :
stateβ socket state (SS_CONNECTED, etc) πtypeβ socket type (SOCK_STREAM, etc) πflagsβ socket flags (SOCK_NOSPACE, etc) β¨fileβ File back pointer for gc π§skβ internal networking protocol agnostic socket representation π¦opsβ protocol specific socket operations π₯wqβ wait queue for several uses πΈ
π SEE ALSO π
if you wanna keep reading, these are the references, fr fr:
- Kernel file
./include/linux/net.h struct sockopt(9)enum sock_type(9)enum sock_shutdown_cmd(9)
okay thatβs the whole page! this cutie comes from ./include/linux, dated October 2026, and itβs the struct socket(9) manual page β bye bestie, slay your kernel adventures ππ¦β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms