Unregisters the program number and version number with the remote procedure call (RPC) service package.
Network Services Library (libnsl.a)
This subroutine is an expert-level API for transport-independent remote procedure calls (TI_PRC). This subroutine removes the mapping to network address from the RPC service package. The subroutine also unregisters the program number and version number from the dispatch subroutine with the RPC service package. When the subroutine is called, the whole service that is identified by the program and version gets unregistered.
Item | Description |
---|---|
prog | Specifies the program number. |
vers | Specifies the version number. |
#include <stdlib.h>
#include <rpc/rpc.h>
#include <netconfig.h>
#define PROG 0x3fffffffL
#define VERS 0x1L
main()
{
SVCXPRT *svc_handle; /* service handle */
struct netconfig *nconf;
/* Get transport type and create RPC service handle. */
/* Register dispatch routine for prog and vers with RPCBIND service */
If(svc_reg(svc_handle, PROG, VERS, sample_dispatch,nconf) == 0)
{
sprintf(stdout,"Error in svc_reg!");
exit(EXIT_FAILURE);
}
/* Unregister the service with given prog and vers */
svc_unreg(PROG, VERS);
return 0;
}