xref: /titanic_50/usr/src/lib/libresolv2/include/resolv_mt.h (revision 9525b14bcdeb5b5f6f95ab27c2f48f18bd2ec829)
17c478bd9Sstevel@tonic-gate #ifndef _RESOLV_MT_H
27c478bd9Sstevel@tonic-gate #define _RESOLV_MT_H
37c478bd9Sstevel@tonic-gate 
47c478bd9Sstevel@tonic-gate #include <sys/types.h>
57c478bd9Sstevel@tonic-gate #include <netinet/in.h>
67c478bd9Sstevel@tonic-gate #include <arpa/nameser.h>
77c478bd9Sstevel@tonic-gate #include <resolv.h>
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /* Access functions for the libresolv private interface */
107c478bd9Sstevel@tonic-gate 
117c478bd9Sstevel@tonic-gate int	__res_enable_mt(void);
127c478bd9Sstevel@tonic-gate int	__res_disable_mt(void);
137c478bd9Sstevel@tonic-gate 
147c478bd9Sstevel@tonic-gate /* Per-thread context */
157c478bd9Sstevel@tonic-gate 
167c478bd9Sstevel@tonic-gate typedef struct {
177c478bd9Sstevel@tonic-gate int	no_hosts_fallback_private;
187c478bd9Sstevel@tonic-gate int	retry_save;
197c478bd9Sstevel@tonic-gate int	retry_private;
207c478bd9Sstevel@tonic-gate char	inet_nsap_ntoa_tmpbuf[255*3];
217c478bd9Sstevel@tonic-gate char	sym_ntos_unname[20];
227c478bd9Sstevel@tonic-gate char	sym_ntop_unname[20];
237c478bd9Sstevel@tonic-gate char	p_option_nbuf[40];
247c478bd9Sstevel@tonic-gate char	p_time_nbuf[40];
257c478bd9Sstevel@tonic-gate char	precsize_ntoa_retbuf[sizeof "90000000.00"];
267c478bd9Sstevel@tonic-gate char	loc_ntoa_tmpbuf[sizeof
277c478bd9Sstevel@tonic-gate "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
287c478bd9Sstevel@tonic-gate char	p_secstodate_output[15];
297c478bd9Sstevel@tonic-gate } mtctxres_t;
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate /* Thread-specific data (TSD) */
327c478bd9Sstevel@tonic-gate 
33*9525b14bSRao Shoaib mtctxres_t	*___mtctxres(void);
347c478bd9Sstevel@tonic-gate #define mtctxres	(___mtctxres())
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /* Various static data that should be TSD */
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #define sym_ntos_unname		(mtctxres->sym_ntos_unname)
397c478bd9Sstevel@tonic-gate #define sym_ntop_unname		(mtctxres->sym_ntop_unname)
407c478bd9Sstevel@tonic-gate #define inet_nsap_ntoa_tmpbuf	(mtctxres->inet_nsap_ntoa_tmpbuf)
417c478bd9Sstevel@tonic-gate #define p_option_nbuf		(mtctxres->p_option_nbuf)
427c478bd9Sstevel@tonic-gate #define p_time_nbuf		(mtctxres->p_time_nbuf)
437c478bd9Sstevel@tonic-gate #define precsize_ntoa_retbuf	(mtctxres->precsize_ntoa_retbuf)
447c478bd9Sstevel@tonic-gate #define loc_ntoa_tmpbuf		(mtctxres->loc_ntoa_tmpbuf)
457c478bd9Sstevel@tonic-gate #define p_secstodate_output	(mtctxres->p_secstodate_output)
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #endif /* _RESOLV_MT_H */
48