svc_addsock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– svc_addsock (9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the svc_addsock(9) page β€” it's a kernel API manual situation, and we're literally about to add a listener socket to an RPC service together. grab a strawberry πŸ“ and let's go.


✨ NAME ✨

svc_addsock β€” add a listener socket to an RPC service. that's it, that's the whole vibe. you're plugging a new listener into a service and letting it cook. πŸŽ€


🌸 SYNOPSIS 🌸

int svc_addsock (struct svc_serv *serv , struct net *net , const int fd
, char *name_return , const size_t len , const struct cred *cred );

look at her. six arguments. main character energy fr fr πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • serv β€” pointer to the RPC service you're adding a new listener to. this is the service getting the glow-up πŸ’…
  • net β€” the caller's network namespace. your little network bubble 🌐
  • fd β€” file descriptor of the new listener. the actual socket bestie πŸ”₯
  • name_return β€” pointer to the buffer you fill in with the name of the listener. she gets named πŸ’–
  • len β€” size of that buffer. don't overflow, i'm begging πŸ™ˆ
  • cred β€” the credential. yes ma'am, credentials 🫢

⭐ DESCRIPTION ⭐

so what does she actually do? she fills in the socket name and returns the positive length of the name if it all worked out β€” slay ✨

the name is terminated with '0.

and if something goes wrong? on error, she returns a negative errno value β€” not me getting a sad little negative number back 😭 that's your vibe check failing, babes.

ngl, keep an eye on two things: the positive return is a length, and the error return is a negative errno. two completely different feelings. don't mix them up πŸ’€

🌈 SEE ALSO 🌈

kernel file ./net/sunrpc/svcsock.c and the whole friend group:

they're all iconic, go say hi 🧚


and that's the page!! this one lives in ./net/sunrpc and it's dated October 2026 β€” so mark your calendars bestie, and remember: positive length = we ate, negative errno = we did not eat πŸ“πŸ’œ bye ily!!

πŸ“¦ where this page comes from