rpc.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _RPC_RPC_H
  2. #include <sunrpc/rpc/rpc.h>
  3. # ifndef _ISOMAC
  4. #include <libc-tsd.h>
  5. /* Now define the internal interfaces. */
  6. extern unsigned long _create_xid (void);
  7. /*
  8. * Multi-threaded support
  9. * Group all global and static variables into a single spot.
  10. * This area is allocated on a per-thread basis
  11. */
  12. struct rpc_thread_variables {
  13. fd_set svc_fdset_s; /* Global, rpc_common.c */
  14. struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */
  15. struct pollfd *svc_pollfd_s; /* Global, rpc_common.c */
  16. int svc_max_pollfd_s; /* Global, rpc_common.c */
  17. char *clnt_perr_buf_s; /* clnt_perr.c */
  18. struct clntraw_private_s *clntraw_private_s; /* clnt_raw.c */
  19. struct callrpc_private_s *callrpc_private_s; /* clnt_simp.c */
  20. struct key_call_private *key_call_private_s; /* key_call.c */
  21. struct cache_entry *authdes_cache_s; /* svcauth_des.c */
  22. int *authdes_lru_s; /* svcauth_des.c */
  23. SVCXPRT **svc_xports_s; /* svc.c */
  24. struct svc_callout *svc_head_s; /* svc.c */
  25. struct svcraw_private_s *svcraw_private_s; /* svc_raw.c */
  26. struct proglst_ *svcsimple_proglst_s; /* svc_simple.c */
  27. SVCXPRT *svcsimple_transp_s; /* svc_simple.c */
  28. };
  29. extern struct rpc_thread_variables *__rpc_thread_variables(void)
  30. __attribute__ ((const)) attribute_hidden;
  31. extern void __rpc_thread_svc_cleanup (void) attribute_hidden;
  32. extern void __rpc_thread_clnt_cleanup (void) attribute_hidden;
  33. extern void __rpc_thread_key_cleanup (void) attribute_hidden;
  34. extern void __rpc_thread_destroy (void) attribute_hidden;
  35. __libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
  36. #define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
  37. libc_hidden_proto (__rpc_thread_svc_max_pollfd)
  38. libc_hidden_proto (__rpc_thread_svc_pollfd)
  39. libc_hidden_proto (__rpc_thread_svc_fdset)
  40. libc_hidden_proto (__rpc_thread_createerr)
  41. /* Perform a host name lookup for NAME and return the first IPv4
  42. address in *ADDR. Return 0 on success and -1 on error (and set an
  43. RPC error). */
  44. int __libc_rpc_gethostbyname (const char *host, struct sockaddr_in *addr)
  45. attribute_hidden;
  46. # endif /* !_ISOMAC */
  47. #endif