summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/include/resolv_mt.h
blob: e26fd18f02898a76b518d8d291991fa008e92922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
 */

#ifndef	_RESOLV_MT_H
#define	_RESOLV_MT_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

#ifdef	SUNW_MT_RESOLVER

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

/* Access functions for the libresolv private interface */

int			__res_enable_mt(void);
int			__res_disable_mt(void);

/* Per-thread context */

typedef struct {
#ifdef SUNW_HOSTS_FALLBACK
	int				no_hosts_fallback_private;
#endif /* SUNW_HOSTS_FALLBACK */
#ifdef	SUNW_OVERRIDE_RETRY
	int				retry_save;
	int				retry_private;
#endif	/* SUNW_OVERRIDE_RETRY */
	char				inet_nsap_ntoa_tmpbuf[255*3];
	char				sym_ntos_unname[20];
	char				sym_ntop_unname[20];
	char				p_option_nbuf[40];
	char				p_time_nbuf[40];
	char				precsize_ntoa_retbuf[sizeof "90000000.00"];
	char				loc_ntoa_tmpbuf[sizeof
"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
	char				p_secstodate_output[15];
} mtctxres_t;

/* Thread-specific data (TSD) */

extern mtctxres_t			*___mtctxres();
#define	mtctxres			(___mtctxres())

/* Various static data that should be TSD */

#define	sym_ntos_unname			(mtctxres->sym_ntos_unname)
#define	sym_ntop_unname			(mtctxres->sym_ntop_unname)
#define	inet_nsap_ntoa_tmpbuf		(mtctxres->inet_nsap_ntoa_tmpbuf)
#define	p_option_nbuf			(mtctxres->p_option_nbuf)
#define	p_time_nbuf			(mtctxres->p_time_nbuf)
#define	precsize_ntoa_retbuf		(mtctxres->precsize_ntoa_retbuf)
#define	loc_ntoa_tmpbuf			(mtctxres->loc_ntoa_tmpbuf)
#define	p_secstodate_output		(mtctxres->p_secstodate_output)

#endif /* SUNW_MT_RESOLVER */

#ifdef	__cplusplus
}
#endif

#endif /* _RESOLV_MT_H */