xref: /netbsd-src/lib/libc/include/resolv_mt.h (revision c6497e5b5fd6f3aacf9040dabb7d54cbfb35a2e1)
1*c6497e5bSchristos /*	$NetBSD: resolv_mt.h,v 1.1.1.3 2009/04/12 16:35:44 christos Exp $	*/
295177770Schristos 
395177770Schristos #ifndef _RESOLV_MT_H
495177770Schristos #define _RESOLV_MT_H
595177770Schristos 
695177770Schristos #include <sys/types.h>
795177770Schristos #include <netinet/in.h>
895177770Schristos #include <arpa/nameser.h>
995177770Schristos #include <resolv.h>
1095177770Schristos 
1195177770Schristos /* Access functions for the libresolv private interface */
1295177770Schristos 
1395177770Schristos int	__res_enable_mt(void);
1495177770Schristos int	__res_disable_mt(void);
1595177770Schristos 
1695177770Schristos /* Per-thread context */
1795177770Schristos 
1895177770Schristos typedef struct {
1995177770Schristos int	no_hosts_fallback_private;
2095177770Schristos int	retry_save;
2195177770Schristos int	retry_private;
2295177770Schristos char	inet_nsap_ntoa_tmpbuf[255*3];
2395177770Schristos char	sym_ntos_unname[20];
2495177770Schristos char	sym_ntop_unname[20];
2595177770Schristos char	p_option_nbuf[40];
2695177770Schristos char	p_time_nbuf[40];
2795177770Schristos char	precsize_ntoa_retbuf[sizeof "90000000.00"];
2895177770Schristos char	loc_ntoa_tmpbuf[sizeof
2995177770Schristos "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
3095177770Schristos char	p_secstodate_output[15];
3195177770Schristos } mtctxres_t;
3295177770Schristos 
3395177770Schristos /* Thread-specific data (TSD) */
3495177770Schristos 
3595177770Schristos mtctxres_t	*___mtctxres(void);
3695177770Schristos #define mtctxres	(___mtctxres())
3795177770Schristos 
3895177770Schristos /* Various static data that should be TSD */
3995177770Schristos 
4095177770Schristos #define sym_ntos_unname		(mtctxres->sym_ntos_unname)
4195177770Schristos #define sym_ntop_unname		(mtctxres->sym_ntop_unname)
4295177770Schristos #define inet_nsap_ntoa_tmpbuf	(mtctxres->inet_nsap_ntoa_tmpbuf)
4395177770Schristos #define p_option_nbuf		(mtctxres->p_option_nbuf)
4495177770Schristos #define p_time_nbuf		(mtctxres->p_time_nbuf)
4595177770Schristos #define precsize_ntoa_retbuf	(mtctxres->precsize_ntoa_retbuf)
4695177770Schristos #define loc_ntoa_tmpbuf		(mtctxres->loc_ntoa_tmpbuf)
4795177770Schristos #define p_secstodate_output	(mtctxres->p_secstodate_output)
4895177770Schristos 
4995177770Schristos #endif /* _RESOLV_MT_H */
50