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