{
    "content": [
        {
            "type": "text",
            "text": "# rpc_svc_calls (man)\n\n## NAME\n\nsvcdgenablecache, svcexit, svcfdset, svcfreeargs, svcgetargs, svcgetreqcommon, svcgetreqpoll, svcgetreqset, svcgetrpccaller, svcpollset, svcrun, svcsendreply — library routines for RPC servers\n\n## DESCRIPTION\n\nThese routines are part of the RPC library which allows C language programs to make procedure\ncalls on other machines across the network.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **Routines**\n- **AVAILABILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "rpc_svc_calls",
        "section": "",
        "mode": "man",
        "summary": "svcdgenablecache, svcexit, svcfdset, svcfreeargs, svcgetargs, svcgetreqcommon, svcgetreqpoll, svcgetreqset, svcgetrpccaller, svcpollset, svcrun, svcsendreply — library routines for RPC servers",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "poll",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/poll/2/json"
            },
            {
                "name": "select",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/select/2/json"
            },
            {
                "name": "rpc",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpc/3/json"
            },
            {
                "name": "rpcsvccreate",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcsvccreate/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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "#include <rpc/rpc.h>",
                        "lines": 35
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "Routines",
                "lines": 79,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "svcdgenablecache, svcexit, svcfdset, svcfreeargs, svcgetargs, svcgetreqcommon,\nsvcgetreqpoll, svcgetreqset, svcgetrpccaller, svcpollset, svcrun, svcsendreply — library\nroutines for RPC servers\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "#include <rpc/rpc.h>",
                        "content": "int\nsvcdgenablecache(SVCXPRT *xprt, const unsigned cachesize);\n\nvoid\nsvcexit(void);\n\nboolt\nsvcfreeargs(const SVCXPRT *xprt, const xdrproct inproc, caddrt in);\n\nboolt\nsvcgetargs(const SVCXPRT *xprt, const xdrproct inproc, caddrt in);\n\nvoid\nsvcgetreqcommon(const int fd);\n\nvoid\nsvcgetreqpoll(struct pollfd *pfdp, const int pollretval);\n\nvoid\nsvcgetreqset(fdset * rdfds);\n\nstruct netbuf *\nsvcgetrpccaller(const SVCXPRT *xprt);\n\nstruct cmsgcred *\nsvcgetcallercreds(const SVCXPRT *xprt);\n\nstruct pollfd svcpollset[FDSETSIZE];\n\nvoid\nsvcrun(void);\n\nboolt\nsvcsendreply(SVCXPRT *xprt, xdrproct outproc, char *out);\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "These routines are part of the RPC library which allows C language programs to make procedure\ncalls on other machines across the network.\n\nThese routines are associated with the server side of the RPC mechanism.  Some of them are\ncalled by the server side dispatch function, while others (such as svcrun()) are called when\nthe server is initiated.\n",
                "subsections": []
            },
            "Routines": {
                "content": "See rpc(3) for the definition of the SVCXPRT data structure.\n\nsvcdgenablecache()    This function allocates a duplicate request cache for the service end‐\npoint xprt, large enough to hold cachesize entries.  Once enabled,\nthere is no way to disable caching.  This routine returns 0 if space\nnecessary for a cache of the given size was successfully allocated, and\n1 otherwise.\n\nsvcexit()              This function, when called by any of the RPC server procedure or other‐\nwise, causes svcrun() to return.\n\nAs currently implemented, svcexit() zeroes the svcfdset global vari‐\nable.  If RPC server activity is to be resumed, services must be rereg‐\nistered with the RPC library either through one of the\nrpcsvccreate(3) functions, or using xprtregister().  The svcexit()\nfunction has global scope and ends all RPC server activity.\n\nfdset svcfdset        A global variable reflecting the RPC server's read file descriptor bit\nmask; it is suitable as an argument to the select(2) system call.  This\nis only of interest if service implementors do not call svcrun(), but\nrather do their own asynchronous event processing.  This variable is\nread-only (do not pass its address to select(2)!), yet it may change\nafter calls to svcgetreqset() or any creation routines.\n\nsvcfreeargs()          A function macro that frees any data allocated by the RPC/XDR system\nwhen it decoded the arguments to a service procedure using\nsvcgetargs().  This routine returns TRUE if the results were success‐\nfully freed, and FALSE otherwise.\n\nsvcgetargs()           A function macro that decodes the arguments of an RPC request associ‐\nated with the RPC service transport handle xprt.  The in argument is\nthe address where the arguments will be placed; inproc is the XDR rou‐\ntine used to decode the arguments.  This routine returns TRUE if decod‐\ning succeeds, and FALSE otherwise.\n\nsvcgetreqcommon()     This routine is called to handle a request on the given file descrip‐\ntor.\n\nsvcgetreqpoll()       This routine is only of interest if a service implementor does not call\nsvcrun(), but instead implements custom asynchronous event processing.\nIt is called when poll(2) has determined that an RPC request has ar‐\nrived on some RPC file descriptors; pollretval is the return value from\npoll(2) and pfdp is the array of pollfd structures on which the poll(2)\nwas done.  It is assumed to be an array large enough to contain the\nmaximal number of descriptors allowed.\n\nsvcgetreqset()         This routine is only of interest if a service implementor does not call\nsvcrun(), but instead implements custom asynchronous event processing.\nIt is called when poll(2) has determined that an RPC request has ar‐\nrived on some RPC file descriptors; rdfds is the resultant read file\ndescriptor bit mask.  The routine returns when all file descriptors as‐\nsociated with the value of rdfds have been serviced.\n\nsvcgetrpccaller()      The approved way of getting the network address of the caller of a pro‐\ncedure associated with the RPC service transport handle xprt.\n\nsvcgetcallercreds()  Warning: this macro is specific to FreeBSD and thus not portable.  This\nmacro returns a pointer to a cmsgcred structure, defined in\n<sys/socket.h>, identifying the calling client.  This only works if the\nclient is calling the server over an AFLOCAL socket.\n\nstruct pollfd svcpollset[FDSETSIZE];\nsvcpollset is an array of pollfd structures derived from svcfdset[].\nIt is suitable as an argument to the poll(2) system call.  The deriva‐\ntion of svcpollset from svcfdset is made in the current implementa‐\ntion in svcrun().  Service implementors who do not call svcrun() and\nwho wish to use this array must perform this derivation themselves.\n\nsvcrun()               This routine never returns.  It waits for RPC requests to arrive, and\ncalls the appropriate service procedure using svcgetreqpoll() when\none arrives.  This procedure is usually waiting for the poll(2) system\ncall to return.\n\nsvcsendreply()         Called by an RPC service's dispatch routine to send the results of a\nremote procedure call.  The xprt argument is the request's associated\ntransport handle; outproc is the XDR routine which is used to encode\nthe results; and out is the address of the results.  This routine re‐\nturns TRUE if it succeeds, FALSE otherwise.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "These functions are part of libtirpc.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "poll(2), select(2), rpc(3), rpcsvccreate(3), rpcsvcerr(3), rpcsvcreg(3)\n\nBSD                               May 3, 1993                              BSD",
                "subsections": []
            }
        }
    }
}