Lines Matching refs:ct
117 struct ct_data *ct = (struct ct_data *) mem_alloc (sizeof (*ct)); in clntunix_create() local
122 if (h == NULL || ct == NULL) in clntunix_create()
148 ct->ct_closeit = TRUE; in clntunix_create()
152 ct->ct_closeit = FALSE; in clntunix_create()
158 ct->ct_sock = *sockp; in clntunix_create()
159 ct->ct_wait.tv_usec = 0; in clntunix_create()
160 ct->ct_waitset = FALSE; in clntunix_create()
161 ct->ct_addr = *raddr; in clntunix_create()
175 xdrmem_create (&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE, XDR_ENCODE); in clntunix_create()
176 if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg)) in clntunix_create()
178 if (ct->ct_closeit) in clntunix_create()
182 ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs)); in clntunix_create()
183 XDR_DESTROY (&(ct->ct_xdrs)); in clntunix_create()
189 xdrrec_create (&(ct->ct_xdrs), sendsz, recvsz, in clntunix_create()
190 (caddr_t) ct, readunix, writeunix); in clntunix_create()
192 h->cl_private = (caddr_t) ct; in clntunix_create()
200 mem_free ((caddr_t) ct, sizeof (struct ct_data)); in clntunix_create()
211 struct ct_data *ct = (struct ct_data *) h->cl_private; in libc_hidden_nolink_sunrpc() local
212 XDR *xdrs = &(ct->ct_xdrs); in libc_hidden_nolink_sunrpc()
215 uint32_t *msg_x_id = (uint32_t *) (ct->ct_mcall); /* yuk */ in libc_hidden_nolink_sunrpc()
219 if (!ct->ct_waitset) in libc_hidden_nolink_sunrpc()
221 ct->ct_wait = timeout; in libc_hidden_nolink_sunrpc()
225 (xdr_results == (xdrproc_t) 0 && ct->ct_wait.tv_sec == 0 in libc_hidden_nolink_sunrpc()
226 && ct->ct_wait.tv_usec == 0) ? FALSE : TRUE; in libc_hidden_nolink_sunrpc()
230 ct->ct_error.re_status = RPC_SUCCESS; in libc_hidden_nolink_sunrpc()
232 if ((!XDR_PUTBYTES (xdrs, ct->ct_mcall, ct->ct_mpos)) || in libc_hidden_nolink_sunrpc()
237 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_nolink_sunrpc()
238 ct->ct_error.re_status = RPC_CANTENCODEARGS; in libc_hidden_nolink_sunrpc()
240 return ct->ct_error.re_status; in libc_hidden_nolink_sunrpc()
243 return ct->ct_error.re_status = RPC_CANTSEND; in libc_hidden_nolink_sunrpc()
249 if (ct->ct_wait.tv_sec == 0 && ct->ct_wait.tv_usec == 0) in libc_hidden_nolink_sunrpc()
250 return ct->ct_error.re_status = RPC_TIMEDOUT; in libc_hidden_nolink_sunrpc()
263 return ct->ct_error.re_status; in libc_hidden_nolink_sunrpc()
267 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_nolink_sunrpc()
269 return ct->ct_error.re_status; in libc_hidden_nolink_sunrpc()
278 _seterr_reply (&reply_msg, &(ct->ct_error)); in libc_hidden_nolink_sunrpc()
279 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_nolink_sunrpc()
283 ct->ct_error.re_status = RPC_AUTHERROR; in libc_hidden_nolink_sunrpc()
284 ct->ct_error.re_why = AUTH_INVALIDRESP; in libc_hidden_nolink_sunrpc()
288 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_nolink_sunrpc()
289 ct->ct_error.re_status = RPC_CANTDECODERES; in libc_hidden_nolink_sunrpc()
304 return ct->ct_error.re_status; in libc_hidden_nolink_sunrpc()
310 struct ct_data *ct = (struct ct_data *) h->cl_private; in clntunix_geterr() local
312 *errp = ct->ct_error; in clntunix_geterr()
318 struct ct_data *ct = (struct ct_data *) cl->cl_private; in clntunix_freeres() local
319 XDR *xdrs = &(ct->ct_xdrs); in clntunix_freeres()
333 struct ct_data *ct = (struct ct_data *) cl->cl_private; in clntunix_control() local
340 ct->ct_closeit = TRUE; in clntunix_control()
343 ct->ct_closeit = FALSE; in clntunix_control()
346 ct->ct_wait = *(struct timeval *) info; in clntunix_control()
349 *(struct timeval *) info = ct->ct_wait; in clntunix_control()
352 *(struct sockaddr_un *) info = ct->ct_addr; in clntunix_control()
355 *(int *)info = ct->ct_sock; in clntunix_control()
363 memcpy (&ui32, ct->ct_mcall, sizeof (ui32)); in clntunix_control()
371 memcpy (ct->ct_mcall, &ui32, sizeof (ui32)); in clntunix_control()
381 memcpy (&ui32, ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clntunix_control()
388 memcpy (ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clntunix_control()
397 memcpy (&ui32, ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clntunix_control()
404 memcpy (ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clntunix_control()
423 struct ct_data *ct = in clntunix_destroy() local
426 if (ct->ct_closeit) in clntunix_destroy()
428 (void) __close (ct->ct_sock); in clntunix_destroy()
430 XDR_DESTROY (&(ct->ct_xdrs)); in clntunix_destroy()
431 mem_free ((caddr_t) ct, sizeof (struct ct_data)); in clntunix_destroy()
537 struct ct_data *ct = (struct ct_data *) ctptr; in readunix() local
539 int milliseconds = ((ct->ct_wait.tv_sec * 1000) in readunix()
540 + (ct->ct_wait.tv_usec / 1000)); in readunix()
545 fd.fd = ct->ct_sock; in readunix()
552 ct->ct_error.re_status = RPC_TIMEDOUT; in readunix()
558 ct->ct_error.re_status = RPC_CANTRECV; in readunix()
559 ct->ct_error.re_errno = errno; in readunix()
564 switch (len = __msgread (ct->ct_sock, buf, len)) in readunix()
569 ct->ct_error.re_errno = ECONNRESET; in readunix()
570 ct->ct_error.re_status = RPC_CANTRECV; in readunix()
575 ct->ct_error.re_errno = errno; in readunix()
576 ct->ct_error.re_status = RPC_CANTRECV; in readunix()
586 struct ct_data *ct = (struct ct_data *) ctptr; in writeunix() local
590 if ((i = __msgwrite (ct->ct_sock, buf, cnt)) == -1) in writeunix()
592 ct->ct_error.re_errno = errno; in writeunix()
593 ct->ct_error.re_status = RPC_CANTSEND; in writeunix()