+2018-06-26 Florian Weimer <fweimer@redhat.com>
+
+ Remove always-defined _RPC_THREAD_SAFE_ macro.
+ * sunrpc/Makefile (sunrpc-CPPFLAGS, CPPFLAGS, BUILD_CPPFLAGS):
+ Do not define _RPC_THREAD_SAFE_.
+ * include/rpc/rpc.h: Remove _RPC_THREAD_SAFE_ preprocessor
+ conditional.
+ * 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/rpc_main.c: Likewise.
+ * sunrpc/rpc_thread.c: Likewise.
+ * sunrpc/svc.c: Likewise.
+ * sunrpc/svc_raw.c: Likewise.
+ * sunrpc/svc_simple.c: Likewise.
+ * sumrpc/svcauth_des.c: Likewise.
+
2018-06-26 Florian Weimer <fweimer@redhat.com>
* libio/Makefile (tests-internal): Add tst-vtables,
* Group all global and static variables into a single spot.
* This area is allocated on a per-thread basis
*/
-#ifdef _RPC_THREAD_SAFE_
struct rpc_thread_variables {
fd_set svc_fdset_s; /* Global, rpc_common.c */
struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */
int __libc_rpc_gethostbyname (const char *host, struct sockaddr_in *addr)
attribute_hidden;
-#endif /* _RPC_THREAD_SAFE_ */
-
# endif /* !_ISOMAC */
#endif
CFLAGS-clnt_perr.c += -fexceptions
CFLAGS-openchild.c += -fexceptions
-sunrpc-CPPFLAGS = -D_RPC_THREAD_SAFE_
-CPPFLAGS += $(sunrpc-CPPFLAGS)
-BUILD_CPPFLAGS += $(sunrpc-CPPFLAGS)
-
$(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
static char *auth_errmsg (enum auth_stat stat);
-#ifdef _RPC_THREAD_SAFE_
/*
* Making buf a preprocessor macro requires renaming the local
* buf variable in a few functions. Overriding a global variable
* with a local variable of the same name is a bad idea, anyway.
*/
#define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
-#else
-static char *buf;
-#endif
/*
* Print reply error info
} mashl_callmsg;
u_int mcnt;
};
-#ifdef _RPC_THREAD_SAFE_
#define clntraw_private 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);
u_long oldprognum, oldversnum, valid;
char *oldhost;
};
-#ifdef _RPC_THREAD_SAFE_
#define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
-#else
-static struct callrpc_private_s *callrpc_private;
-#endif
int
callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
}
libc_hidden_nolink_sunrpc (callrpc, GLIBC_2_0)
-#ifdef _RPC_THREAD_SAFE_
void
__rpc_thread_clnt_cleanup (void)
{
free (rcp);
}
}
-#endif /* _RPC_THREAD_SAFE_ */
pid_t pid; /* process-id at moment of creation */
uid_t uid; /* user-id at last authorization */
};
-#ifdef _RPC_THREAD_SAFE_
#define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
-#else
-static struct key_call_private *key_call_private_main;
-#endif
__libc_lock_define_initialized (static, keycall_lock)
/*
#endif
}
-#ifdef _RPC_THREAD_SAFE_
void
__rpc_thread_key_cleanup (void)
{
free (kcp);
}
}
-#endif /* _RPC_THREAD_SAFE_ */
#include <rpc/rpc.h>
#include <shlib-compat.h>
-#ifdef _RPC_THREAD_SAFE_
#undef svc_fdset
#undef rpc_createerr
#undef svc_pollfd
#undef svc_max_pollfd
-#endif /* _RPC_THREAD_SAFE_ */
/*
* This file should only contain common data (global data) that is exported
cmd->Scflag = flag['C'];
cmd->makefileflag = flag['M'];
-#ifndef _RPC_THREAD_SAFE_
- if (mtflag || newstyle)
- {
- /* glibc doesn't support these flags. */
- f_print (stderr,
- _("This implementation doesn't support newstyle or MT-safe code!\n"));
- return (0);
- }
-#endif
if (tirpcflag)
{
pmflag = inetdflag ? 0 : 1; /* pmflag or inetdflag is always TRUE */
#include <libc-tsd.h>
#include <shlib-compat.h>
-#ifdef _RPC_THREAD_SAFE_
/* Variable used in non-threaded applications or for the first thread. */
static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
#else
libc_hidden_nolink_sunrpc (__rpc_thread_svc_max_pollfd, GLIBC_2_2_3)
#endif
-
-#endif /* _RPC_THREAD_SAFE_ */
#include <time.h>
#include <shlib-compat.h>
-#ifdef _RPC_THREAD_SAFE_
#define xports RPC_THREAD_VARIABLE(svc_xports_s)
-#else
-static SVCXPRT **xports;
-#endif
#define NULL_SVC ((struct svc_callout *)0)
#define RQCRED_SIZE 400 /* this size is excessive */
void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
bool_t sc_mapped;
};
-#ifdef _RPC_THREAD_SAFE_
#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
-#else
-static struct svc_callout *svc_head;
-#endif
/* *************** SVCXPRT related stuff **************** */
}
}
-#ifdef _RPC_THREAD_SAFE_
void
__rpc_thread_svc_cleanup (void)
while ((svcp = svc_head) != NULL)
svc_unregister (svcp->sc_prog, svcp->sc_vers);
}
-
-#endif /* _RPC_THREAD_SAFE_ */
XDR xdr_stream;
char verf_body[MAX_AUTH_BYTES];
};
-#ifdef _RPC_THREAD_SAFE_
#define svcraw_private 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 *);
xdrproc_t p_inproc, p_outproc;
struct proglst_ *p_nxt;
};
-#ifdef _RPC_THREAD_SAFE_
#define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
-#else
-static struct proglst_ *proglst;
-#endif
static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
-#ifdef _RPC_THREAD_SAFE_
#define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
-#else
-static SVCXPRT *transp;
-#endif
int
__registerrpc (u_long prognum, u_long versnum, u_long procnum,
struct rpc_timeval laststamp; /* detect replays of creds */
char *localcred; /* generic local credential */
};
-#ifdef _RPC_THREAD_SAFE_
#define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
#define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
-#else
-static struct cache_entry *authdes_cache;
-static int *authdes_lru;
-#endif
static void cache_init (void); /* initialize the cache */
static short cache_spot (des_block *, char *, struct rpc_timeval *);