inet_sk_state_store(9)
π inet_sk_state_store β like, the kernel API manual version, bestie
okay so picture this: you're deep in inet_sk_state_store(9) β yes that's the page, yes it's a kernel API manual, yes we're doing this π β and honestly? it's a tiny little function with main character energy. let's get into it.
β¨ NAME β¨
inet_sk_state_store β the one whose whole job is to update sk->sk_state. that's it. that's the gig. lowkey iconic for how focused it is π
πΈ SYNOPSIS πΈ
void inet_sk_state_store (struct sock *sk , int newstate );
look at that signature. so clean. so void. so not returning anything because it doesn't need to π«Ά
π¦ ARGUMENTS π¦
skβ the socket pointer, aka the little guy you're about to mess with πnewstateβ the new state, aka the glow-up you're giving it β¨
π DESCRIPTION π
okay so here's the tea π: inet_sk_state_store is paired with inet_sk_state_load. they're like a matching set, fr fr β you don't really do one without thinking about the other.
and the important part, ngl: you should be using this in contexts where a state change might impact lockless readers π. like, the state change is gonna be visible to readers who aren't taking locks, so use this function there instead of just poking the field yourself. respect the lockless readers, they're doing their best π
not me emphasizing this: the whole reason this function exists is lockless readers. don't sleep on that detail π
π SEE ALSO π
- Kernel file
./include/net/inet_sock.h sk_to_full_sk(9)inet_sk_state_load(9)β the other half of the pair, go say hi π
aaaand that's the whole page, bestie, we ate that π½οΈβ¨ this cutie of a page lives in the kernel source under ./include/net in the manual, and it's dated October 2026 β so like, future vibes ππ« catch you in the next man page, mwah π
π¦ 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