rpc_uaddr2sockaddr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rpc_uaddr2sockaddr β€” Kernel API Manual ✨

okay bestie, gather round, because this one is lowkey iconic and also kind of niche, and honestly that's the whole vibe. we're in the Kernel API Manual, section 9, and the star of the show is rpc_uaddr2sockaddr β€” she converts a universal address into a socket address. that's it, that's the job, and she does it slayfully. πŸŽ€


🌸 NAME 🌸

rpc_uaddr2sockaddr β€” convert a universal address to a socket address. no cap, that's literally the whole thing. πŸ¦‹


✨ SYNOPSIS ✨

size_t rpc_uaddr2sockaddr (struct net *net , const char *uaddr , const
size_t uaddr_len , struct sockaddr *sap , const size_t salen );

like, copy it exactly, don't come for me about the spacing, that's how she's written. periodt. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • net β€” the applicable network namespace. yes, which network world we're living in. main character energy for the whole call, fr fr. 🌈
  • uaddr β€” a C string containing the universal address to convert. that's the glow-up raw material. ✨
  • uaddr_len β€” the length of that universal address string. know your length, bestie, it matters. πŸ“
  • sap β€” the buffer into which to plant the socket address. she goes in there. 🌱
  • salen β€” the size of that buffer. gotta make sure there's room, we are NOT doing overflow situations, not on my watch. πŸ’€

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea:

uaddr does not have to be ' '-terminated β€” but <pink>heads up</pink>, kstrtou8 and rpc_pton require proper string termination to be successful. so like, sure, the parameter itself doesn't demand it, but the functions doing the actual work absolutely do. the vibe check is real. 🫢

the function returns the size of the socket address if successful; otherwise, zero is returned. zero. the classic "nope, didn't work" zero. 😭


πŸ¦‹ SEE ALSO πŸ¦‹

go read those, they're the friend group, and they all ate. πŸ‘‘


πŸ’œ reminder bestie: the uaddr string termination thing is not a suggestion, it's a requirement of the helpers. do with that what you will.

that's the whole page, and honestly? she's giving "small function, big responsibilities." shipped from ./net/sunrpc, dated October 2026, and yes i'm obsessed with her. bye bestie, go convert some addresses πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from