RPC_SVC_ERR(3)

πŸ’– RPC_SVC_ERR β€” bestie edition πŸ’–

okay so this is RPC_SVC_ERR(3) from the Library Functions Manual, and it's literally the server-side error squad of the RPC library. if you're the one answering the calls instead of making them, this page is for you. 🫢


✨ NAME ✨

rpc_svc_err, svcerr_auth, svcerr_decode, svcerr_noproc, svcerr_noprog, svcerr_progvers, svcerr_systemerr, svcerr_weakauth β€” library routines for server side remote procedure call errors. that's the whole girl gang, all seven of them plus the group name πŸ’…


🌸 SYNOPSIS 🌸

#include <rpc/rpc.h>

void
svcerr_auth(SVCXPRT *xprt, enum auth_stat why);

void
svcerr_decode(SVCXPRT *xprt);

void
svcerr_noproc(SVCXPRT *xprt);

void
svcerr_noprog(SVCXPRT *xprt);

void
svcerr_progvers(SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers);

void
svcerr_systemerr(SVCXPRT *xprt);

void
svcerr_weakauth(SVCXPRT *xprt);

look at them. all void, all taking an SVCXPRT *xprt. consistent queens. no return values, no drama, they just say what's wrong and move on. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so these routines are part of the RPC library, which is the thing that lets C language programs make procedure calls on other machines across the network. yes, other machines. across the network. it's giving long distance relationship but make it syscalls. πŸ’ž

and these particular routines? they get called by the server side dispatch function whenever there's any kind of error in the transaction with the client. so like, the client asks for something, the server can't deliver, and instead of just ghosting πŸ‘» the server politely sends back a little "bestie no" message using one of these. iconic behaviour honestly.


πŸ‘‘ Routines πŸ‘‘

first things first: peep rpc(3) for the definition of the SVCXPRT data structure, because every single one of these takes one and you gotta know what you're holding. πŸ’–

  • svcerr_auth() β€” called by a service dispatch routine that is refusing to perform a remote procedure call because of an authentication error. like, you didn't pass the vibe check, sorry babe. πŸ”’
  • svcerr_decode() β€” called by a service dispatch routine that cannot successfully decode the remote arguments. see svc_getargs() over in rpc_svc_reg(3) for the whole situation there. the args came in and they were simply not readable 😭
  • svcerr_noproc() β€” called by a service dispatch routine that does not implement the procedure number the caller is asking for. you asked for procedure #47 and this server does not know her. πŸ’€
  • svcerr_noprog() β€” called when the desired program is not registered with the RPC package. heads up tho: service implementors usually do not need this routine. so like, it's here, it's slaying, but you probably won't be the one calling it. πŸ™ˆ
  • svcerr_progvers() β€” called when the desired version of a program is not registered with the RPC package. the low_vers argument is the lowest version number, and high_vers is the highest version number. so you're telling the client the full range of what actually exists. and same note as above: service implementors usually do not need this routine either. 🌈
  • svcerr_systemerr() β€” called by a service dispatch routine when it detects a system error that isn't covered by any particular protocol. the example they give: if a service can no longer allocate storage, it may call this routine. out of memory? out of options? this is the catch-all. 🫠
  • svcerr_weakauth() β€” called by a service dispatch routine that refuses to perform a remote procedure call due to insufficient (but correct) authentication arguments. and here's the tea: the routine calls svcerr_auth(xprt, AUTH_TOOWEAK). so it's a little wrapper, a little shortcut, a little "you're valid but not valid enough" πŸŽ€

πŸ’œ AVAILABILITY πŸ’œ

these functions are part of libtirpc. that's where they live, that's where you link them from. 🏠


⭐ SEE ALSO ⭐

go read them, they're all part of the same friend group. πŸ’–


okay bestie that's the whole page!! this one shipped from Debian and it's dated May 3, 1993 β€” yes, 1993, this manual page is older than most of the internet and it's still out here serving ✨ vintage icon behaviour, no cap. love that for her. mwah πŸ’‹

πŸ“¦ where this page comes from