{
    "mode": "man",
    "parameter": "rpc_svc_create",
    "section": "3t",
    "url": "https://www.chedong.com/phpMan.php/man/rpc_svc_create/3t/json",
    "generated": "2026-06-14T07:28:17Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "rpcsvccreate, svccontrol, svccreate, svcdestroy, svcdgcreate, svcfdcreate,\nsvcrawcreate, svctlicreate, svctpcreate, svcvccreate — library routines for the cre‐\nation of server handles\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <rpc/rpc.h>",
                    "content": "boolt\nsvccontrol(SVCXPRT *svc, const uint req, void *info);\n\nint\nsvccreate(void (*dispatch)(struct svcreq *, SVCXPRT *), const rpcprogt prognum,\nconst rpcverst versnum, const char *nettype);\n\nSVCXPRT *\nsvcdgcreate(const int fildes, const uint sendsz, const uint recvsz);\n\nvoid\nsvcdestroy(SVCXPRT *xprt);\n\nSVCXPRT *\nsvcfdcreate(const int fildes, const uint sendsz, const uint recvsz);\n\nSVCXPRT *\nsvcrawcreate(void);\n\nSVCXPRT *\nsvctlicreate(const int fildes, const struct netconfig *netconf,\nconst struct tbind *bindaddr, const uint sendsz, const uint recvsz);\n\nSVCXPRT *\nsvctpcreate(void (*dispatch)(struct svcreq *, SVCXPRT *), const rpcprogt prognum,\nconst rpcverst versnum, const struct netconfig *netconf);\n\nSVCXPRT *\nsvcvccreate(const int fildes, const uint sendsz, const uint recvsz);\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "These routines are part of the RPC library which allows C language programs to make procedure\ncalls on servers across the network.  These routines deal with the creation of service handles.\nOnce the handle is created, the server can be invoked by calling svcrun().\n",
            "subsections": []
        },
        "Routines": {
            "content": "See rpc(3) for the definition of the SVCXPRT data structure.\n\nsvccontrol()\nA function to change or retrieve various information about a service object.  The req\nargument indicates the type of operation and info is a pointer to the information.  The\nsupported values of req, their argument types, and what they do are:\n\nSVCGETVERSQUIET\nIf a request is received for a program number served by this server but the\nversion number is outside the range registered with the server, an\nRPCPROGVERSMISMATCH error will normally be returned.  The info argument\nshould be a pointer to an integer.  Upon successful completion of the\nSVCGETVERSQUIET request, *info contains an integer which describes the\nserver's current behavior: 0 indicates normal server behavior (that is, an\nRPCPROGVERSMISMATCH error will be returned); 1 indicates that the out of\nrange request will be silently ignored.\n\nSVCSETVERSQUIET\nIf a request is received for a program number served by this server but the\nversion number is outside the range registered with the server, an\nRPCPROGVERSMISMATCH error will normally be returned.  It is sometimes de‐\nsirable to change this behavior.  The info argument should be a pointer to\nan integer which is either 0 (indicating normal server behavior - an\nRPCPROGVERSMISMATCH error will be returned), or 1 (indicating that the out\nof range request should be silently ignored).\n\nsvccreate()\nThe svccreate() function creates server handles for all the transports belonging to the\nclass nettype.  The nettype argument defines a class of transports which can be used for\na particular application.  The transports are tried in left to right order in NETPATH\nvariable or in top to bottom order in the netconfig database.  If nettype is NULL, it\ndefaults to \"netpath\".\n\nThe svccreate() function registers itself with the rpcbind service (see rpcbind(8)).\nThe dispatch function is called when there is a remote procedure call for the given\nprognum and versnum; this requires calling svcrun() (see svcrun() in rpcsvcreg(3)).\nIf svccreate() succeeds, it returns the number of server handles it created, otherwise\nit returns 0 and an error message is logged.\n\nsvcdestroy()\nA function macro that destroys the RPC service handle xprt.  Destruction usually in‐\nvolves deallocation of private data structures, including xprt itself.  Use of xprt is\nundefined after calling this routine.\n\nsvcdgcreate()\nThis routine creates a connectionless RPC service handle, and returns a pointer to it.\nThis routine returns NULL if it fails, and an error message is logged.  The sendsz and\nrecvsz arguments are arguments used to specify the size of the buffers.  If they are 0,\nsuitable defaults are chosen.  The file descriptor fildes should be open and bound.  The\nserver is not registered with rpcbind(8).\n\nWarning: since connectionless-based RPC messages can only hold limited amount of encoded\ndata, this transport cannot be used for procedures that take large arguments or return\nhuge results.\n\nsvcfdcreate()\nThis routine creates a service on top of an open and bound file descriptor, and returns\nthe handle to it.  Typically, this descriptor is a connected file descriptor for a con‐\nnection-oriented transport.  The sendsz and recvsz arguments indicate sizes for the send\nand receive buffers.  If they are 0, reasonable defaults are chosen.  This routine re‐\nturns NULL if it fails, and an error message is logged.\n\nsvcrawcreate()\nThis routine creates an RPC service handle and returns a pointer to it.  The transport\nis really a buffer within the process's address space, so the corresponding RPC client\nshould live in the same address space; (see clntrawcreate() in rpcclntcreate(3)).\nThis routine allows simulation of RPC and acquisition of RPC overheads (such as round\ntrip times), without any kernel and networking interference.  This routine returns NULL\nif it fails, and an error message is logged.\n\nNote: svcrun() should not be called when the raw interface is being used.\n\nsvctlicreate()\nThis routine creates an RPC server handle, and returns a pointer to it.  The fildes ar‐\ngument is the file descriptor on which the service is listening.  If fildes is\nRPCANYFD, it opens a file descriptor on the transport specified by netconf.  If the\nfile descriptor is unbound and bindaddr is not NULL, fildes is bound to the address\nspecified by bindaddr, otherwise fildes is bound to a default address chosen by the\ntransport.\n\nNote: the tbind structure comes from the TLI/XTI SysV interface, which NetBSD does not\nuse.  The structure is defined in <rpc/types.h> for compatibility as:\n\nstruct tbind {\nstruct netbuf addr; /* network address, see rpc(3) */\nunsigned int  qlen; /* queue length (for listen(2)) */\n};\n\nIn the case where the default address is chosen, the number of outstanding connect re‐\nquests is set to 8 for connection-oriented transports.  The user may specify the size of\nthe send and receive buffers with the arguments sendsz and recvsz; values of 0 choose\nsuitable defaults.  This routine returns NULL if it fails, and an error message is\nlogged.  The server is not registered with the rpcbind(8) service.\n\nsvctpcreate()\nThe svctpcreate() function creates a server handle for the network specified by\nnetconf, and registers itself with the rpcbind service.  The dispatch function is called\nwhen there is a remote procedure call for the given prognum and versnum; this requires\ncalling svcrun().  The svctpcreate() function returns the service handle if it suc‐\nceeds, otherwise a NULL is returned and an error message is logged.\n\nsvcvccreate()\nThis routine creates a connection-oriented RPC service and returns a pointer to it.\nThis routine returns NULL if it fails, and an error message is logged.  The users may\nspecify the size of the send and receive buffers with the arguments sendsz and recvsz;\nvalues of 0 choose suitable defaults.  The file descriptor fildes should be open and\nbound.  The server is not registered with the rpcbind(8) service.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "These functions are part of libtirpc.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "rpc(3), rpcsvccalls(3), rpcsvcerr(3), rpcsvcreg(3), rpcbind(8)\n\nBSD                               May 3, 1993                              BSD",
            "subsections": []
        }
    },
    "summary": "rpcsvccreate, svccontrol, svccreate, svcdestroy, svcdgcreate, svcfdcreate, svcrawcreate, svctlicreate, svctpcreate, svcvccreate — library routines for the cre‐ ation of server handles",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "rpc",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/rpc/3/json"
        },
        {
            "name": "rpcsvccalls",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/rpcsvccalls/3/json"
        },
        {
            "name": "rpcsvcerr",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/rpcsvcerr/3/json"
        },
        {
            "name": "rpcsvcreg",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/rpcsvcreg/3/json"
        },
        {
            "name": "rpcbind",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rpcbind/8/json"
        }
    ]
}