xref: /netbsd-src/lib/libc/rpc/rpc_clnt_create.3 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
17df0ccbaSfvdl.\" @(#)rpc_clnt_create.3n 1.36 93/08/31 SMI; from SVr4
27df0ccbaSfvdl.\" Copyright 1989 AT&T
37df0ccbaSfvdl.\" @(#)rpc_clnt_create 1.5 89/07/24 SMI;
47df0ccbaSfvdl.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5*01869ca4Swiz.\"	$NetBSD: rpc_clnt_create.3,v 1.13 2017/07/03 21:32:49 wiz Exp $
679665781Schristos.Dd May 23, 2009
77df0ccbaSfvdl.Dt RPC_CLNT_CREATE 3
87df0ccbaSfvdl.Os
97df0ccbaSfvdl.Sh NAME
107df0ccbaSfvdl.Nm rpc_clnt_create ,
117df0ccbaSfvdl.Nm clnt_control ,
127df0ccbaSfvdl.Nm clnt_create ,
137df0ccbaSfvdl.Nm clnt_create_vers ,
147df0ccbaSfvdl.Nm clnt_destroy ,
157df0ccbaSfvdl.Nm clnt_dg_create ,
167df0ccbaSfvdl.Nm clnt_pcreateerror ,
177df0ccbaSfvdl.Nm clnt_raw_create ,
187df0ccbaSfvdl.Nm clnt_spcreateerror ,
197df0ccbaSfvdl.Nm clnt_tli_create ,
207df0ccbaSfvdl.Nm clnt_tp_create ,
217df0ccbaSfvdl.Nm clnt_vc_create ,
227df0ccbaSfvdl.Nm rpc_createerr
237df0ccbaSfvdl.Nd "library routines for dealing with creation and manipulation of CLIENT handles"
247df0ccbaSfvdl.Sh LIBRARY
257df0ccbaSfvdl.Lb libc
267df0ccbaSfvdl.Sh SYNOPSIS
27472351e1Swiz.In rpc/rpc.h
287df0ccbaSfvdl.Ft bool_t
297df0ccbaSfvdl.Fn clnt_control "CLIENT *clnt" "const u_int req" "char *info"
307df0ccbaSfvdl.Ft "CLIENT *"
317df0ccbaSfvdl.Fn clnt_create "const char * host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const char *nettype"
327df0ccbaSfvdl.Ft "CLIENT *"
337df0ccbaSfvdl.Fn clnt_create_vers "const char * host" "const rpcprog_t prognum" "rpcvers_t *vers_outp" "const rpcvers_t vers_low" "const rpcvers_t vers_high" "char *nettype"
347df0ccbaSfvdl.Ft void
3579665781Schristos.Fn clnt_destroy "CLIENT * clnt"
367df0ccbaSfvdl.Ft "CLIENT *"
377df0ccbaSfvdl.Fn clnt_dg_create "const int fildes" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
387df0ccbaSfvdl.Ft void
397df0ccbaSfvdl.Fn clnt_pcreateerror "const char *s"
407df0ccbaSfvdl.Ft "char *"
417df0ccbaSfvdl.Fn clnt_spcreateerror "const char *s"
427df0ccbaSfvdl.Ft "CLIENT *"
437df0ccbaSfvdl.Fn clnt_raw_create "const rpcprog_t prognum" "const rpcvers_t versnum"
447df0ccbaSfvdl.Ft "CLIENT *"
457df0ccbaSfvdl.Fn clnt_tli_create "const int fildes" "const struct netconfig *netconf" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
467df0ccbaSfvdl.Ft "CLIENT *"
477df0ccbaSfvdl.Fn clnt_tp_create "const char * host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
487df0ccbaSfvdl.Ft "CLIENT *"
497df0ccbaSfvdl.Fn clnt_vc_create "const int fildes" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
507df0ccbaSfvdl.Sh DESCRIPTION
517df0ccbaSfvdlRPC library routines allow C language programs to make procedure
527df0ccbaSfvdlcalls on other machines across the network.
537df0ccbaSfvdlFirst a
547df0ccbaSfvdl.Dv CLIENT
557df0ccbaSfvdlhandle is created and then the client calls a procedure to send a
567df0ccbaSfvdlrequest to the server.
577df0ccbaSfvdlOn receipt of the request, the server calls a dispatch routine
587df0ccbaSfvdlto perform the requested service, and then sends a reply.
59723dbf64Swiz.Sh ROUTINES
607df0ccbaSfvdl.Bl -tag -width YYYYYYY
617df0ccbaSfvdl.It Fn clnt_control
627df0ccbaSfvdlA function macro to change or retrieve various information
637df0ccbaSfvdlabout a client object.
647df0ccbaSfvdl.Fa req
657df0ccbaSfvdlindicates the type of operation, and
667df0ccbaSfvdl.Fa info
677df0ccbaSfvdlis a pointer to the information.
687df0ccbaSfvdlFor both connectionless and connection-oriented transports,
697df0ccbaSfvdlthe supported values of
707df0ccbaSfvdl.Fa req
717df0ccbaSfvdland their argument types and what they do are:
727df0ccbaSfvdl.Bl -column "CLSET_FD_NCLOSE" "struct timeval *" "set total timeout"
737df0ccbaSfvdl.It Dv CLSET_TIMEOUT Ta "struct timeval *" Ta "set total timeout"
747df0ccbaSfvdl.It Dv CLGET_TIMEOUT Ta "struct timeval *" Ta "get total timeout"
757df0ccbaSfvdl.El
767df0ccbaSfvdl.Pp
777df0ccbaSfvdlNote:
787df0ccbaSfvdlif you set the timeout using
797df0ccbaSfvdl.Fn clnt_control ,
807df0ccbaSfvdlthe timeout argument passed by
817df0ccbaSfvdl.Fn clnt_call
827df0ccbaSfvdlis ignored in all subsequent calls.
83723dbf64Swiz.Pp
847df0ccbaSfvdlNote:
857df0ccbaSfvdlIf you set the timeout value to 0
867df0ccbaSfvdl.Fn clnt_control
87bde048ccSenamiimmediately returns an error
88bde048ccSenami.Pq Dv RPC_TIMEDOUT .
897df0ccbaSfvdlSet the timeout parameter to 0 for batching calls.
907df0ccbaSfvdl.Bl -column CLSET_FD_NCLOSE "struct timeval *" "do not close fd on destroy"
917df0ccbaSfvdl.It Dv CLGET_SVC_ADDR Ta "struct netbuf *" Ta "get servers address"
927df0ccbaSfvdl.It Dv CLGET_FD Ta "int *" Ta "get fd from handle"
937df0ccbaSfvdl.It Dv CLSET_FD_CLOSE Ta "void" Ta "close fd on destroy"
947df0ccbaSfvdl.It Dv CLSET_FD_NCLOSE Ta void Ta "don't close fd on destroy"
957df0ccbaSfvdl.It Dv CLGET_VERS Ta "unsigned long *" Ta "get RPC program version"
967df0ccbaSfvdl.It Dv CLSET_VERS Ta "unsigned long *" Ta "set RPC program version"
977df0ccbaSfvdl.It Dv CLGET_XID Ta "unsigned long *" Ta "get XID of previous call"
987df0ccbaSfvdl.It Dv CLSET_XID Ta "unsigned long *" Ta "set XID of next call"
997df0ccbaSfvdl.El
1007df0ccbaSfvdl.Pp
1017df0ccbaSfvdlThe following operations are valid for connectionless transports only:
1027df0ccbaSfvdl.Bl -column CLSET_RETRY_TIMEOUT "struct timeval *" "set total timeout"
1037df0ccbaSfvdl.It Dv CLSET_RETRY_TIMEOUT Ta "struct timeval *" Ta "set the retry timeout"
1047df0ccbaSfvdl.It Dv CLGET_RETRY_TIMEOUT Ta "struct timeval *" Ta "get the retry timeout"
1057df0ccbaSfvdl.El
1067df0ccbaSfvdl.Pp
1077df0ccbaSfvdlThe retry timeout is the time that RPC
1087df0ccbaSfvdlwaits for the server to reply before retransmitting the request.
1097df0ccbaSfvdl.Fn clnt_control
1107df0ccbaSfvdlreturns
1117df0ccbaSfvdl.Dv TRUE
1127df0ccbaSfvdlon success and
1137df0ccbaSfvdl.Dv FALSE
1147df0ccbaSfvdlon failure.
1157df0ccbaSfvdl.Pp
1167df0ccbaSfvdl.It Fn clnt_create
1177df0ccbaSfvdlGeneric client creation routine for program
1187df0ccbaSfvdl.Fa prognum
1197df0ccbaSfvdland version
1207df0ccbaSfvdl.Fa versnum .
1217df0ccbaSfvdl.Fa host
1227df0ccbaSfvdlidentifies the name of the remote host where the server
1237df0ccbaSfvdlis located.
1247df0ccbaSfvdl.Fa nettype
1257df0ccbaSfvdlindicates the class of transport protocol to use.
1267df0ccbaSfvdlThe transports are tried in left to right order in
1277df0ccbaSfvdl.Ev NETPATH
1287df0ccbaSfvdlenvironment variable or in top to bottom order in
1297df0ccbaSfvdlthe netconfig database.
1307df0ccbaSfvdl.Fn clnt_create
1317df0ccbaSfvdltries all the transports of the
1327df0ccbaSfvdl.Fa nettype
1337df0ccbaSfvdlclass available from the
1347df0ccbaSfvdl.Ev NETPATH
1357df0ccbaSfvdlenvironment variable and the netconfig database,
1367df0ccbaSfvdland chooses the first successful one.
1377df0ccbaSfvdlA default timeout is set and can be modified using
1387df0ccbaSfvdl.Fn clnt_control .
1397df0ccbaSfvdlThis routine returns
1407df0ccbaSfvdl.Dv NULL
1417df0ccbaSfvdlif it fails.
1427df0ccbaSfvdlThe
1437df0ccbaSfvdl.Fn clnt_pcreateerror
1447df0ccbaSfvdlroutine can be used to print the reason for failure.
1457df0ccbaSfvdl.Pp
1467df0ccbaSfvdlNote:
1477df0ccbaSfvdl.Fn clnt_create
1487df0ccbaSfvdlreturns a valid client handle even
1497df0ccbaSfvdlif the particular version number supplied to
1507df0ccbaSfvdl.Fn clnt_create
1517df0ccbaSfvdlis not registered with the
1527df0ccbaSfvdl.Xr rpcbind 8
1537df0ccbaSfvdlservice.
1547df0ccbaSfvdlThis mismatch will be discovered by a
1557df0ccbaSfvdl.Fn clnt_call
1567df0ccbaSfvdllater (see
1577df0ccbaSfvdl.Xr rpc_clnt_calls 3 ) .
1587df0ccbaSfvdl.Pp
1597df0ccbaSfvdl.It Fn clnt_create_vers
1607df0ccbaSfvdlGeneric client creation routine which is similar to
1617df0ccbaSfvdl.Fn clnt_create
1627df0ccbaSfvdlbut which also checks for the
1637df0ccbaSfvdlversion availability.
1647df0ccbaSfvdl.Fa host
1657df0ccbaSfvdlidentifies the name of the remote host where the server
1667df0ccbaSfvdlis located.
1677df0ccbaSfvdl.Fa nettype
1687df0ccbaSfvdlindicates the class transport protocols to be used.
1697df0ccbaSfvdlIf the routine is successful it returns a client handle created for
1707df0ccbaSfvdlthe highest version between
1717df0ccbaSfvdl.Fa vers_low
1727df0ccbaSfvdland
1737df0ccbaSfvdl.Fa vers_high
1747df0ccbaSfvdlthat is supported by the server.
1757df0ccbaSfvdl.Fa vers_outp
1767df0ccbaSfvdlis set to this value.
1777df0ccbaSfvdlThat is, after a successful return
1787df0ccbaSfvdl.Fa vers_low
179814f296bSross\*[Le]
1807df0ccbaSfvdl.Fa *vers_outp
181814f296bSross\*[Le]
1827df0ccbaSfvdl.Fa vers_high .
1837df0ccbaSfvdlIf no version between
1847df0ccbaSfvdl.Fa vers_low
1857df0ccbaSfvdland
1867df0ccbaSfvdl.Fa vers_high
1877df0ccbaSfvdlis supported by the server then the routine fails and returns
1887df0ccbaSfvdl.Dv NULL .
1897df0ccbaSfvdlA default timeout is set and can be modified using
1907df0ccbaSfvdl.Fn clnt_control .
1917df0ccbaSfvdlThis routine returns
1927df0ccbaSfvdl.Dv NULL
1937df0ccbaSfvdlif it fails.
1947df0ccbaSfvdlThe
1957df0ccbaSfvdl.Fn clnt_pcreateerror
1967df0ccbaSfvdlroutine can be used to print the reason for failure.
1977df0ccbaSfvdlNote:
1987df0ccbaSfvdl.Fn clnt_create
1997df0ccbaSfvdlreturns a valid client handle even
2007df0ccbaSfvdlif the particular version number supplied to
2017df0ccbaSfvdl.Fn clnt_create
2027df0ccbaSfvdlis not registered with the
2037df0ccbaSfvdl.Xr rpcbind 8
2047df0ccbaSfvdlservice.
2057df0ccbaSfvdlThis mismatch will be discovered by a
2067df0ccbaSfvdl.Fn clnt_call
2077df0ccbaSfvdllater (see
208723dbf64Swiz.Xr rpc_clnt_calls 3 ) .
2097df0ccbaSfvdlHowever,
2107df0ccbaSfvdl.Fn clnt_create_vers
2117df0ccbaSfvdldoes this for you and returns a valid handle
2127df0ccbaSfvdlonly if a version within
2137df0ccbaSfvdlthe range supplied is supported by the server.
2147df0ccbaSfvdl.Pp
2157df0ccbaSfvdl.It Fn clnt_destroy
2167df0ccbaSfvdlA function macro that destroys the client's RPC handle.
2177df0ccbaSfvdlDestruction usually involves deallocation
2187df0ccbaSfvdlof private data structures, including
2197df0ccbaSfvdl.Fa clnt
2207df0ccbaSfvdlitself.
2217df0ccbaSfvdlUse of
2227df0ccbaSfvdl.Fa clnt
2237df0ccbaSfvdlis undefined after calling
2247df0ccbaSfvdl.Fn clnt_destroy .
2257df0ccbaSfvdlIf the RPC library opened the associated file descriptor, or
2267df0ccbaSfvdl.Dv CLSET_FD_CLOSE
2277df0ccbaSfvdlwas set using
2287df0ccbaSfvdl.Fn clnt_control ,
2297df0ccbaSfvdlthe file descriptor will be closed.
2307df0ccbaSfvdlThe caller should call
231*01869ca4Swiz.Fn auth_destroy "clnt->cl_auth"
2327df0ccbaSfvdl(before calling
2337df0ccbaSfvdl.Fn clnt_destroy )
2347df0ccbaSfvdlto destroy the associated
2357df0ccbaSfvdl.Dv AUTH
2367df0ccbaSfvdlstructure (see
2377df0ccbaSfvdl.Xr rpc_clnt_auth 3 ) .
2387df0ccbaSfvdl.Pp
2397df0ccbaSfvdl.It Fn clnt_dg_create
2407df0ccbaSfvdlThis routine creates an RPC client for the remote program
2417df0ccbaSfvdl.Fa prognum
2427df0ccbaSfvdland version
2437df0ccbaSfvdl.Fa versnum ;
2447df0ccbaSfvdlthe client uses a connectionless transport.
2457df0ccbaSfvdlThe remote program is located at address
2467df0ccbaSfvdl.Fa svcaddr .
2477df0ccbaSfvdlThe parameter
2487df0ccbaSfvdl.Fa fildes
2497df0ccbaSfvdlis an open and bound file descriptor.
2507df0ccbaSfvdlThis routine will resend the call message in intervals of
2517df0ccbaSfvdl15 seconds until a response is received or until the
2527df0ccbaSfvdlcall times out.
2537df0ccbaSfvdlThe total time for the call to time out is specified by
2547df0ccbaSfvdl.Fn clnt_call
2557df0ccbaSfvdl(see
2567df0ccbaSfvdl.Fn clnt_call
2577df0ccbaSfvdlin
2587df0ccbaSfvdl.Xr rpc_clnt_calls 3 ) .
2597df0ccbaSfvdlThe retry time out and the total time out periods can
2607df0ccbaSfvdlbe changed using
2617df0ccbaSfvdl.Fn clnt_control .
2627df0ccbaSfvdlThe user may set the size of the send and receive
2637df0ccbaSfvdlbuffers with the parameters
2647df0ccbaSfvdl.Fa sendsz
2657df0ccbaSfvdland
2667df0ccbaSfvdl.Fa recvsz ;
2677df0ccbaSfvdlvalues of 0 choose suitable defaults.
2687df0ccbaSfvdlThis routine returns
2697df0ccbaSfvdl.Dv NULL
2707df0ccbaSfvdlif it fails.
2717df0ccbaSfvdl.Pp
2727df0ccbaSfvdl.It Fn clnt_pcreateerror
2737df0ccbaSfvdlPrint a message to standard error indicating
2747df0ccbaSfvdlwhy a client RPC handle could not be created.
2757df0ccbaSfvdlThe message is prepended with the string
2767df0ccbaSfvdl.Fa s
2777df0ccbaSfvdland a colon, and appended with a newline.
2787df0ccbaSfvdl.Pp
2797df0ccbaSfvdl.It Fn clnt_spcreateerror
2807df0ccbaSfvdlLike
2817df0ccbaSfvdl.Fn clnt_pcreateerror ,
2827df0ccbaSfvdlexcept that it returns a string
2837df0ccbaSfvdlinstead of printing to the standard error.
2847df0ccbaSfvdlA newline is not appended to the message in this case.
2857df0ccbaSfvdlWarning:
2867df0ccbaSfvdlreturns a pointer to a buffer that is overwritten
2877df0ccbaSfvdlon each call.
2887df0ccbaSfvdl.Pp
2897df0ccbaSfvdl.It Fn clnt_raw_create
2907df0ccbaSfvdlThis routine creates an RPC
2917df0ccbaSfvdlclient handle for the remote program
2927df0ccbaSfvdl.Fa prognum
2937df0ccbaSfvdland version
2947df0ccbaSfvdl.Fa versnum .
2957df0ccbaSfvdlThe transport used to pass messages to the service is
2967df0ccbaSfvdla buffer within the process's address space,
2977df0ccbaSfvdlso the corresponding RPC
2987df0ccbaSfvdlserver should live in the same address space;
2997df0ccbaSfvdl(see
3007df0ccbaSfvdl.Fn svc_raw_create
3017df0ccbaSfvdlin
3027df0ccbaSfvdl.Xr rpc_svc_create 3 ) .
3037df0ccbaSfvdlThis allows simulation of RPC and measurement of
3047df0ccbaSfvdlRPC overheads, such as round trip times,
3057df0ccbaSfvdlwithout any kernel or networking interference.
3067df0ccbaSfvdlThis routine returns
3077df0ccbaSfvdl.Dv NULL
3087df0ccbaSfvdlif it fails.
3097df0ccbaSfvdl.Fn clnt_raw_create
3107df0ccbaSfvdlshould be called after
3117df0ccbaSfvdl.Fn svc_raw_create .
3127df0ccbaSfvdl.Pp
3137df0ccbaSfvdl.It Fn clnt_tli_create
3147df0ccbaSfvdlThis routine creates an RPC
3157df0ccbaSfvdlclient handle for the remote program
3167df0ccbaSfvdl.Fa prognum
3177df0ccbaSfvdland version
3187df0ccbaSfvdl.Fa versnum .
3197df0ccbaSfvdlThe remote program is located at address
3207df0ccbaSfvdl.Fa svcaddr .
3217df0ccbaSfvdlIf
3227df0ccbaSfvdl.Fa svcaddr
3237df0ccbaSfvdlis
3247df0ccbaSfvdl.Dv NULL
3257df0ccbaSfvdland it is connection-oriented, it is assumed that the file descriptor
3266569c5c5Swizis connected.
3276569c5c5SwizFor connectionless transports, if
3287df0ccbaSfvdl.Fa svcaddr
3297df0ccbaSfvdlis
33065a94a80Sjoerg.Dv NULL ,
3317df0ccbaSfvdl.Dv RPC_UNKNOWNADDR
3327df0ccbaSfvdlerror is set.
3337df0ccbaSfvdl.Fa fildes
3347df0ccbaSfvdlis a file descriptor which may be open, bound and connected.
3357df0ccbaSfvdlIf it is
3367df0ccbaSfvdl.Dv RPC_ANYFD ,
3377df0ccbaSfvdlit opens a file descriptor on the transport specified by
3387df0ccbaSfvdl.Fa netconf .
3397df0ccbaSfvdlIf
3407df0ccbaSfvdl.Fa fildes
3417df0ccbaSfvdlis
3427df0ccbaSfvdl.Dv RPC_ANYFD
3437df0ccbaSfvdland
3447df0ccbaSfvdl.Fa netconf
3457df0ccbaSfvdlis
3467df0ccbaSfvdl.Dv NULL ,
3477df0ccbaSfvdla
3487df0ccbaSfvdl.Dv RPC_UNKNOWNPROTO
3497df0ccbaSfvdlerror is set.
3507df0ccbaSfvdlIf
3517df0ccbaSfvdl.Fa fildes
3527df0ccbaSfvdlis unbound, then it will attempt to bind the descriptor.
3537df0ccbaSfvdlThe user may specify the size of the buffers with the parameters
3547df0ccbaSfvdl.Fa sendsz
3557df0ccbaSfvdland
3567df0ccbaSfvdl.Fa recvsz ;
3577df0ccbaSfvdlvalues of 0 choose suitable defaults.
3587df0ccbaSfvdlDepending upon the type of the transport (connection-oriented
3597df0ccbaSfvdlor connectionless),
3607df0ccbaSfvdl.Fn clnt_tli_create
3617df0ccbaSfvdlcalls appropriate client creation routines.
3627df0ccbaSfvdlThis routine returns
3637df0ccbaSfvdl.Dv NULL
3647df0ccbaSfvdlif it fails.
3657df0ccbaSfvdlThe
3667df0ccbaSfvdl.Fn clnt_pcreateerror
3677df0ccbaSfvdlroutine can be used to print the reason for failure.
3687df0ccbaSfvdlThe remote rpcbind
3697df0ccbaSfvdlservice (see
3707df0ccbaSfvdl.Xr rpcbind 8 )
3717df0ccbaSfvdlis not consulted for the address of the remote
3727df0ccbaSfvdlservice.
3737df0ccbaSfvdl.Pp
374d7fde522Sfvdl.It Fn clnt_tp_create
3757df0ccbaSfvdlLike
3767df0ccbaSfvdl.Fn clnt_create
3777df0ccbaSfvdlexcept
3787df0ccbaSfvdl.Fn clnt_tp_create
3797df0ccbaSfvdltries only one transport specified through
3807df0ccbaSfvdl.Fa netconf .
3817df0ccbaSfvdl.Fn clnt_tp_create
3827df0ccbaSfvdlcreates a client handle for the program
3837df0ccbaSfvdl.Fa prognum ,
3847df0ccbaSfvdlthe version
3857df0ccbaSfvdl.Fa versnum ,
3867df0ccbaSfvdland for the transport specified by
3877df0ccbaSfvdl.Fa netconf .
3887df0ccbaSfvdlDefault options are set,
3897df0ccbaSfvdlwhich can be changed using
3907df0ccbaSfvdl.Fn clnt_control
3917df0ccbaSfvdlcalls.
39271b7c0b2SmjlThe remote rpcbind service on the host
3937df0ccbaSfvdl.Fa host
3947df0ccbaSfvdlis consulted for the address of the remote service.
3957df0ccbaSfvdlThis routine returns
3967df0ccbaSfvdl.Dv NULL
3977df0ccbaSfvdlif it fails.
3987df0ccbaSfvdlThe
3997df0ccbaSfvdl.Fn clnt_pcreateerror
4007df0ccbaSfvdlroutine can be used to print the reason for failure.
4017df0ccbaSfvdl.Pp
402d7fde522Sfvdl.It Fn clnt_vc_create
4037df0ccbaSfvdlThis routine creates an RPC
4047df0ccbaSfvdlclient for the remote program
4057df0ccbaSfvdl.Fa prognum
4067df0ccbaSfvdland version
4077df0ccbaSfvdl.Fa versnum ;
4087df0ccbaSfvdlthe client uses a connection-oriented transport.
4097df0ccbaSfvdlThe remote program is located at address
4107df0ccbaSfvdl.Fa svcaddr .
4117df0ccbaSfvdlThe parameter
4127df0ccbaSfvdl.Fa fildes
4137df0ccbaSfvdlis an open and bound file descriptor.
4147df0ccbaSfvdlThe user may specify the size of the send and receive buffers
4157df0ccbaSfvdlwith the parameters
4167df0ccbaSfvdl.Fa sendsz
4177df0ccbaSfvdland
4187df0ccbaSfvdl.Fa recvsz ;
4197df0ccbaSfvdlvalues of 0 choose suitable defaults.
4207df0ccbaSfvdlThis routine returns
4217df0ccbaSfvdl.Dv NULL
4227df0ccbaSfvdlif it fails.
4237df0ccbaSfvdlThe address
4247df0ccbaSfvdl.Fa svcaddr
4257df0ccbaSfvdlshould not be
4267df0ccbaSfvdl.Dv NULL
4277df0ccbaSfvdland should point to the actual address of the remote program.
4287df0ccbaSfvdl.Fn clnt_vc_create
4297df0ccbaSfvdldoes not consult the remote rpcbind service for this information.
4307df0ccbaSfvdl.Pp
4317df0ccbaSfvdl.It struct rpc_createerr rpc_createerr;
4327df0ccbaSfvdlA global variable whose value is set by any RPC
4337df0ccbaSfvdlclient handle creation routine
4346569c5c5Swizthat fails.
4356569c5c5SwizIt is used by the routine
4367df0ccbaSfvdl.Fn clnt_pcreateerror
4377df0ccbaSfvdlto print the reason for the failure.
4387df0ccbaSfvdl.El
4397df0ccbaSfvdl.Sh SEE ALSO
4407df0ccbaSfvdl.Xr rpc 3 ,
4417df0ccbaSfvdl.Xr rpc_clnt_auth 3 ,
4427df0ccbaSfvdl.Xr rpc_clnt_calls 3 ,
4437df0ccbaSfvdl.Xr rpcbind 8
444