inet_sk_state_load(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… inet_sk_state_load(9)

okay so bestie, welcome to the Kernel API Manual, section 9 β€” yes this is a manpage for a kernel function and we're gonna make it make sense 🫢


✨ NAME ✨

inet_sk_state_load β€” read sk->sk_state for lockless contexts πŸ”“πŸ’«

like, you wanna peek at a socket's state without holding the lock? this is the girl for the job, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

int inet_sk_state_load (const struct sock *sk );

that's it. that's the whole signature. iconic, honestly πŸ’…


🌸 ARGUMENTS 🌸

  • sk β€” socket pointer. that's your socket bestie, the one you're trying to get the state out of πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: inet_sk_state_load is paired with inet_sk_state_store β€” they're a matched set, yin and yang, the two halves of a friendship bracelet 🫢✨

This one is used in places where we don't hold the socket lock β€” lowkey the whole reason it exists, fr fr. the spots it shows up in are:

  • tcp_diag_get_info
  • tcp_get_info
  • tcp_poll
  • get_tcp4_sock
  • ... and more (the original is literally trailing off with ... so we're respecting that πŸ™ˆ)

so like, when you can't grab the lock but you still need the state? that's the assignment, and she ate πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ“šπŸ’œ


and that's the whole page, bestie 🌈 this little icon came from the kernel file path ./include/net, dated October 2026, and it's filed under inet_sk_state_load(9) β€” mwah, go touch some sockets πŸ’‹πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from