xref: /titanic_41/usr/src/lib/libresolv2/include/resolv_mt.h (revision 42cac157f878fbb7ae190eb0339c6932f3192b87)
1 #ifndef _RESOLV_MT_H
2 #define _RESOLV_MT_H
3 
4 #include <sys/types.h>
5 #include <netinet/in.h>
6 #include <arpa/nameser.h>
7 #include <resolv.h>
8 
9 /* Access functions for the libresolv private interface */
10 
11 int	__res_enable_mt(void);
12 int	__res_disable_mt(void);
13 
14 /* Per-thread context */
15 
16 typedef struct {
17 int	no_hosts_fallback_private;
18 int	retry_save;
19 int	retry_private;
20 char	inet_nsap_ntoa_tmpbuf[255*3];
21 char	sym_ntos_unname[20];
22 char	sym_ntop_unname[20];
23 char	p_option_nbuf[40];
24 char	p_time_nbuf[40];
25 char	precsize_ntoa_retbuf[sizeof "90000000.00"];
26 char	loc_ntoa_tmpbuf[sizeof
27 "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
28 char	p_secstodate_output[15];
29 } mtctxres_t;
30 
31 /* Thread-specific data (TSD) */
32 
33 mtctxres_t	*___mtctxres(void);
34 #define mtctxres	(___mtctxres())
35 
36 /* Various static data that should be TSD */
37 
38 #define sym_ntos_unname		(mtctxres->sym_ntos_unname)
39 #define sym_ntop_unname		(mtctxres->sym_ntop_unname)
40 #define inet_nsap_ntoa_tmpbuf	(mtctxres->inet_nsap_ntoa_tmpbuf)
41 #define p_option_nbuf		(mtctxres->p_option_nbuf)
42 #define p_time_nbuf		(mtctxres->p_time_nbuf)
43 #define precsize_ntoa_retbuf	(mtctxres->precsize_ntoa_retbuf)
44 #define loc_ntoa_tmpbuf		(mtctxres->loc_ntoa_tmpbuf)
45 #define p_secstodate_output	(mtctxres->p_secstodate_output)
46 
47 #endif /* _RESOLV_MT_H */
48