__locked_re...a_with_flags(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __locked_read_sk_user_data_with_flags(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is __locked_re...a_with_flags(9) from the Kernel API Manual, and the way I need you to understand it is: this is the picky little reader function. It only hands you the pointer if the flags you asked about are all set in sk_user_data. Otherwise? It gives you NULL and walks away. no notes. πŸ™ˆ


✨ NAME ✨

__locked_read_sk_user_data_with_flags β€” return the pointer only if the argument flags are all set in sk_user_data. Otherwise return NULL. that's it, that's the whole vibe check 🫢


🌸 SYNOPSIS 🌸

void * __locked_read_sk_user_data_with_flags (const struct sock *sk ,
       uintptr_t flags );

like literally just two args, she's low maintenance πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sk β€” the socket. the main character, the whole point, the socket in question πŸ’–
  • flags β€” flag bits. these are the bits she's gonna check against sk_user_data, and all of them have to be set or you get nothing back ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so the one rule, and it's not optional: the caller must be holding sk->sk_callback_lock. that's it. that's the whole description. no cap, it's short because it means it 😭

fr fr though, this is not a suggestion β€” it's a requirement. hold sk->sk_callback_lock before you call this. don't be the person who skips it. πŸ’€

and remember how the NAME said it: you get the pointer back only if all of the argument flags are set in sk_user_data. otherwise it's NULL o'clock πŸ•


🧚 SEE ALSO 🧚

sibling functions and friends of the family, all iconic in their own right 🌈


and that's the page!! πŸ’– brought to you from ./include/net, dated October 2026, filed under __locked_re...a_with_flags(9) in the Kernel API Manual. mwah, go hold that lock πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from