xref: /titanic_51/usr/src/lib/libresolv2/include/resolv_mt.h (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
1 /*
2  * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
3  */
4 
5 #ifndef	_RESOLV_MT_H
6 #define	_RESOLV_MT_H
7 
8 #pragma ident	"%Z%%M%	%I%	%E% SMI"
9 
10 #ifdef	__cplusplus
11 extern "C" {
12 #endif
13 
14 #ifdef	SUNW_MT_RESOLVER
15 
16 #include <sys/types.h>
17 #include <netinet/in.h>
18 #include <arpa/nameser.h>
19 #include <resolv.h>
20 
21 /* Access functions for the libresolv private interface */
22 
23 int			__res_enable_mt(void);
24 int			__res_disable_mt(void);
25 
26 /* Per-thread context */
27 
28 typedef struct {
29 #ifdef SUNW_HOSTS_FALLBACK
30 	int				no_hosts_fallback_private;
31 #endif /* SUNW_HOSTS_FALLBACK */
32 #ifdef	SUNW_OVERRIDE_RETRY
33 	int				retry_save;
34 	int				retry_private;
35 #endif	/* SUNW_OVERRIDE_RETRY */
36 	char				inet_nsap_ntoa_tmpbuf[255*3];
37 	char				sym_ntos_unname[20];
38 	char				sym_ntop_unname[20];
39 	char				p_option_nbuf[40];
40 	char				p_time_nbuf[40];
41 	char				precsize_ntoa_retbuf[sizeof "90000000.00"];
42 	char				loc_ntoa_tmpbuf[sizeof
43 "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
44 	char				p_secstodate_output[15];
45 } mtctxres_t;
46 
47 /* Thread-specific data (TSD) */
48 
49 extern mtctxres_t			*___mtctxres();
50 #define	mtctxres			(___mtctxres())
51 
52 /* Various static data that should be TSD */
53 
54 #define	sym_ntos_unname			(mtctxres->sym_ntos_unname)
55 #define	sym_ntop_unname			(mtctxres->sym_ntop_unname)
56 #define	inet_nsap_ntoa_tmpbuf		(mtctxres->inet_nsap_ntoa_tmpbuf)
57 #define	p_option_nbuf			(mtctxres->p_option_nbuf)
58 #define	p_time_nbuf			(mtctxres->p_time_nbuf)
59 #define	precsize_ntoa_retbuf		(mtctxres->precsize_ntoa_retbuf)
60 #define	loc_ntoa_tmpbuf			(mtctxres->loc_ntoa_tmpbuf)
61 #define	p_secstodate_output		(mtctxres->p_secstodate_output)
62 
63 #endif /* SUNW_MT_RESOLVER */
64 
65 #ifdef	__cplusplus
66 }
67 #endif
68 
69 #endif /* _RESOLV_MT_H */
70