xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/reentr.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  *    reentr.h
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  *    Copyright (C) 2002, 2003, by Larry Wall and others
5*0Sstevel@tonic-gate  *
6*0Sstevel@tonic-gate  *    You may distribute under the terms of either the GNU General Public
7*0Sstevel@tonic-gate  *    License or the Artistic License, as specified in the README file.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  *  !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
10*0Sstevel@tonic-gate  *  This file is built by reentrl.pl from data in reentr.pl.
11*0Sstevel@tonic-gate  */
12*0Sstevel@tonic-gate 
13*0Sstevel@tonic-gate #ifndef REENTR_H
14*0Sstevel@tonic-gate #define REENTR_H
15*0Sstevel@tonic-gate 
16*0Sstevel@tonic-gate #ifdef USE_REENTRANT_API
17*0Sstevel@tonic-gate 
18*0Sstevel@tonic-gate #ifdef PERL_CORE
19*0Sstevel@tonic-gate #   define PL_REENTRANT_RETINT PL_reentrant_retint
20*0Sstevel@tonic-gate #endif
21*0Sstevel@tonic-gate 
22*0Sstevel@tonic-gate /* Deprecations: some platforms have the said reentrant interfaces
23*0Sstevel@tonic-gate  * but they are declared obsolete and are not to be used.  Often this
24*0Sstevel@tonic-gate  * means that the platform has threadsafed the interfaces (hopefully).
25*0Sstevel@tonic-gate  * All this is OS version dependent, so we are of course fooling ourselves.
26*0Sstevel@tonic-gate  * If you know of more deprecations on some platforms, please add your own. */
27*0Sstevel@tonic-gate 
28*0Sstevel@tonic-gate #ifdef __hpux
29*0Sstevel@tonic-gate #   undef HAS_CRYPT_R
30*0Sstevel@tonic-gate #   undef HAS_DRAND48_R
31*0Sstevel@tonic-gate #   undef HAS_ENDGRENT_R
32*0Sstevel@tonic-gate #   undef HAS_ENDPWENT_R
33*0Sstevel@tonic-gate #   undef HAS_GETGRENT_R
34*0Sstevel@tonic-gate #   undef HAS_GETPWENT_R
35*0Sstevel@tonic-gate #   undef HAS_SETLOCALE_R
36*0Sstevel@tonic-gate #   undef HAS_SRAND48_R
37*0Sstevel@tonic-gate #   undef HAS_STRERROR_R
38*0Sstevel@tonic-gate #   define NETDB_R_OBSOLETE
39*0Sstevel@tonic-gate #endif
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate #if defined(__osf__) && defined(__alpha) /* Tru64 aka Digital UNIX */
42*0Sstevel@tonic-gate #   undef HAS_CRYPT_R
43*0Sstevel@tonic-gate #   undef HAS_STRERROR_R
44*0Sstevel@tonic-gate #   define NETDB_R_OBSOLETE
45*0Sstevel@tonic-gate #endif
46*0Sstevel@tonic-gate 
47*0Sstevel@tonic-gate #ifdef NETDB_R_OBSOLETE
48*0Sstevel@tonic-gate #   undef HAS_ENDHOSTENT_R
49*0Sstevel@tonic-gate #   undef HAS_ENDNETENT_R
50*0Sstevel@tonic-gate #   undef HAS_ENDPROTOENT_R
51*0Sstevel@tonic-gate #   undef HAS_ENDSERVENT_R
52*0Sstevel@tonic-gate #   undef HAS_GETHOSTBYADDR_R
53*0Sstevel@tonic-gate #   undef HAS_GETHOSTBYNAME_R
54*0Sstevel@tonic-gate #   undef HAS_GETHOSTENT_R
55*0Sstevel@tonic-gate #   undef HAS_GETNETBYADDR_R
56*0Sstevel@tonic-gate #   undef HAS_GETNETBYNAME_R
57*0Sstevel@tonic-gate #   undef HAS_GETNETENT_R
58*0Sstevel@tonic-gate #   undef HAS_GETPROTOBYNAME_R
59*0Sstevel@tonic-gate #   undef HAS_GETPROTOBYNUMBER_R
60*0Sstevel@tonic-gate #   undef HAS_GETPROTOENT_R
61*0Sstevel@tonic-gate #   undef HAS_GETSERVBYNAME_R
62*0Sstevel@tonic-gate #   undef HAS_GETSERVBYPORT_R
63*0Sstevel@tonic-gate #   undef HAS_GETSERVENT_R
64*0Sstevel@tonic-gate #   undef HAS_SETHOSTENT_R
65*0Sstevel@tonic-gate #   undef HAS_SETNETENT_R
66*0Sstevel@tonic-gate #   undef HAS_SETPROTOENT_R
67*0Sstevel@tonic-gate #   undef HAS_SETSERVENT_R
68*0Sstevel@tonic-gate #endif
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate #ifdef I_PWD
71*0Sstevel@tonic-gate #   include <pwd.h>
72*0Sstevel@tonic-gate #endif
73*0Sstevel@tonic-gate #ifdef I_GRP
74*0Sstevel@tonic-gate #   include <grp.h>
75*0Sstevel@tonic-gate #endif
76*0Sstevel@tonic-gate #ifdef I_NETDB
77*0Sstevel@tonic-gate #   include <netdb.h>
78*0Sstevel@tonic-gate #endif
79*0Sstevel@tonic-gate #ifdef I_STDLIB
80*0Sstevel@tonic-gate #   include <stdlib.h>	/* drand48_data */
81*0Sstevel@tonic-gate #endif
82*0Sstevel@tonic-gate #ifdef I_CRYPT
83*0Sstevel@tonic-gate #   ifdef I_CRYPT
84*0Sstevel@tonic-gate #       include <crypt.h>
85*0Sstevel@tonic-gate #   endif
86*0Sstevel@tonic-gate #endif
87*0Sstevel@tonic-gate #ifdef HAS_GETSPNAM_R
88*0Sstevel@tonic-gate #   ifdef I_SHADOW
89*0Sstevel@tonic-gate #       include <shadow.h>
90*0Sstevel@tonic-gate #   endif
91*0Sstevel@tonic-gate #endif
92*0Sstevel@tonic-gate 
93*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_B	1
94*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_BI	2
95*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_BW	3
96*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_CCD	4
97*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_CCS	5
98*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_IBI	6
99*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_IBW	7
100*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_SB	8
101*0Sstevel@tonic-gate #define REENTRANT_PROTO_B_SBI	9
102*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_BI	10
103*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_BW	11
104*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CCSBWR	12
105*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CCSD	13
106*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CII	14
107*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CIISD	15
108*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CSBI	16
109*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CSBIR	17
110*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CSBWR	18
111*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CSBWRE	19
112*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CSD	20
113*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CWISBWRE	21
114*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_CWISD	22
115*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_D	23
116*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_H	24
117*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_IBI	25
118*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_IBW	26
119*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ICBI	27
120*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ICSBWR	28
121*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ICSD	29
122*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ID	30
123*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_IISD	31
124*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ISBWR	32
125*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ISD	33
126*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_LISBI	34
127*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_LISD	35
128*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_LS	36
129*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SB	37
130*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBI	38
131*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBIE	39
132*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBIH	40
133*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBIR	41
134*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBWR	42
135*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SBWRE	43
136*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_SD	44
137*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_ST	45
138*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_St	46
139*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TISD	47
140*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TS	48
141*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TSBI	49
142*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TSBIR	50
143*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TSBWR	51
144*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TSR	52
145*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_TsISBWRE	53
146*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_UISBWRE	54
147*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_iS	55
148*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_lS	56
149*0Sstevel@tonic-gate #define REENTRANT_PROTO_I_uISBWRE	57
150*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CBI	58
151*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CCSBI	59
152*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CIISBIE	60
153*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CSBI	61
154*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CSBIE	62
155*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CWISBIE	63
156*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_CWISBWIE	64
157*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_ICSBI	65
158*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_ISBI	66
159*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_LISBI	67
160*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_SBI	68
161*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_SBIE	69
162*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_SBW	70
163*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_TISBI	71
164*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_TS	72
165*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_TSBI	73
166*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_TSBIE	74
167*0Sstevel@tonic-gate #define REENTRANT_PROTO_S_TWISBIE	75
168*0Sstevel@tonic-gate #define REENTRANT_PROTO_V_D	76
169*0Sstevel@tonic-gate #define REENTRANT_PROTO_V_H	77
170*0Sstevel@tonic-gate #define REENTRANT_PROTO_V_ID	78
171*0Sstevel@tonic-gate 
172*0Sstevel@tonic-gate /* Defines for indicating which special features are supported. */
173*0Sstevel@tonic-gate 
174*0Sstevel@tonic-gate /* The getgrent getgrgid getgrnam using buffer? */
175*0Sstevel@tonic-gate 
176*0Sstevel@tonic-gate #if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR || GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW || GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
177*0Sstevel@tonic-gate #   define GETGRENT_R_HAS_BUFFER
178*0Sstevel@tonic-gate #else
179*0Sstevel@tonic-gate #   undef  GETGRENT_R_HAS_BUFFER
180*0Sstevel@tonic-gate #endif
181*0Sstevel@tonic-gate #if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI || GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI)
182*0Sstevel@tonic-gate #   define GETGRGID_R_HAS_BUFFER
183*0Sstevel@tonic-gate #else
184*0Sstevel@tonic-gate #   undef  GETGRGID_R_HAS_BUFFER
185*0Sstevel@tonic-gate #endif
186*0Sstevel@tonic-gate #if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR || GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI || GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI)
187*0Sstevel@tonic-gate #   define GETGRNAM_R_HAS_BUFFER
188*0Sstevel@tonic-gate #else
189*0Sstevel@tonic-gate #   undef  GETGRNAM_R_HAS_BUFFER
190*0Sstevel@tonic-gate #endif
191*0Sstevel@tonic-gate 
192*0Sstevel@tonic-gate /* Any of the getgrent getgrgid getgrnam using buffer? */
193*0Sstevel@tonic-gate 
194*0Sstevel@tonic-gate #if (defined(GETGRENT_R_HAS_BUFFER) || defined(GETGRGID_R_HAS_BUFFER) || defined(GETGRNAM_R_HAS_BUFFER))
195*0Sstevel@tonic-gate #   define USE_GRENT_BUFFER
196*0Sstevel@tonic-gate #else
197*0Sstevel@tonic-gate #   undef  USE_GRENT_BUFFER
198*0Sstevel@tonic-gate #endif
199*0Sstevel@tonic-gate 
200*0Sstevel@tonic-gate /* The getgrent getgrgid getgrnam using ptr? */
201*0Sstevel@tonic-gate 
202*0Sstevel@tonic-gate #if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
203*0Sstevel@tonic-gate #   define GETGRENT_R_HAS_PTR
204*0Sstevel@tonic-gate #else
205*0Sstevel@tonic-gate #   undef  GETGRENT_R_HAS_PTR
206*0Sstevel@tonic-gate #endif
207*0Sstevel@tonic-gate #if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
208*0Sstevel@tonic-gate #   define GETGRGID_R_HAS_PTR
209*0Sstevel@tonic-gate #else
210*0Sstevel@tonic-gate #   undef  GETGRGID_R_HAS_PTR
211*0Sstevel@tonic-gate #endif
212*0Sstevel@tonic-gate #if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
213*0Sstevel@tonic-gate #   define GETGRNAM_R_HAS_PTR
214*0Sstevel@tonic-gate #else
215*0Sstevel@tonic-gate #   undef  GETGRNAM_R_HAS_PTR
216*0Sstevel@tonic-gate #endif
217*0Sstevel@tonic-gate 
218*0Sstevel@tonic-gate /* Any of the getgrent getgrgid getgrnam using ptr? */
219*0Sstevel@tonic-gate 
220*0Sstevel@tonic-gate #if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
221*0Sstevel@tonic-gate #   define USE_GRENT_PTR
222*0Sstevel@tonic-gate #else
223*0Sstevel@tonic-gate #   undef  USE_GRENT_PTR
224*0Sstevel@tonic-gate #endif
225*0Sstevel@tonic-gate 
226*0Sstevel@tonic-gate /* The getpwent getpwnam getpwuid using ptr? */
227*0Sstevel@tonic-gate 
228*0Sstevel@tonic-gate #if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
229*0Sstevel@tonic-gate #   define GETPWENT_R_HAS_PTR
230*0Sstevel@tonic-gate #else
231*0Sstevel@tonic-gate #   undef  GETPWENT_R_HAS_PTR
232*0Sstevel@tonic-gate #endif
233*0Sstevel@tonic-gate #if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
234*0Sstevel@tonic-gate #   define GETPWNAM_R_HAS_PTR
235*0Sstevel@tonic-gate #else
236*0Sstevel@tonic-gate #   undef  GETPWNAM_R_HAS_PTR
237*0Sstevel@tonic-gate #endif
238*0Sstevel@tonic-gate #if defined(HAS_GETPWUID_R) && (GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
239*0Sstevel@tonic-gate #   define GETPWUID_R_HAS_PTR
240*0Sstevel@tonic-gate #else
241*0Sstevel@tonic-gate #   undef  GETPWUID_R_HAS_PTR
242*0Sstevel@tonic-gate #endif
243*0Sstevel@tonic-gate 
244*0Sstevel@tonic-gate /* Any of the getpwent getpwnam getpwuid using ptr? */
245*0Sstevel@tonic-gate 
246*0Sstevel@tonic-gate #if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
247*0Sstevel@tonic-gate #   define USE_PWENT_PTR
248*0Sstevel@tonic-gate #else
249*0Sstevel@tonic-gate #   undef  USE_PWENT_PTR
250*0Sstevel@tonic-gate #endif
251*0Sstevel@tonic-gate 
252*0Sstevel@tonic-gate /* The getspent getspnam using ptr? */
253*0Sstevel@tonic-gate 
254*0Sstevel@tonic-gate #if defined(HAS_GETSPNAM_R) && (GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR)
255*0Sstevel@tonic-gate #   define GETSPNAM_R_HAS_PTR
256*0Sstevel@tonic-gate #else
257*0Sstevel@tonic-gate #   undef  GETSPNAM_R_HAS_PTR
258*0Sstevel@tonic-gate #endif
259*0Sstevel@tonic-gate 
260*0Sstevel@tonic-gate /* Any of the getspent getspnam using ptr? */
261*0Sstevel@tonic-gate 
262*0Sstevel@tonic-gate #if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
263*0Sstevel@tonic-gate #   define USE_SPENT_PTR
264*0Sstevel@tonic-gate #else
265*0Sstevel@tonic-gate #   undef  USE_SPENT_PTR
266*0Sstevel@tonic-gate #endif
267*0Sstevel@tonic-gate 
268*0Sstevel@tonic-gate /* The getgrent getgrgid getgrnam setgrent endgrent using fptr? */
269*0Sstevel@tonic-gate 
270*0Sstevel@tonic-gate #if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
271*0Sstevel@tonic-gate #   define GETGRENT_R_HAS_FPTR
272*0Sstevel@tonic-gate #else
273*0Sstevel@tonic-gate #   undef  GETGRENT_R_HAS_FPTR
274*0Sstevel@tonic-gate #endif
275*0Sstevel@tonic-gate #if defined(HAS_SETGRENT_R) && (SETGRENT_R_PROTO == REENTRANT_PROTO_I_H || SETGRENT_R_PROTO == REENTRANT_PROTO_V_H)
276*0Sstevel@tonic-gate #   define SETGRENT_R_HAS_FPTR
277*0Sstevel@tonic-gate #else
278*0Sstevel@tonic-gate #   undef  SETGRENT_R_HAS_FPTR
279*0Sstevel@tonic-gate #endif
280*0Sstevel@tonic-gate #if defined(HAS_ENDGRENT_R) && (ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H || ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H)
281*0Sstevel@tonic-gate #   define ENDGRENT_R_HAS_FPTR
282*0Sstevel@tonic-gate #else
283*0Sstevel@tonic-gate #   undef  ENDGRENT_R_HAS_FPTR
284*0Sstevel@tonic-gate #endif
285*0Sstevel@tonic-gate 
286*0Sstevel@tonic-gate /* Any of the getgrent getgrgid getgrnam setgrent endgrent using fptr? */
287*0Sstevel@tonic-gate 
288*0Sstevel@tonic-gate #if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR) || defined(SETGRENT_R_HAS_FPTR) || defined(ENDGRENT_R_HAS_FPTR))
289*0Sstevel@tonic-gate #   define USE_GRENT_FPTR
290*0Sstevel@tonic-gate #else
291*0Sstevel@tonic-gate #   undef  USE_GRENT_FPTR
292*0Sstevel@tonic-gate #endif
293*0Sstevel@tonic-gate 
294*0Sstevel@tonic-gate /* The getpwent getpwnam getpwuid setpwent endpwent using fptr? */
295*0Sstevel@tonic-gate 
296*0Sstevel@tonic-gate #if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
297*0Sstevel@tonic-gate #   define GETPWENT_R_HAS_FPTR
298*0Sstevel@tonic-gate #else
299*0Sstevel@tonic-gate #   undef  GETPWENT_R_HAS_FPTR
300*0Sstevel@tonic-gate #endif
301*0Sstevel@tonic-gate #if defined(HAS_SETPWENT_R) && (SETPWENT_R_PROTO == REENTRANT_PROTO_I_H || SETPWENT_R_PROTO == REENTRANT_PROTO_V_H)
302*0Sstevel@tonic-gate #   define SETPWENT_R_HAS_FPTR
303*0Sstevel@tonic-gate #else
304*0Sstevel@tonic-gate #   undef  SETPWENT_R_HAS_FPTR
305*0Sstevel@tonic-gate #endif
306*0Sstevel@tonic-gate #if defined(HAS_ENDPWENT_R) && (ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H || ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H)
307*0Sstevel@tonic-gate #   define ENDPWENT_R_HAS_FPTR
308*0Sstevel@tonic-gate #else
309*0Sstevel@tonic-gate #   undef  ENDPWENT_R_HAS_FPTR
310*0Sstevel@tonic-gate #endif
311*0Sstevel@tonic-gate 
312*0Sstevel@tonic-gate /* Any of the getpwent getpwnam getpwuid setpwent endpwent using fptr? */
313*0Sstevel@tonic-gate 
314*0Sstevel@tonic-gate #if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR) || defined(SETPWENT_R_HAS_FPTR) || defined(ENDPWENT_R_HAS_FPTR))
315*0Sstevel@tonic-gate #   define USE_PWENT_FPTR
316*0Sstevel@tonic-gate #else
317*0Sstevel@tonic-gate #   undef  USE_PWENT_FPTR
318*0Sstevel@tonic-gate #endif
319*0Sstevel@tonic-gate 
320*0Sstevel@tonic-gate /* The getpwent getpwgid getpwnam using buffer? */
321*0Sstevel@tonic-gate 
322*0Sstevel@tonic-gate #if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR || GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW || GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
323*0Sstevel@tonic-gate #   define GETPWENT_R_HAS_BUFFER
324*0Sstevel@tonic-gate #else
325*0Sstevel@tonic-gate #   undef  GETPWENT_R_HAS_BUFFER
326*0Sstevel@tonic-gate #endif
327*0Sstevel@tonic-gate #if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR || GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI)
328*0Sstevel@tonic-gate #   define GETPWNAM_R_HAS_BUFFER
329*0Sstevel@tonic-gate #else
330*0Sstevel@tonic-gate #   undef  GETPWNAM_R_HAS_BUFFER
331*0Sstevel@tonic-gate #endif
332*0Sstevel@tonic-gate 
333*0Sstevel@tonic-gate /* Any of the getpwent getpwgid getpwnam using buffer? */
334*0Sstevel@tonic-gate 
335*0Sstevel@tonic-gate #if (defined(GETPWENT_R_HAS_BUFFER) || defined(GETPWGID_R_HAS_BUFFER) || defined(GETPWNAM_R_HAS_BUFFER))
336*0Sstevel@tonic-gate #   define USE_PWENT_BUFFER
337*0Sstevel@tonic-gate #else
338*0Sstevel@tonic-gate #   undef  USE_PWENT_BUFFER
339*0Sstevel@tonic-gate #endif
340*0Sstevel@tonic-gate 
341*0Sstevel@tonic-gate /* The gethostent gethostbyaddr gethostbyname using ptr? */
342*0Sstevel@tonic-gate 
343*0Sstevel@tonic-gate #if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
344*0Sstevel@tonic-gate #   define GETHOSTENT_R_HAS_PTR
345*0Sstevel@tonic-gate #else
346*0Sstevel@tonic-gate #   undef  GETHOSTENT_R_HAS_PTR
347*0Sstevel@tonic-gate #endif
348*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
349*0Sstevel@tonic-gate #   define GETHOSTBYADDR_R_HAS_PTR
350*0Sstevel@tonic-gate #else
351*0Sstevel@tonic-gate #   undef  GETHOSTBYADDR_R_HAS_PTR
352*0Sstevel@tonic-gate #endif
353*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
354*0Sstevel@tonic-gate #   define GETHOSTBYNAME_R_HAS_PTR
355*0Sstevel@tonic-gate #else
356*0Sstevel@tonic-gate #   undef  GETHOSTBYNAME_R_HAS_PTR
357*0Sstevel@tonic-gate #endif
358*0Sstevel@tonic-gate 
359*0Sstevel@tonic-gate /* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
360*0Sstevel@tonic-gate 
361*0Sstevel@tonic-gate #if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
362*0Sstevel@tonic-gate #   define USE_HOSTENT_PTR
363*0Sstevel@tonic-gate #else
364*0Sstevel@tonic-gate #   undef  USE_HOSTENT_PTR
365*0Sstevel@tonic-gate #endif
366*0Sstevel@tonic-gate 
367*0Sstevel@tonic-gate /* The getnetent getnetbyaddr getnetbyname using ptr? */
368*0Sstevel@tonic-gate 
369*0Sstevel@tonic-gate #if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
370*0Sstevel@tonic-gate #   define GETNETENT_R_HAS_PTR
371*0Sstevel@tonic-gate #else
372*0Sstevel@tonic-gate #   undef  GETNETENT_R_HAS_PTR
373*0Sstevel@tonic-gate #endif
374*0Sstevel@tonic-gate #if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
375*0Sstevel@tonic-gate #   define GETNETBYADDR_R_HAS_PTR
376*0Sstevel@tonic-gate #else
377*0Sstevel@tonic-gate #   undef  GETNETBYADDR_R_HAS_PTR
378*0Sstevel@tonic-gate #endif
379*0Sstevel@tonic-gate #if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
380*0Sstevel@tonic-gate #   define GETNETBYNAME_R_HAS_PTR
381*0Sstevel@tonic-gate #else
382*0Sstevel@tonic-gate #   undef  GETNETBYNAME_R_HAS_PTR
383*0Sstevel@tonic-gate #endif
384*0Sstevel@tonic-gate 
385*0Sstevel@tonic-gate /* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
386*0Sstevel@tonic-gate 
387*0Sstevel@tonic-gate #if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
388*0Sstevel@tonic-gate #   define USE_NETENT_PTR
389*0Sstevel@tonic-gate #else
390*0Sstevel@tonic-gate #   undef  USE_NETENT_PTR
391*0Sstevel@tonic-gate #endif
392*0Sstevel@tonic-gate 
393*0Sstevel@tonic-gate /* The getprotoent getprotobyname getprotobynumber using ptr? */
394*0Sstevel@tonic-gate 
395*0Sstevel@tonic-gate #if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
396*0Sstevel@tonic-gate #   define GETPROTOENT_R_HAS_PTR
397*0Sstevel@tonic-gate #else
398*0Sstevel@tonic-gate #   undef  GETPROTOENT_R_HAS_PTR
399*0Sstevel@tonic-gate #endif
400*0Sstevel@tonic-gate #if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
401*0Sstevel@tonic-gate #   define GETPROTOBYNAME_R_HAS_PTR
402*0Sstevel@tonic-gate #else
403*0Sstevel@tonic-gate #   undef  GETPROTOBYNAME_R_HAS_PTR
404*0Sstevel@tonic-gate #endif
405*0Sstevel@tonic-gate #if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
406*0Sstevel@tonic-gate #   define GETPROTOBYNUMBER_R_HAS_PTR
407*0Sstevel@tonic-gate #else
408*0Sstevel@tonic-gate #   undef  GETPROTOBYNUMBER_R_HAS_PTR
409*0Sstevel@tonic-gate #endif
410*0Sstevel@tonic-gate 
411*0Sstevel@tonic-gate /* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
412*0Sstevel@tonic-gate 
413*0Sstevel@tonic-gate #if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
414*0Sstevel@tonic-gate #   define USE_PROTOENT_PTR
415*0Sstevel@tonic-gate #else
416*0Sstevel@tonic-gate #   undef  USE_PROTOENT_PTR
417*0Sstevel@tonic-gate #endif
418*0Sstevel@tonic-gate 
419*0Sstevel@tonic-gate /* The getservent getservbyname getservbyport using ptr? */
420*0Sstevel@tonic-gate 
421*0Sstevel@tonic-gate #if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
422*0Sstevel@tonic-gate #   define GETSERVENT_R_HAS_PTR
423*0Sstevel@tonic-gate #else
424*0Sstevel@tonic-gate #   undef  GETSERVENT_R_HAS_PTR
425*0Sstevel@tonic-gate #endif
426*0Sstevel@tonic-gate #if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
427*0Sstevel@tonic-gate #   define GETSERVBYNAME_R_HAS_PTR
428*0Sstevel@tonic-gate #else
429*0Sstevel@tonic-gate #   undef  GETSERVBYNAME_R_HAS_PTR
430*0Sstevel@tonic-gate #endif
431*0Sstevel@tonic-gate #if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
432*0Sstevel@tonic-gate #   define GETSERVBYPORT_R_HAS_PTR
433*0Sstevel@tonic-gate #else
434*0Sstevel@tonic-gate #   undef  GETSERVBYPORT_R_HAS_PTR
435*0Sstevel@tonic-gate #endif
436*0Sstevel@tonic-gate 
437*0Sstevel@tonic-gate /* Any of the getservent getservbyname getservbyport using ptr? */
438*0Sstevel@tonic-gate 
439*0Sstevel@tonic-gate #if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
440*0Sstevel@tonic-gate #   define USE_SERVENT_PTR
441*0Sstevel@tonic-gate #else
442*0Sstevel@tonic-gate #   undef  USE_SERVENT_PTR
443*0Sstevel@tonic-gate #endif
444*0Sstevel@tonic-gate 
445*0Sstevel@tonic-gate /* The gethostent gethostbyaddr gethostbyname using buffer? */
446*0Sstevel@tonic-gate 
447*0Sstevel@tonic-gate #if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI)
448*0Sstevel@tonic-gate #   define GETHOSTENT_R_HAS_BUFFER
449*0Sstevel@tonic-gate #else
450*0Sstevel@tonic-gate #   undef  GETHOSTENT_R_HAS_BUFFER
451*0Sstevel@tonic-gate #endif
452*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
453*0Sstevel@tonic-gate #   define GETHOSTBYADDR_R_HAS_BUFFER
454*0Sstevel@tonic-gate #else
455*0Sstevel@tonic-gate #   undef  GETHOSTBYADDR_R_HAS_BUFFER
456*0Sstevel@tonic-gate #endif
457*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
458*0Sstevel@tonic-gate #   define GETHOSTBYNAME_R_HAS_BUFFER
459*0Sstevel@tonic-gate #else
460*0Sstevel@tonic-gate #   undef  GETHOSTBYNAME_R_HAS_BUFFER
461*0Sstevel@tonic-gate #endif
462*0Sstevel@tonic-gate 
463*0Sstevel@tonic-gate /* Any of the gethostent gethostbyaddr gethostbyname using buffer? */
464*0Sstevel@tonic-gate 
465*0Sstevel@tonic-gate #if (defined(GETHOSTENT_R_HAS_BUFFER) || defined(GETHOSTBYADDR_R_HAS_BUFFER) || defined(GETHOSTBYNAME_R_HAS_BUFFER))
466*0Sstevel@tonic-gate #   define USE_HOSTENT_BUFFER
467*0Sstevel@tonic-gate #else
468*0Sstevel@tonic-gate #   undef  USE_HOSTENT_BUFFER
469*0Sstevel@tonic-gate #endif
470*0Sstevel@tonic-gate 
471*0Sstevel@tonic-gate /* The getnetent getnetbyaddr getnetbyname using buffer? */
472*0Sstevel@tonic-gate 
473*0Sstevel@tonic-gate #if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE || GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI)
474*0Sstevel@tonic-gate #   define GETNETENT_R_HAS_BUFFER
475*0Sstevel@tonic-gate #else
476*0Sstevel@tonic-gate #   undef  GETNETENT_R_HAS_BUFFER
477*0Sstevel@tonic-gate #endif
478*0Sstevel@tonic-gate #if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
479*0Sstevel@tonic-gate #   define GETNETBYADDR_R_HAS_BUFFER
480*0Sstevel@tonic-gate #else
481*0Sstevel@tonic-gate #   undef  GETNETBYADDR_R_HAS_BUFFER
482*0Sstevel@tonic-gate #endif
483*0Sstevel@tonic-gate #if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI || GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
484*0Sstevel@tonic-gate #   define GETNETBYNAME_R_HAS_BUFFER
485*0Sstevel@tonic-gate #else
486*0Sstevel@tonic-gate #   undef  GETNETBYNAME_R_HAS_BUFFER
487*0Sstevel@tonic-gate #endif
488*0Sstevel@tonic-gate 
489*0Sstevel@tonic-gate /* Any of the getnetent getnetbyaddr getnetbyname using buffer? */
490*0Sstevel@tonic-gate 
491*0Sstevel@tonic-gate #if (defined(GETNETENT_R_HAS_BUFFER) || defined(GETNETBYADDR_R_HAS_BUFFER) || defined(GETNETBYNAME_R_HAS_BUFFER))
492*0Sstevel@tonic-gate #   define USE_NETENT_BUFFER
493*0Sstevel@tonic-gate #else
494*0Sstevel@tonic-gate #   undef  USE_NETENT_BUFFER
495*0Sstevel@tonic-gate #endif
496*0Sstevel@tonic-gate 
497*0Sstevel@tonic-gate /* The getprotoent getprotobyname getprotobynumber using buffer? */
498*0Sstevel@tonic-gate 
499*0Sstevel@tonic-gate #if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI)
500*0Sstevel@tonic-gate #   define GETPROTOENT_R_HAS_BUFFER
501*0Sstevel@tonic-gate #else
502*0Sstevel@tonic-gate #   undef  GETPROTOENT_R_HAS_BUFFER
503*0Sstevel@tonic-gate #endif
504*0Sstevel@tonic-gate #if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
505*0Sstevel@tonic-gate #   define GETPROTOBYNAME_R_HAS_BUFFER
506*0Sstevel@tonic-gate #else
507*0Sstevel@tonic-gate #   undef  GETPROTOBYNAME_R_HAS_BUFFER
508*0Sstevel@tonic-gate #endif
509*0Sstevel@tonic-gate #if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR || GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI)
510*0Sstevel@tonic-gate #   define GETPROTOBYNUMBER_R_HAS_BUFFER
511*0Sstevel@tonic-gate #else
512*0Sstevel@tonic-gate #   undef  GETPROTOBYNUMBER_R_HAS_BUFFER
513*0Sstevel@tonic-gate #endif
514*0Sstevel@tonic-gate 
515*0Sstevel@tonic-gate /* Any of the getprotoent getprotobyname getprotobynumber using buffer? */
516*0Sstevel@tonic-gate 
517*0Sstevel@tonic-gate #if (defined(GETPROTOENT_R_HAS_BUFFER) || defined(GETPROTOBYNAME_R_HAS_BUFFER) || defined(GETPROTOBYNUMBER_R_HAS_BUFFER))
518*0Sstevel@tonic-gate #   define USE_PROTOENT_BUFFER
519*0Sstevel@tonic-gate #else
520*0Sstevel@tonic-gate #   undef  USE_PROTOENT_BUFFER
521*0Sstevel@tonic-gate #endif
522*0Sstevel@tonic-gate 
523*0Sstevel@tonic-gate /* The getservent getservbyname getservbyport using buffer? */
524*0Sstevel@tonic-gate 
525*0Sstevel@tonic-gate #if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI)
526*0Sstevel@tonic-gate #   define GETSERVENT_R_HAS_BUFFER
527*0Sstevel@tonic-gate #else
528*0Sstevel@tonic-gate #   undef  GETSERVENT_R_HAS_BUFFER
529*0Sstevel@tonic-gate #endif
530*0Sstevel@tonic-gate #if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR || GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI)
531*0Sstevel@tonic-gate #   define GETSERVBYNAME_R_HAS_BUFFER
532*0Sstevel@tonic-gate #else
533*0Sstevel@tonic-gate #   undef  GETSERVBYNAME_R_HAS_BUFFER
534*0Sstevel@tonic-gate #endif
535*0Sstevel@tonic-gate #if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR || GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI)
536*0Sstevel@tonic-gate #   define GETSERVBYPORT_R_HAS_BUFFER
537*0Sstevel@tonic-gate #else
538*0Sstevel@tonic-gate #   undef  GETSERVBYPORT_R_HAS_BUFFER
539*0Sstevel@tonic-gate #endif
540*0Sstevel@tonic-gate 
541*0Sstevel@tonic-gate /* Any of the getservent getservbyname getservbyport using buffer? */
542*0Sstevel@tonic-gate 
543*0Sstevel@tonic-gate #if (defined(GETSERVENT_R_HAS_BUFFER) || defined(GETSERVBYNAME_R_HAS_BUFFER) || defined(GETSERVBYPORT_R_HAS_BUFFER))
544*0Sstevel@tonic-gate #   define USE_SERVENT_BUFFER
545*0Sstevel@tonic-gate #else
546*0Sstevel@tonic-gate #   undef  USE_SERVENT_BUFFER
547*0Sstevel@tonic-gate #endif
548*0Sstevel@tonic-gate 
549*0Sstevel@tonic-gate /* The gethostent gethostbyaddr gethostbyname using errno? */
550*0Sstevel@tonic-gate 
551*0Sstevel@tonic-gate #if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE)
552*0Sstevel@tonic-gate #   define GETHOSTENT_R_HAS_ERRNO
553*0Sstevel@tonic-gate #else
554*0Sstevel@tonic-gate #   undef  GETHOSTENT_R_HAS_ERRNO
555*0Sstevel@tonic-gate #endif
556*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
557*0Sstevel@tonic-gate #   define GETHOSTBYADDR_R_HAS_ERRNO
558*0Sstevel@tonic-gate #else
559*0Sstevel@tonic-gate #   undef  GETHOSTBYADDR_R_HAS_ERRNO
560*0Sstevel@tonic-gate #endif
561*0Sstevel@tonic-gate #if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
562*0Sstevel@tonic-gate #   define GETHOSTBYNAME_R_HAS_ERRNO
563*0Sstevel@tonic-gate #else
564*0Sstevel@tonic-gate #   undef  GETHOSTBYNAME_R_HAS_ERRNO
565*0Sstevel@tonic-gate #endif
566*0Sstevel@tonic-gate 
567*0Sstevel@tonic-gate /* Any of the gethostent gethostbyaddr gethostbyname using errno? */
568*0Sstevel@tonic-gate 
569*0Sstevel@tonic-gate #if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
570*0Sstevel@tonic-gate #   define USE_HOSTENT_ERRNO
571*0Sstevel@tonic-gate #else
572*0Sstevel@tonic-gate #   undef  USE_HOSTENT_ERRNO
573*0Sstevel@tonic-gate #endif
574*0Sstevel@tonic-gate 
575*0Sstevel@tonic-gate /* The getnetent getnetbyaddr getnetbyname using errno? */
576*0Sstevel@tonic-gate 
577*0Sstevel@tonic-gate #if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE)
578*0Sstevel@tonic-gate #   define GETNETENT_R_HAS_ERRNO
579*0Sstevel@tonic-gate #else
580*0Sstevel@tonic-gate #   undef  GETNETENT_R_HAS_ERRNO
581*0Sstevel@tonic-gate #endif
582*0Sstevel@tonic-gate #if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
583*0Sstevel@tonic-gate #   define GETNETBYADDR_R_HAS_ERRNO
584*0Sstevel@tonic-gate #else
585*0Sstevel@tonic-gate #   undef  GETNETBYADDR_R_HAS_ERRNO
586*0Sstevel@tonic-gate #endif
587*0Sstevel@tonic-gate #if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
588*0Sstevel@tonic-gate #   define GETNETBYNAME_R_HAS_ERRNO
589*0Sstevel@tonic-gate #else
590*0Sstevel@tonic-gate #   undef  GETNETBYNAME_R_HAS_ERRNO
591*0Sstevel@tonic-gate #endif
592*0Sstevel@tonic-gate 
593*0Sstevel@tonic-gate /* Any of the getnetent getnetbyaddr getnetbyname using errno? */
594*0Sstevel@tonic-gate 
595*0Sstevel@tonic-gate #if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
596*0Sstevel@tonic-gate #   define USE_NETENT_ERRNO
597*0Sstevel@tonic-gate #else
598*0Sstevel@tonic-gate #   undef  USE_NETENT_ERRNO
599*0Sstevel@tonic-gate #endif
600*0Sstevel@tonic-gate 
601*0Sstevel@tonic-gate 
602*0Sstevel@tonic-gate typedef struct {
603*0Sstevel@tonic-gate #ifdef HAS_ASCTIME_R
604*0Sstevel@tonic-gate 	char*	_asctime_buffer;
605*0Sstevel@tonic-gate 	size_t	_asctime_size;
606*0Sstevel@tonic-gate #endif /* HAS_ASCTIME_R */
607*0Sstevel@tonic-gate #ifdef HAS_CRYPT_R
608*0Sstevel@tonic-gate #if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
609*0Sstevel@tonic-gate 	CRYPTD* _crypt_data;
610*0Sstevel@tonic-gate #else
611*0Sstevel@tonic-gate 	struct crypt_data _crypt_struct;
612*0Sstevel@tonic-gate #endif
613*0Sstevel@tonic-gate #endif /* HAS_CRYPT_R */
614*0Sstevel@tonic-gate #ifdef HAS_CTIME_R
615*0Sstevel@tonic-gate 	char*	_ctime_buffer;
616*0Sstevel@tonic-gate 	size_t	_ctime_size;
617*0Sstevel@tonic-gate #endif /* HAS_CTIME_R */
618*0Sstevel@tonic-gate #ifdef HAS_DRAND48_R
619*0Sstevel@tonic-gate 	struct drand48_data _drand48_struct;
620*0Sstevel@tonic-gate 	double	_drand48_double;
621*0Sstevel@tonic-gate #endif /* HAS_DRAND48_R */
622*0Sstevel@tonic-gate #ifdef HAS_GETGRNAM_R
623*0Sstevel@tonic-gate 	struct group	_grent_struct;
624*0Sstevel@tonic-gate 	char*	_grent_buffer;
625*0Sstevel@tonic-gate 	size_t	_grent_size;
626*0Sstevel@tonic-gate #   ifdef USE_GRENT_PTR
627*0Sstevel@tonic-gate 	struct group*	_grent_ptr;
628*0Sstevel@tonic-gate #   endif
629*0Sstevel@tonic-gate #   ifdef USE_GRENT_FPTR
630*0Sstevel@tonic-gate 	FILE*	_grent_fptr;
631*0Sstevel@tonic-gate #   endif
632*0Sstevel@tonic-gate #endif /* HAS_GETGRNAM_R */
633*0Sstevel@tonic-gate #ifdef HAS_GETHOSTBYNAME_R
634*0Sstevel@tonic-gate 	struct hostent	_hostent_struct;
635*0Sstevel@tonic-gate #   if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
636*0Sstevel@tonic-gate 	struct hostent_data	_hostent_data;
637*0Sstevel@tonic-gate #   else
638*0Sstevel@tonic-gate 	char*	_hostent_buffer;
639*0Sstevel@tonic-gate 	size_t	_hostent_size;
640*0Sstevel@tonic-gate #   endif
641*0Sstevel@tonic-gate #   ifdef USE_HOSTENT_PTR
642*0Sstevel@tonic-gate 	struct hostent*	_hostent_ptr;
643*0Sstevel@tonic-gate #   endif
644*0Sstevel@tonic-gate #   ifdef USE_HOSTENT_ERRNO
645*0Sstevel@tonic-gate 	int	_hostent_errno;
646*0Sstevel@tonic-gate #   endif
647*0Sstevel@tonic-gate #endif /* HAS_GETHOSTBYNAME_R */
648*0Sstevel@tonic-gate #ifdef HAS_GETLOGIN_R
649*0Sstevel@tonic-gate 	char*	_getlogin_buffer;
650*0Sstevel@tonic-gate 	size_t	_getlogin_size;
651*0Sstevel@tonic-gate #endif /* HAS_GETLOGIN_R */
652*0Sstevel@tonic-gate #ifdef HAS_GETNETBYNAME_R
653*0Sstevel@tonic-gate 	struct netent	_netent_struct;
654*0Sstevel@tonic-gate #   if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
655*0Sstevel@tonic-gate 	struct netent_data	_netent_data;
656*0Sstevel@tonic-gate #   else
657*0Sstevel@tonic-gate 	char*	_netent_buffer;
658*0Sstevel@tonic-gate 	size_t	_netent_size;
659*0Sstevel@tonic-gate #   endif
660*0Sstevel@tonic-gate #   ifdef USE_NETENT_PTR
661*0Sstevel@tonic-gate 	struct netent*	_netent_ptr;
662*0Sstevel@tonic-gate #   endif
663*0Sstevel@tonic-gate #   ifdef USE_NETENT_ERRNO
664*0Sstevel@tonic-gate 	int	_netent_errno;
665*0Sstevel@tonic-gate #   endif
666*0Sstevel@tonic-gate #endif /* HAS_GETNETBYNAME_R */
667*0Sstevel@tonic-gate #ifdef HAS_GETPROTOBYNAME_R
668*0Sstevel@tonic-gate 	struct protoent	_protoent_struct;
669*0Sstevel@tonic-gate #   if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
670*0Sstevel@tonic-gate 	struct protoent_data	_protoent_data;
671*0Sstevel@tonic-gate #   else
672*0Sstevel@tonic-gate 	char*	_protoent_buffer;
673*0Sstevel@tonic-gate 	size_t	_protoent_size;
674*0Sstevel@tonic-gate #   endif
675*0Sstevel@tonic-gate #   ifdef USE_PROTOENT_PTR
676*0Sstevel@tonic-gate 	struct protoent*	_protoent_ptr;
677*0Sstevel@tonic-gate #   endif
678*0Sstevel@tonic-gate #   ifdef USE_PROTOENT_ERRNO
679*0Sstevel@tonic-gate 	int	_protoent_errno;
680*0Sstevel@tonic-gate #   endif
681*0Sstevel@tonic-gate #endif /* HAS_GETPROTOBYNAME_R */
682*0Sstevel@tonic-gate #ifdef HAS_GETPWNAM_R
683*0Sstevel@tonic-gate 	struct passwd	_pwent_struct;
684*0Sstevel@tonic-gate 	char*	_pwent_buffer;
685*0Sstevel@tonic-gate 	size_t	_pwent_size;
686*0Sstevel@tonic-gate #   ifdef USE_PWENT_PTR
687*0Sstevel@tonic-gate 	struct passwd*	_pwent_ptr;
688*0Sstevel@tonic-gate #   endif
689*0Sstevel@tonic-gate #   ifdef USE_PWENT_FPTR
690*0Sstevel@tonic-gate 	FILE*	_pwent_fptr;
691*0Sstevel@tonic-gate #   endif
692*0Sstevel@tonic-gate #endif /* HAS_GETPWNAM_R */
693*0Sstevel@tonic-gate #ifdef HAS_GETSERVBYNAME_R
694*0Sstevel@tonic-gate 	struct servent	_servent_struct;
695*0Sstevel@tonic-gate #   if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
696*0Sstevel@tonic-gate 	struct servent_data	_servent_data;
697*0Sstevel@tonic-gate #   else
698*0Sstevel@tonic-gate 	char*	_servent_buffer;
699*0Sstevel@tonic-gate 	size_t	_servent_size;
700*0Sstevel@tonic-gate #   endif
701*0Sstevel@tonic-gate #   ifdef USE_SERVENT_PTR
702*0Sstevel@tonic-gate 	struct servent*	_servent_ptr;
703*0Sstevel@tonic-gate #   endif
704*0Sstevel@tonic-gate #   ifdef USE_SERVENT_ERRNO
705*0Sstevel@tonic-gate 	int	_servent_errno;
706*0Sstevel@tonic-gate #   endif
707*0Sstevel@tonic-gate #endif /* HAS_GETSERVBYNAME_R */
708*0Sstevel@tonic-gate #ifdef HAS_GETSPNAM_R
709*0Sstevel@tonic-gate 	struct spwd	_spent_struct;
710*0Sstevel@tonic-gate 	char*	_spent_buffer;
711*0Sstevel@tonic-gate 	size_t	_spent_size;
712*0Sstevel@tonic-gate #   ifdef USE_SPENT_PTR
713*0Sstevel@tonic-gate 	struct spwd*	_spent_ptr;
714*0Sstevel@tonic-gate #   endif
715*0Sstevel@tonic-gate #   ifdef USE_SPENT_FPTR
716*0Sstevel@tonic-gate 	FILE*	_spent_fptr;
717*0Sstevel@tonic-gate #   endif
718*0Sstevel@tonic-gate #endif /* HAS_GETSPNAM_R */
719*0Sstevel@tonic-gate #ifdef HAS_GMTIME_R
720*0Sstevel@tonic-gate 	struct tm _gmtime_struct;
721*0Sstevel@tonic-gate #endif /* HAS_GMTIME_R */
722*0Sstevel@tonic-gate #ifdef HAS_LOCALTIME_R
723*0Sstevel@tonic-gate 	struct tm _localtime_struct;
724*0Sstevel@tonic-gate #endif /* HAS_LOCALTIME_R */
725*0Sstevel@tonic-gate #ifdef HAS_RANDOM_R
726*0Sstevel@tonic-gate #   if RANDOM_R_PROTO != REENTRANT_PROTO_I_St
727*0Sstevel@tonic-gate 	struct random_data _random_struct;
728*0Sstevel@tonic-gate #   endif
729*0Sstevel@tonic-gate #endif /* HAS_RANDOM_R */
730*0Sstevel@tonic-gate #ifdef HAS_READDIR_R
731*0Sstevel@tonic-gate 	struct dirent*	_readdir_struct;
732*0Sstevel@tonic-gate 	size_t	_readdir_size;
733*0Sstevel@tonic-gate #   if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
734*0Sstevel@tonic-gate 	struct dirent*	_readdir_ptr;
735*0Sstevel@tonic-gate #   endif
736*0Sstevel@tonic-gate #endif /* HAS_READDIR_R */
737*0Sstevel@tonic-gate #ifdef HAS_READDIR64_R
738*0Sstevel@tonic-gate 	struct dirent64*	_readdir64_struct;
739*0Sstevel@tonic-gate 	size_t	_readdir64_size;
740*0Sstevel@tonic-gate #   if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
741*0Sstevel@tonic-gate 	struct dirent64*	_readdir64_ptr;
742*0Sstevel@tonic-gate #   endif
743*0Sstevel@tonic-gate #endif /* HAS_READDIR64_R */
744*0Sstevel@tonic-gate #ifdef HAS_SETLOCALE_R
745*0Sstevel@tonic-gate 	char*	_setlocale_buffer;
746*0Sstevel@tonic-gate 	size_t	_setlocale_size;
747*0Sstevel@tonic-gate #endif /* HAS_SETLOCALE_R */
748*0Sstevel@tonic-gate #ifdef HAS_STRERROR_R
749*0Sstevel@tonic-gate 	char*	_strerror_buffer;
750*0Sstevel@tonic-gate 	size_t	_strerror_size;
751*0Sstevel@tonic-gate #endif /* HAS_STRERROR_R */
752*0Sstevel@tonic-gate #ifdef HAS_TTYNAME_R
753*0Sstevel@tonic-gate 	char*	_ttyname_buffer;
754*0Sstevel@tonic-gate 	size_t	_ttyname_size;
755*0Sstevel@tonic-gate #endif /* HAS_TTYNAME_R */
756*0Sstevel@tonic-gate #ifdef HAS_CRYPT_R
757*0Sstevel@tonic-gate #if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
758*0Sstevel@tonic-gate #else
759*0Sstevel@tonic-gate 	struct crypt_data *_crypt_struct_buffer;
760*0Sstevel@tonic-gate #endif
761*0Sstevel@tonic-gate #endif /* HAS_CRYPT_R */
762*0Sstevel@tonic-gate #ifdef HAS_RANDOM_R
763*0Sstevel@tonic-gate #   if RANDOM_R_PROTO == REENTRANT_PROTO_I_iS
764*0Sstevel@tonic-gate 	int	_random_retval;
765*0Sstevel@tonic-gate #   endif
766*0Sstevel@tonic-gate #   if RANDOM_R_PROTO == REENTRANT_PROTO_I_lS
767*0Sstevel@tonic-gate 	long	_random_retval;
768*0Sstevel@tonic-gate #   endif
769*0Sstevel@tonic-gate #   if RANDOM_R_PROTO == REENTRANT_PROTO_I_St
770*0Sstevel@tonic-gate 	struct random_data _random_struct;
771*0Sstevel@tonic-gate 	int32_t	_random_retval;
772*0Sstevel@tonic-gate #   endif
773*0Sstevel@tonic-gate #endif /* HAS_RANDOM_R */
774*0Sstevel@tonic-gate #ifdef HAS_SRANDOM_R
775*0Sstevel@tonic-gate 	struct random_data _srandom_struct;
776*0Sstevel@tonic-gate #endif /* HAS_SRANDOM_R */
777*0Sstevel@tonic-gate 
778*0Sstevel@tonic-gate     int dummy; /* cannot have empty structs */
779*0Sstevel@tonic-gate } REENTR;
780*0Sstevel@tonic-gate 
781*0Sstevel@tonic-gate #endif /* USE_REENTRANT_API */
782*0Sstevel@tonic-gate 
783*0Sstevel@tonic-gate #endif
784