diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-03-20 18:35:13 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-03-20 18:35:13 +0000 |
commit | f1e4a4a403f740c153acfc0cd96ecc5aa542e341 (patch) | |
tree | 55d564a6eba26109ea12055a24b7846c1a100fa4 /sunrpc/svc_raw.c | |
parent | 373e6a512c30b2e34ac4a6f5b154edf45f400b35 (diff) | |
download | glibc-f1e4a4a403f740c153acfc0cd96ecc5aa542e341.zip glibc-f1e4a4a403f740c153acfc0cd96ecc5aa542e341.tar.gz glibc-f1e4a4a403f740c153acfc0cd96ecc5aa542e341.tar.bz2 |
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/svc_raw.c')
-rw-r--r-- | sunrpc/svc_raw.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sunrpc/svc_raw.c b/sunrpc/svc_raw.c index 1a7fcaa..e4752a6 100644 --- a/sunrpc/svc_raw.c +++ b/sunrpc/svc_raw.c @@ -46,14 +46,18 @@ static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro"; /* * This is the "network" that we will be moving data over */ -static struct svcraw_private +struct svcraw_private_s { char _raw_buf[UDPMSGSIZE]; SVCXPRT server; XDR xdr_stream; char verf_body[MAX_AUTH_BYTES]; - } - *svcraw_private; + }; +#ifdef _RPC_THREAD_SAFE_ +#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s)) +#else +static struct svcraw_private_s *svcraw_private; +#endif static bool_t svcraw_recv (SVCXPRT *, struct rpc_msg *); static enum xprt_stat svcraw_stat (SVCXPRT *); @@ -75,11 +79,11 @@ static struct xp_ops server_ops = SVCXPRT * svcraw_create (void) { - struct svcraw_private *srp = svcraw_private; + struct svcraw_private_s *srp = svcraw_private; if (srp == 0) { - srp = (struct svcraw_private *) calloc (1, sizeof (*srp)); + srp = (struct svcraw_private_s *) calloc (1, sizeof (*srp)); if (srp == 0) return NULL; } @@ -102,7 +106,7 @@ svcraw_recv (xprt, msg) SVCXPRT *xprt; struct rpc_msg *msg; { - struct svcraw_private *srp = svcraw_private; + struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; if (srp == 0) @@ -118,7 +122,7 @@ svcraw_recv (xprt, msg) static bool_t svcraw_reply (SVCXPRT *xprt, struct rpc_msg *msg) { - struct svcraw_private *srp = svcraw_private; + struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; if (srp == 0) @@ -135,7 +139,7 @@ svcraw_reply (SVCXPRT *xprt, struct rpc_msg *msg) static bool_t svcraw_getargs (SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) { - struct svcraw_private *srp = svcraw_private; + struct svcraw_private_s *srp = svcraw_private; if (srp == 0) return FALSE; @@ -145,7 +149,7 @@ svcraw_getargs (SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) static bool_t svcraw_freeargs (SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) { - struct svcraw_private *srp = svcraw_private; + struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; if (srp == 0) |