svc_addsock(9)
π 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:
svc_tcp_release_ctxt(9)svc_udp_release_ctxt(9)svc_tcp_handshake_done(9)svc_tcp_handshake(9)svc_udp_recvfrom(9)svc_udp_sendto(9)svc_tcp_recvfrom(9)svc_tcp_sendto(9)
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
- 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