rpcb_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rpcb_register β€” the kernel API manual, bestie edition ✨

okay so we're in the <pink>Kernel API Manual</pink> today and the star of the show is rpcb_register(9) β€” yes, the (9) means it's a kernel function, we love a section-nine king πŸ‘‘


🌸 NAME 🌸

rpcb_register β€” sets or unsets a port registration with the local rpcbind svc πŸŽ€

like, it's the "hey rpcbind, remember me?" function, and also the "hey rpcbind, forget me" function. dual threat. main character energy fr fr.


✨ SYNOPSIS ✨

int rpcb_register (struct net *net , u32 prog , u32 vers , int prot ,
unsigned short port );

that's the whole signature, copy it exactly bestie, don't get creative with it πŸ™ˆ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • net β€” the target network namespace. which little world are we registering in, y'know? 🌍
  • prog β€” the RPC program number to bind. the big ID. πŸ‘‘
  • vers β€” the RPC version number to bind. the sequel number, lowkey. πŸ’«
  • prot β€” the transport protocol to register. which vibe of transport we're on. πŸš—
  • port β€” the port value to register. literally the port. and plot twist: if you pass zero, it unregisters β€” more on that below πŸ‘€

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” this function returns zero if the registration request was dispatched successfully and the rpcbind daemon returned success. that's the slay scenario πŸ’…βœ¨

otherwise? it returns an errno value that reflects the nature of the error. and the errors are giving: the request could not be dispatched, it timed out, or rpcbind returned an error. pick your poison bestie πŸ˜­πŸ’€

RPC services invoke this function to advertise their contact information via the system's rpcbind daemon. it's literally them posting their @ everywhere so people can reach them 🫢

and here's the detail nobody skips in this house: RPC services invoke this function once for each [program, version, transport] tuple they wish to advertise. one call per tuple. no bundling. that's the rule πŸ“‹

okay now the iconic part. callers may also unregister RPC services that are no longer available by setting the passed-in port to zero. yes, zero. zap. ⚑ and what that does is remove all registered transports for [program, version] from the local rpcbind database. all of them. the whole group chat. gone πŸ™ˆ

also important: this function uses rpcbind protocol version 2 to contact the local rpcbind daemon. version 2. not 3, not 4 β€” that's a whole other function, see SEE ALSO πŸ‘‡

Registration works over both AF_INET and AF_INET6, and services registered via this function are advertised as available for any address. universal availability, we stan 🌈

and if the local rpcbind daemon is listening on AF_INET6, services registered via this function will be advertised on IN6ADDR_ANY (ie available for all AF_INET and AF_INET6 addresses). so it's not just v6 β€” it's everything. the reach is unmatched πŸ”₯


🧚 SEE ALSO 🧚


aaaand that's the page! πŸ’œ source is in ./net/sunrpc, dated October 2026 β€” so it's fresh, it's current, it ate and left no crumbs. go register something, bestie πŸ“βœ¨

πŸ“¦ where this page comes from