summaryrefslogtreecommitdiff
path: root/sunrpc/clnt_raw.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-20 18:35:13 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-20 18:35:13 +0000
commitf1e4a4a403f740c153acfc0cd96ecc5aa542e341 (patch)
tree55d564a6eba26109ea12055a24b7846c1a100fa4 /sunrpc/clnt_raw.c
parent373e6a512c30b2e34ac4a6f5b154edf45f400b35 (diff)
Update.
* sunrpc/Makefile (routines): Add rpc_thread. (CPPFLAGS): Add -D_RPC_THREAD_SAFE. * sunrpc/rpc_thread.c: New file. * sunrpc/Versions [libc] (GLIBC_2.2.3): Export __rpc_thread_destroy. * sunrpc/auth_none.c: Don't use global variables. Access state in thread-local storage. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_simp.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/rpc_common.c: Likewise. * sunrpc/svc.c: Likewise. * sunrpc/svc_raw.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svcauth_des.c: Likewise. * hurd/hurd/threadvar.h (enum __hurd_threadvar_index): Add _HURD_THREADVAR_RPC_VARS. * sysdeps/generic/bits/libc-tsd.h: Mention _LIBC_TSD_KEY_RPC_VARS. * include/rpc/rpc.h: Define data structures for internal thread-local "global" variables. Based on patches by Eric Norum <eric.norum@usask.ca>.
Diffstat (limited to 'sunrpc/clnt_raw.c')
-rw-r--r--sunrpc/clnt_raw.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sunrpc/clnt_raw.c b/sunrpc/clnt_raw.c
index 8ed589c93d..ee70e9568b 100644
--- a/sunrpc/clnt_raw.c
+++ b/sunrpc/clnt_raw.c
@@ -52,15 +52,19 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
/*
* This is the "network" we will be moving stuff over.
*/
-static struct clntraw_private
+struct clntraw_private_s
{
CLIENT client_object;
XDR xdr_stream;
char _raw_buf[UDPMSGSIZE];
char mashl_callmsg[MCALL_MSG_SIZE];
u_int mcnt;
- }
- *clntraw_private;
+ };
+#ifdef _RPC_THREAD_SAFE_
+#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
+#else
+static struct clntraw_private_s *clntraw_private;
+#endif
static enum clnt_stat clntraw_call (CLIENT *, u_long, xdrproc_t, caddr_t,
xdrproc_t, caddr_t, struct timeval);
@@ -86,14 +90,14 @@ static struct clnt_ops client_ops =
CLIENT *
clntraw_create (u_long prog, u_long vers)
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private_s *clp = clntraw_private;
struct rpc_msg call_msg;
XDR *xdrs = &clp->xdr_stream;
CLIENT *client = &clp->client_object;
if (clp == 0)
{
- clp = (struct clntraw_private *) calloc (1, sizeof (*clp));
+ clp = (struct clntraw_private_s *) calloc (1, sizeof (*clp));
if (clp == 0)
return (0);
clntraw_private = clp;
@@ -136,7 +140,7 @@ clntraw_call (h, proc, xargs, argsp, xresults, resultsp, timeout)
caddr_t resultsp;
struct timeval timeout;
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private_s *clp = clntraw_private;
XDR *xdrs = &clp->xdr_stream;
struct rpc_msg msg;
enum clnt_stat status;
@@ -220,7 +224,7 @@ clntraw_freeres (cl, xdr_res, res_ptr)
xdrproc_t xdr_res;
caddr_t res_ptr;
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private_s *clp = clntraw_private;
XDR *xdrs = &clp->xdr_stream;
bool_t rval;