This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
reentr.c: Use keywords, not ops
[perl5.git] / reentr.h
CommitLineData
37442d52
RGS
1/* -*- buffer-read-only: t -*-
2 *
10bc17b6
JH
3 * reentr.h
4 *
922adc66 5 * Copyright (C) 2002, 2003, 2005, 2006, 2007 by Larry Wall and others
10bc17b6
JH
6 *
7 * You may distribute under the terms of either the GNU General Public
8 * License or the Artistic License, as specified in the README file.
9 *
78102347
NC
10 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
11 * This file is built by regen/reentr.pl from data in regen/reentr.pl.
12 * Any changes made here will be lost!
10bc17b6
JH
13 */
14
6a5bc5ac
KW
15#ifndef PERL_REENTR_H_
16#define PERL_REENTR_H_
10bc17b6 17
a3dd3f83
MB
18/* If compiling for a threaded perl, we will macro-wrap the system/library
19 * interfaces (e.g. getpwent()) which have threaded versions
20 * (e.g. getpwent_r()), which will handle things correctly for
21 * the Perl interpreter, but otherwise (for XS) the wrapping does
22 * not take place. See L<perlxs/Thread-aware system interfaces>.
23 */
24
25#ifndef PERL_REENTR_API
7c1815b7
KW
26# if defined(PERL_CORE) || defined(PERL_EXT) || defined(PERL_REENTRANT)
27# define PERL_REENTR_API 1
28# else
29# define PERL_REENTR_API 0
30# endif
a3dd3f83
MB
31#endif
32
10bc17b6 33#ifdef USE_REENTRANT_API
7c1815b7 34
10bc17b6
JH
35/* Deprecations: some platforms have the said reentrant interfaces
36 * but they are declared obsolete and are not to be used. Often this
37 * means that the platform has threadsafed the interfaces (hopefully).
38 * All this is OS version dependent, so we are of course fooling ourselves.
a3dd3f83
MB
39 * If you know of more deprecations on some platforms, please add your own
40 * (by editing reentr.pl, mind!) */
10bc17b6 41
7c1815b7
KW
42# ifdef __hpux
43# undef HAS_CRYPT_R
44# undef HAS_ENDGRENT_R
45# undef HAS_ENDPWENT_R
46# undef HAS_GETGRENT_R
47# undef HAS_GETPWENT_R
48# undef HAS_SETLOCALE_R
49# undef HAS_STRERROR_R
50# define NETDB_R_OBSOLETE
51# endif
10bc17b6 52
7c1815b7
KW
53# if defined(__osf__) && defined(__alpha) /* Tru64 aka Digital UNIX */
54# undef HAS_CRYPT_R
55# undef HAS_STRERROR_R
56# define NETDB_R_OBSOLETE
57# endif
10bc17b6 58
7c1815b7
KW
59# if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 24))
60# undef HAS_READDIR_R
61# undef HAS_READDIR64_R
62# endif
c6709bf9 63
d4b8ffd7
RGS
64/*
65 * As of OpenBSD 3.7, reentrant functions are now working, they just are
66 * incompatible with everyone else. To make OpenBSD happy, we have to
67 * memzero out certain structures before calling the functions.
68 */
7c1815b7 69# if defined(__OpenBSD__)
3fb2f3ac 70# define REENTR_MEMZERO(a,b) memzero(a,b)
7c1815b7 71# else
3fb2f3ac 72# define REENTR_MEMZERO(a,b) 0
7c1815b7 73# endif
10bc17b6 74
7c1815b7
KW
75# ifdef NETDB_R_OBSOLETE
76# undef HAS_ENDHOSTENT_R
77# undef HAS_ENDNETENT_R
78# undef HAS_ENDPROTOENT_R
79# undef HAS_ENDSERVENT_R
80# undef HAS_GETHOSTBYADDR_R
81# undef HAS_GETHOSTBYNAME_R
82# undef HAS_GETHOSTENT_R
83# undef HAS_GETNETBYADDR_R
84# undef HAS_GETNETBYNAME_R
85# undef HAS_GETNETENT_R
86# undef HAS_GETPROTOBYNAME_R
87# undef HAS_GETPROTOBYNUMBER_R
88# undef HAS_GETPROTOENT_R
89# undef HAS_GETSERVBYNAME_R
90# undef HAS_GETSERVBYPORT_R
91# undef HAS_GETSERVENT_R
92# undef HAS_SETHOSTENT_R
93# undef HAS_SETNETENT_R
94# undef HAS_SETPROTOENT_R
95# undef HAS_SETSERVENT_R
96# endif
97
98# ifdef I_PWD
99# include <pwd.h>
100# endif
101# ifdef I_GRP
102# include <grp.h>
103# endif
104# ifdef I_NETDB
105# include <netdb.h>
106# endif
107# ifdef I_CRYPT
108# ifdef I_CRYPT
109# include <crypt.h>
110# endif
111# endif
112# ifdef HAS_GETSPNAM_R
113# ifdef I_SHADOW
114# include <shadow.h>
115# endif
116# endif
10bc17b6 117
7c1815b7
KW
118# define REENTRANT_PROTO_B_B 1
119# define REENTRANT_PROTO_B_BI 2
120# define REENTRANT_PROTO_B_BW 3
121# define REENTRANT_PROTO_B_CCD 4
122# define REENTRANT_PROTO_B_CCS 5
123# define REENTRANT_PROTO_B_IBI 6
124# define REENTRANT_PROTO_B_IBW 7
125# define REENTRANT_PROTO_B_SB 8
126# define REENTRANT_PROTO_B_SBI 9
127# define REENTRANT_PROTO_I_BI 10
128# define REENTRANT_PROTO_I_BW 11
129# define REENTRANT_PROTO_I_CCSBWR 12
130# define REENTRANT_PROTO_I_CCSD 13
131# define REENTRANT_PROTO_I_CII 14
132# define REENTRANT_PROTO_I_CIISD 15
133# define REENTRANT_PROTO_I_CSBI 16
134# define REENTRANT_PROTO_I_CSBIR 17
135# define REENTRANT_PROTO_I_CSBWR 18
136# define REENTRANT_PROTO_I_CSBWRE 19
137# define REENTRANT_PROTO_I_CSD 20
138# define REENTRANT_PROTO_I_CWISBWRE 21
139# define REENTRANT_PROTO_I_CWISD 22
140# define REENTRANT_PROTO_I_D 23
141# define REENTRANT_PROTO_I_H 24
142# define REENTRANT_PROTO_I_IBI 25
143# define REENTRANT_PROTO_I_IBW 26
144# define REENTRANT_PROTO_I_ICBI 27
145# define REENTRANT_PROTO_I_ICSBWR 28
146# define REENTRANT_PROTO_I_ICSD 29
147# define REENTRANT_PROTO_I_ID 30
148# define REENTRANT_PROTO_I_IISD 31
149# define REENTRANT_PROTO_I_ISBWR 32
150# define REENTRANT_PROTO_I_ISD 33
151# define REENTRANT_PROTO_I_LISBI 34
152# define REENTRANT_PROTO_I_LISD 35
153# define REENTRANT_PROTO_I_SB 36
154# define REENTRANT_PROTO_I_SBI 37
155# define REENTRANT_PROTO_I_SBIE 38
156# define REENTRANT_PROTO_I_SBIH 39
157# define REENTRANT_PROTO_I_SBIR 40
158# define REENTRANT_PROTO_I_SBWR 41
159# define REENTRANT_PROTO_I_SBWRE 42
160# define REENTRANT_PROTO_I_SD 43
161# define REENTRANT_PROTO_I_TISD 44
162# define REENTRANT_PROTO_I_TS 45
163# define REENTRANT_PROTO_I_TSBI 46
164# define REENTRANT_PROTO_I_TSBIR 47
165# define REENTRANT_PROTO_I_TSBWR 48
166# define REENTRANT_PROTO_I_TSR 49
167# define REENTRANT_PROTO_I_TsISBWRE 50
168# define REENTRANT_PROTO_I_UISBWRE 51
169# define REENTRANT_PROTO_I_uISBWRE 52
170# define REENTRANT_PROTO_S_CBI 53
171# define REENTRANT_PROTO_S_CCSBI 54
172# define REENTRANT_PROTO_S_CIISBIE 55
173# define REENTRANT_PROTO_S_CSBI 56
174# define REENTRANT_PROTO_S_CSBIE 57
175# define REENTRANT_PROTO_S_CWISBIE 58
176# define REENTRANT_PROTO_S_CWISBWIE 59
177# define REENTRANT_PROTO_S_ICSBI 60
178# define REENTRANT_PROTO_S_ISBI 61
179# define REENTRANT_PROTO_S_LISBI 62
180# define REENTRANT_PROTO_S_SBI 63
181# define REENTRANT_PROTO_S_SBIE 64
182# define REENTRANT_PROTO_S_SBW 65
183# define REENTRANT_PROTO_S_TISBI 66
184# define REENTRANT_PROTO_S_TSBI 67
185# define REENTRANT_PROTO_S_TSBIE 68
186# define REENTRANT_PROTO_S_TWISBIE 69
187# define REENTRANT_PROTO_V_D 70
188# define REENTRANT_PROTO_V_H 71
189# define REENTRANT_PROTO_V_ID 72
10bc17b6
JH
190
191/* Defines for indicating which special features are supported. */
192
edd309b7
JH
193/* The getgrent getgrgid getgrnam using buffer? */
194
7c1815b7
KW
195# 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)
196# define GETGRENT_R_HAS_BUFFER
197# else
198# undef GETGRENT_R_HAS_BUFFER
199# endif
200# 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)
201# define GETGRGID_R_HAS_BUFFER
202# else
203# undef GETGRGID_R_HAS_BUFFER
204# endif
205# 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)
206# define GETGRNAM_R_HAS_BUFFER
207# else
208# undef GETGRNAM_R_HAS_BUFFER
209# endif
edd309b7
JH
210
211/* Any of the getgrent getgrgid getgrnam using buffer? */
212
7c1815b7
KW
213# if (defined(GETGRENT_R_HAS_BUFFER) || defined(GETGRGID_R_HAS_BUFFER) || defined(GETGRNAM_R_HAS_BUFFER))
214# define USE_GRENT_BUFFER
215# else
216# undef USE_GRENT_BUFFER
217# endif
edd309b7 218
10bc17b6
JH
219/* The getgrent getgrgid getgrnam using ptr? */
220
7c1815b7
KW
221# if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
222# define GETGRENT_R_HAS_PTR
223# else
224# undef GETGRENT_R_HAS_PTR
225# endif
226# if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
227# define GETGRGID_R_HAS_PTR
228# else
229# undef GETGRGID_R_HAS_PTR
230# endif
231# if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
232# define GETGRNAM_R_HAS_PTR
233# else
234# undef GETGRNAM_R_HAS_PTR
235# endif
10bc17b6
JH
236
237/* Any of the getgrent getgrgid getgrnam using ptr? */
238
7c1815b7
KW
239# if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
240# define USE_GRENT_PTR
241# else
242# undef USE_GRENT_PTR
243# endif
10bc17b6
JH
244
245/* The getpwent getpwnam getpwuid using ptr? */
246
7c1815b7
KW
247# if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
248# define GETPWENT_R_HAS_PTR
249# else
250# undef GETPWENT_R_HAS_PTR
251# endif
252# if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
253# define GETPWNAM_R_HAS_PTR
254# else
255# undef GETPWNAM_R_HAS_PTR
256# endif
257# if defined(HAS_GETPWUID_R) && (GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
258# define GETPWUID_R_HAS_PTR
259# else
260# undef GETPWUID_R_HAS_PTR
261# endif
10bc17b6
JH
262
263/* Any of the getpwent getpwnam getpwuid using ptr? */
264
7c1815b7
KW
265# if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
266# define USE_PWENT_PTR
267# else
268# undef USE_PWENT_PTR
269# endif
10bc17b6
JH
270
271/* The getspent getspnam using ptr? */
272
7c1815b7
KW
273# if defined(HAS_GETSPNAM_R) && (GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR)
274# define GETSPNAM_R_HAS_PTR
275# else
276# undef GETSPNAM_R_HAS_PTR
277# endif
10bc17b6
JH
278
279/* Any of the getspent getspnam using ptr? */
280
7c1815b7
KW
281# if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
282# define USE_SPENT_PTR
283# else
284# undef USE_SPENT_PTR
285# endif
10bc17b6 286
f7937171 287/* The getgrent getgrgid getgrnam setgrent endgrent using fptr? */
10bc17b6 288
7c1815b7
KW
289# if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
290# define GETGRENT_R_HAS_FPTR
291# else
292# undef GETGRENT_R_HAS_FPTR
293# endif
294# if defined(HAS_SETGRENT_R) && (SETGRENT_R_PROTO == REENTRANT_PROTO_I_H || SETGRENT_R_PROTO == REENTRANT_PROTO_V_H)
295# define SETGRENT_R_HAS_FPTR
296# else
297# undef SETGRENT_R_HAS_FPTR
298# endif
299# if defined(HAS_ENDGRENT_R) && (ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H || ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H)
300# define ENDGRENT_R_HAS_FPTR
301# else
302# undef ENDGRENT_R_HAS_FPTR
303# endif
10bc17b6 304
f7937171 305/* Any of the getgrent getgrgid getgrnam setgrent endgrent using fptr? */
10bc17b6 306
7c1815b7
KW
307# 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))
308# define USE_GRENT_FPTR
309# else
310# undef USE_GRENT_FPTR
311# endif
10bc17b6 312
f7937171 313/* The getpwent getpwnam getpwuid setpwent endpwent using fptr? */
10bc17b6 314
7c1815b7
KW
315# if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
316# define GETPWENT_R_HAS_FPTR
317# else
318# undef GETPWENT_R_HAS_FPTR
319# endif
320# if defined(HAS_SETPWENT_R) && (SETPWENT_R_PROTO == REENTRANT_PROTO_I_H || SETPWENT_R_PROTO == REENTRANT_PROTO_V_H)
321# define SETPWENT_R_HAS_FPTR
322# else
323# undef SETPWENT_R_HAS_FPTR
324# endif
325# if defined(HAS_ENDPWENT_R) && (ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H || ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H)
326# define ENDPWENT_R_HAS_FPTR
327# else
328# undef ENDPWENT_R_HAS_FPTR
329# endif
10bc17b6 330
f7937171 331/* Any of the getpwent getpwnam getpwuid setpwent endpwent using fptr? */
10bc17b6 332
7c1815b7
KW
333# 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))
334# define USE_PWENT_FPTR
335# else
336# undef USE_PWENT_FPTR
337# endif
10bc17b6 338
edd309b7
JH
339/* The getpwent getpwgid getpwnam using buffer? */
340
7c1815b7
KW
341# 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)
342# define GETPWENT_R_HAS_BUFFER
343# else
344# undef GETPWENT_R_HAS_BUFFER
345# endif
346# 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)
347# define GETPWNAM_R_HAS_BUFFER
348# else
349# undef GETPWNAM_R_HAS_BUFFER
350# endif
edd309b7
JH
351
352/* Any of the getpwent getpwgid getpwnam using buffer? */
353
7c1815b7
KW
354# if (defined(GETPWENT_R_HAS_BUFFER) || defined(GETPWGID_R_HAS_BUFFER) || defined(GETPWNAM_R_HAS_BUFFER))
355# define USE_PWENT_BUFFER
356# else
357# undef USE_PWENT_BUFFER
358# endif
edd309b7 359
10bc17b6
JH
360/* The gethostent gethostbyaddr gethostbyname using ptr? */
361
7c1815b7
KW
362# if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
363# define GETHOSTENT_R_HAS_PTR
364# else
365# undef GETHOSTENT_R_HAS_PTR
366# endif
367# if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
368# define GETHOSTBYADDR_R_HAS_PTR
369# else
370# undef GETHOSTBYADDR_R_HAS_PTR
371# endif
372# if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
373# define GETHOSTBYNAME_R_HAS_PTR
374# else
375# undef GETHOSTBYNAME_R_HAS_PTR
376# endif
10bc17b6
JH
377
378/* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
379
7c1815b7
KW
380# if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
381# define USE_HOSTENT_PTR
382# else
383# undef USE_HOSTENT_PTR
384# endif
10bc17b6
JH
385
386/* The getnetent getnetbyaddr getnetbyname using ptr? */
387
7c1815b7
KW
388# if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
389# define GETNETENT_R_HAS_PTR
390# else
391# undef GETNETENT_R_HAS_PTR
392# endif
393# if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
394# define GETNETBYADDR_R_HAS_PTR
395# else
396# undef GETNETBYADDR_R_HAS_PTR
397# endif
398# if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
399# define GETNETBYNAME_R_HAS_PTR
400# else
401# undef GETNETBYNAME_R_HAS_PTR
402# endif
10bc17b6
JH
403
404/* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
405
7c1815b7
KW
406# if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
407# define USE_NETENT_PTR
408# else
409# undef USE_NETENT_PTR
410# endif
10bc17b6
JH
411
412/* The getprotoent getprotobyname getprotobynumber using ptr? */
413
7c1815b7
KW
414# if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
415# define GETPROTOENT_R_HAS_PTR
416# else
417# undef GETPROTOENT_R_HAS_PTR
418# endif
419# if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
420# define GETPROTOBYNAME_R_HAS_PTR
421# else
422# undef GETPROTOBYNAME_R_HAS_PTR
423# endif
424# if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
425# define GETPROTOBYNUMBER_R_HAS_PTR
426# else
427# undef GETPROTOBYNUMBER_R_HAS_PTR
428# endif
10bc17b6
JH
429
430/* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
431
7c1815b7
KW
432# if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
433# define USE_PROTOENT_PTR
434# else
435# undef USE_PROTOENT_PTR
436# endif
10bc17b6
JH
437
438/* The getservent getservbyname getservbyport using ptr? */
439
7c1815b7
KW
440# if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
441# define GETSERVENT_R_HAS_PTR
442# else
443# undef GETSERVENT_R_HAS_PTR
444# endif
445# if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
446# define GETSERVBYNAME_R_HAS_PTR
447# else
448# undef GETSERVBYNAME_R_HAS_PTR
449# endif
450# if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
451# define GETSERVBYPORT_R_HAS_PTR
452# else
453# undef GETSERVBYPORT_R_HAS_PTR
454# endif
10bc17b6
JH
455
456/* Any of the getservent getservbyname getservbyport using ptr? */
457
7c1815b7
KW
458# if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
459# define USE_SERVENT_PTR
460# else
461# undef USE_SERVENT_PTR
462# endif
10bc17b6 463
edd309b7
JH
464/* The gethostent gethostbyaddr gethostbyname using buffer? */
465
7c1815b7
KW
466# 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)
467# define GETHOSTENT_R_HAS_BUFFER
468# else
469# undef GETHOSTENT_R_HAS_BUFFER
470# endif
471# 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)
472# define GETHOSTBYADDR_R_HAS_BUFFER
473# else
474# undef GETHOSTBYADDR_R_HAS_BUFFER
475# endif
476# if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
477# define GETHOSTBYNAME_R_HAS_BUFFER
478# else
479# undef GETHOSTBYNAME_R_HAS_BUFFER
480# endif
edd309b7
JH
481
482/* Any of the gethostent gethostbyaddr gethostbyname using buffer? */
483
7c1815b7
KW
484# if (defined(GETHOSTENT_R_HAS_BUFFER) || defined(GETHOSTBYADDR_R_HAS_BUFFER) || defined(GETHOSTBYNAME_R_HAS_BUFFER))
485# define USE_HOSTENT_BUFFER
486# else
487# undef USE_HOSTENT_BUFFER
488# endif
edd309b7
JH
489
490/* The getnetent getnetbyaddr getnetbyname using buffer? */
491
7c1815b7
KW
492# 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)
493# define GETNETENT_R_HAS_BUFFER
494# else
495# undef GETNETENT_R_HAS_BUFFER
496# endif
497# 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)
498# define GETNETBYADDR_R_HAS_BUFFER
499# else
500# undef GETNETBYADDR_R_HAS_BUFFER
501# endif
502# 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)
503# define GETNETBYNAME_R_HAS_BUFFER
504# else
505# undef GETNETBYNAME_R_HAS_BUFFER
506# endif
edd309b7
JH
507
508/* Any of the getnetent getnetbyaddr getnetbyname using buffer? */
509
7c1815b7
KW
510# if (defined(GETNETENT_R_HAS_BUFFER) || defined(GETNETBYADDR_R_HAS_BUFFER) || defined(GETNETBYNAME_R_HAS_BUFFER))
511# define USE_NETENT_BUFFER
512# else
513# undef USE_NETENT_BUFFER
514# endif
edd309b7
JH
515
516/* The getprotoent getprotobyname getprotobynumber using buffer? */
517
7c1815b7
KW
518# 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)
519# define GETPROTOENT_R_HAS_BUFFER
520# else
521# undef GETPROTOENT_R_HAS_BUFFER
522# endif
523# if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
524# define GETPROTOBYNAME_R_HAS_BUFFER
525# else
526# undef GETPROTOBYNAME_R_HAS_BUFFER
527# endif
528# if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR || GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI)
529# define GETPROTOBYNUMBER_R_HAS_BUFFER
530# else
531# undef GETPROTOBYNUMBER_R_HAS_BUFFER
532# endif
edd309b7
JH
533
534/* Any of the getprotoent getprotobyname getprotobynumber using buffer? */
535
7c1815b7
KW
536# if (defined(GETPROTOENT_R_HAS_BUFFER) || defined(GETPROTOBYNAME_R_HAS_BUFFER) || defined(GETPROTOBYNUMBER_R_HAS_BUFFER))
537# define USE_PROTOENT_BUFFER
538# else
539# undef USE_PROTOENT_BUFFER
540# endif
edd309b7
JH
541
542/* The getservent getservbyname getservbyport using buffer? */
543
7c1815b7
KW
544# 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)
545# define GETSERVENT_R_HAS_BUFFER
546# else
547# undef GETSERVENT_R_HAS_BUFFER
548# endif
549# if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR || GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI)
550# define GETSERVBYNAME_R_HAS_BUFFER
551# else
552# undef GETSERVBYNAME_R_HAS_BUFFER
553# endif
554# if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR || GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI)
555# define GETSERVBYPORT_R_HAS_BUFFER
556# else
557# undef GETSERVBYPORT_R_HAS_BUFFER
558# endif
edd309b7
JH
559
560/* Any of the getservent getservbyname getservbyport using buffer? */
561
7c1815b7
KW
562# if (defined(GETSERVENT_R_HAS_BUFFER) || defined(GETSERVBYNAME_R_HAS_BUFFER) || defined(GETSERVBYPORT_R_HAS_BUFFER))
563# define USE_SERVENT_BUFFER
564# else
565# undef USE_SERVENT_BUFFER
566# endif
edd309b7 567
10bc17b6
JH
568/* The gethostent gethostbyaddr gethostbyname using errno? */
569
7c1815b7
KW
570# 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)
571# define GETHOSTENT_R_HAS_ERRNO
572# else
573# undef GETHOSTENT_R_HAS_ERRNO
574# endif
575# 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)
576# define GETHOSTBYADDR_R_HAS_ERRNO
577# else
578# undef GETHOSTBYADDR_R_HAS_ERRNO
579# endif
580# if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
581# define GETHOSTBYNAME_R_HAS_ERRNO
582# else
583# undef GETHOSTBYNAME_R_HAS_ERRNO
584# endif
10bc17b6
JH
585
586/* Any of the gethostent gethostbyaddr gethostbyname using errno? */
587
7c1815b7
KW
588# if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
589# define USE_HOSTENT_ERRNO
590# else
591# undef USE_HOSTENT_ERRNO
592# endif
10bc17b6
JH
593
594/* The getnetent getnetbyaddr getnetbyname using errno? */
595
7c1815b7
KW
596# 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)
597# define GETNETENT_R_HAS_ERRNO
598# else
599# undef GETNETENT_R_HAS_ERRNO
600# endif
601# if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
602# define GETNETBYADDR_R_HAS_ERRNO
603# else
604# undef GETNETBYADDR_R_HAS_ERRNO
605# endif
606# if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
607# define GETNETBYNAME_R_HAS_ERRNO
608# else
609# undef GETNETBYNAME_R_HAS_ERRNO
610# endif
10bc17b6
JH
611
612/* Any of the getnetent getnetbyaddr getnetbyname using errno? */
613
7c1815b7
KW
614# if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
615# define USE_NETENT_ERRNO
616# else
617# undef USE_NETENT_ERRNO
618# endif
10bc17b6
JH
619
620
621typedef struct {
7c1815b7
KW
622
623# ifdef HAS_ASCTIME_R
10bc17b6
JH
624 char* _asctime_buffer;
625 size_t _asctime_size;
7c1815b7
KW
626# endif /* HAS_ASCTIME_R */
627
628# ifdef HAS_CRYPT_R
629# if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
b430fd04 630 CRYPTD* _crypt_data;
7c1815b7 631# else
05404ffe 632 struct crypt_data *_crypt_struct_buffer;
7c1815b7
KW
633# endif
634# endif /* HAS_CRYPT_R */
635
636# ifdef HAS_CTIME_R
10bc17b6
JH
637 char* _ctime_buffer;
638 size_t _ctime_size;
7c1815b7
KW
639# endif /* HAS_CTIME_R */
640
641# ifdef HAS_GETGRNAM_R
f7937171
JH
642 struct group _grent_struct;
643 char* _grent_buffer;
644 size_t _grent_size;
645# ifdef USE_GRENT_PTR
646 struct group* _grent_ptr;
10bc17b6 647# endif
f7937171
JH
648# ifdef USE_GRENT_FPTR
649 FILE* _grent_fptr;
10bc17b6 650# endif
7c1815b7
KW
651# endif /* HAS_GETGRNAM_R */
652
653# ifdef HAS_GETHOSTBYNAME_R
f7937171 654 struct hostent _hostent_struct;
10bc17b6 655# if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 656 struct hostent_data _hostent_data;
10bc17b6 657# else
f7937171
JH
658 char* _hostent_buffer;
659 size_t _hostent_size;
10bc17b6 660# endif
f7937171
JH
661# ifdef USE_HOSTENT_PTR
662 struct hostent* _hostent_ptr;
10bc17b6 663# endif
f7937171
JH
664# ifdef USE_HOSTENT_ERRNO
665 int _hostent_errno;
7c1815b7
KW
666# endif
667# endif /* HAS_GETHOSTBYNAME_R */
668
669# ifdef HAS_GETLOGIN_R
10bc17b6
JH
670 char* _getlogin_buffer;
671 size_t _getlogin_size;
7c1815b7
KW
672# endif /* HAS_GETLOGIN_R */
673
674# ifdef HAS_GETNETBYNAME_R
f7937171 675 struct netent _netent_struct;
10bc17b6 676# if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 677 struct netent_data _netent_data;
10bc17b6 678# else
f7937171
JH
679 char* _netent_buffer;
680 size_t _netent_size;
10bc17b6 681# endif
f7937171
JH
682# ifdef USE_NETENT_PTR
683 struct netent* _netent_ptr;
10bc17b6 684# endif
f7937171
JH
685# ifdef USE_NETENT_ERRNO
686 int _netent_errno;
7c1815b7
KW
687# endif
688# endif /* HAS_GETNETBYNAME_R */
689
690# ifdef HAS_GETPROTOBYNAME_R
f7937171 691 struct protoent _protoent_struct;
10bc17b6 692# if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 693 struct protoent_data _protoent_data;
10bc17b6 694# else
f7937171
JH
695 char* _protoent_buffer;
696 size_t _protoent_size;
10bc17b6 697# endif
f7937171
JH
698# ifdef USE_PROTOENT_PTR
699 struct protoent* _protoent_ptr;
10bc17b6 700# endif
f7937171
JH
701# ifdef USE_PROTOENT_ERRNO
702 int _protoent_errno;
7c1815b7
KW
703# endif
704# endif /* HAS_GETPROTOBYNAME_R */
705
706# ifdef HAS_GETPWNAM_R
f7937171
JH
707 struct passwd _pwent_struct;
708 char* _pwent_buffer;
709 size_t _pwent_size;
710# ifdef USE_PWENT_PTR
711 struct passwd* _pwent_ptr;
10bc17b6 712# endif
f7937171
JH
713# ifdef USE_PWENT_FPTR
714 FILE* _pwent_fptr;
10bc17b6 715# endif
7c1815b7
KW
716# endif /* HAS_GETPWNAM_R */
717
718# ifdef HAS_GETSERVBYNAME_R
f7937171 719 struct servent _servent_struct;
10bc17b6 720# if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
f7937171 721 struct servent_data _servent_data;
10bc17b6 722# else
f7937171
JH
723 char* _servent_buffer;
724 size_t _servent_size;
10bc17b6 725# endif
f7937171
JH
726# ifdef USE_SERVENT_PTR
727 struct servent* _servent_ptr;
10bc17b6 728# endif
f7937171
JH
729# ifdef USE_SERVENT_ERRNO
730 int _servent_errno;
7c1815b7
KW
731# endif
732# endif /* HAS_GETSERVBYNAME_R */
733
734# ifdef HAS_GETSPNAM_R
f7937171
JH
735 struct spwd _spent_struct;
736 char* _spent_buffer;
737 size_t _spent_size;
738# ifdef USE_SPENT_PTR
739 struct spwd* _spent_ptr;
740# endif
741# ifdef USE_SPENT_FPTR
742 FILE* _spent_fptr;
10bc17b6 743# endif
7c1815b7
KW
744# endif /* HAS_GETSPNAM_R */
745
746# ifdef HAS_READDIR_R
10bc17b6
JH
747 struct dirent* _readdir_struct;
748 size_t _readdir_size;
749# if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
750 struct dirent* _readdir_ptr;
751# endif
7c1815b7
KW
752# endif /* HAS_READDIR_R */
753
754# ifdef HAS_READDIR64_R
10bc17b6
JH
755 struct dirent64* _readdir64_struct;
756 size_t _readdir64_size;
757# if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
758 struct dirent64* _readdir64_ptr;
759# endif
7c1815b7
KW
760# endif /* HAS_READDIR64_R */
761
762# ifdef HAS_SETLOCALE_R
10bc17b6
JH
763 char* _setlocale_buffer;
764 size_t _setlocale_size;
7c1815b7
KW
765# endif /* HAS_SETLOCALE_R */
766
767# ifdef HAS_STRERROR_R
10bc17b6
JH
768 char* _strerror_buffer;
769 size_t _strerror_size;
7c1815b7
KW
770# endif /* HAS_STRERROR_R */
771
772# ifdef HAS_TTYNAME_R
10bc17b6
JH
773 char* _ttyname_buffer;
774 size_t _ttyname_size;
7c1815b7
KW
775# endif /* HAS_TTYNAME_R */
776
10bc17b6 777
aa418cf1 778 int dummy; /* cannot have empty structs */
10bc17b6
JH
779} REENTR;
780
781/* The wrappers. */
782
7c1815b7 783# ifdef HAS_ASCTIME_R
d896b068 784# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
785# undef asctime
786# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
787# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
d4222de0 788# endif
10bc17b6
JH
789# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
790# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
d4222de0 791# endif
10bc17b6 792# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
b3b3b51f 793# define asctime(a) (asctime_r(a, PL_reentrant_buffer->_asctime_buffer) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
d4222de0 794# endif
10bc17b6 795# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
b3b3b51f 796# define asctime(a) (asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
d4222de0
RGS
797# endif
798# endif
7c1815b7
KW
799# endif /* HAS_ASCTIME_R */
800
10bc17b6 801
7c1815b7 802# ifdef HAS_CRYPT_R
d896b068 803# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
804# undef crypt
805# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
05404ffe 806# define crypt(a, b) crypt_r(a, b, PL_reentrant_buffer->_crypt_struct_buffer)
d4222de0 807# endif
b430fd04
JH
808# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
809# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_data)
d4222de0
RGS
810# endif
811# endif
7c1815b7
KW
812# endif /* HAS_CRYPT_R */
813
10bc17b6 814
7c1815b7 815# ifdef HAS_CTERMID_R
d896b068 816# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
817# undef ctermid
818# if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
819# define ctermid(a) ctermid_r(a)
d4222de0
RGS
820# endif
821# endif
7c1815b7 822# endif /* HAS_CTERMID_R */
10bc17b6 823
7c1815b7
KW
824
825# ifdef HAS_CTIME_R
d896b068 826# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
827# undef ctime
828# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
829# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
d4222de0 830# endif
10bc17b6
JH
831# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
832# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
d4222de0 833# endif
10bc17b6 834# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
b3b3b51f 835# define ctime(a) (ctime_r(a, PL_reentrant_buffer->_ctime_buffer) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
d4222de0 836# endif
10bc17b6 837# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
b3b3b51f 838# define ctime(a) (ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
d4222de0
RGS
839# endif
840# endif
7c1815b7
KW
841# endif /* HAS_CTIME_R */
842
10bc17b6 843
7c1815b7 844# ifdef HAS_ENDGRENT_R
d896b068 845# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
846# undef endgrent
847# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 848# define endgrent() (endgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
d4222de0 849# endif
10bc17b6 850# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 851# define endgrent() endgrent_r(&PL_reentrant_buffer->_grent_fptr)
d4222de0
RGS
852# endif
853# endif
7c1815b7 854# endif /* HAS_ENDGRENT_R */
10bc17b6 855
7c1815b7
KW
856
857# ifdef HAS_ENDHOSTENT_R
d896b068 858# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 859# undef endhostent
31ee0cb7 860# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 861# define endhostent() (endhostent_r(&PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
d4222de0 862# endif
31ee0cb7 863# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 864# define endhostent() endhostent_r(&PL_reentrant_buffer->_hostent_data)
d4222de0
RGS
865# endif
866# endif
7c1815b7
KW
867# endif /* HAS_ENDHOSTENT_R */
868
10bc17b6 869
7c1815b7 870# ifdef HAS_ENDNETENT_R
d896b068 871# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 872# undef endnetent
31ee0cb7 873# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 874# define endnetent() (endnetent_r(&PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
d4222de0 875# endif
31ee0cb7 876# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 877# define endnetent() endnetent_r(&PL_reentrant_buffer->_netent_data)
d4222de0
RGS
878# endif
879# endif
7c1815b7 880# endif /* HAS_ENDNETENT_R */
10bc17b6 881
7c1815b7
KW
882
883# ifdef HAS_ENDPROTOENT_R
d896b068 884# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 885# undef endprotoent
31ee0cb7 886# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 887# define endprotoent() (endprotoent_r(&PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
d4222de0 888# endif
31ee0cb7 889# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 890# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_protoent_data)
d4222de0
RGS
891# endif
892# endif
7c1815b7
KW
893# endif /* HAS_ENDPROTOENT_R */
894
10bc17b6 895
7c1815b7 896# ifdef HAS_ENDPWENT_R
d896b068 897# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
898# undef endpwent
899# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 900# define endpwent() (endpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
d4222de0 901# endif
10bc17b6 902# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 903# define endpwent() endpwent_r(&PL_reentrant_buffer->_pwent_fptr)
d4222de0
RGS
904# endif
905# endif
7c1815b7
KW
906# endif /* HAS_ENDPWENT_R */
907
10bc17b6 908
7c1815b7 909# ifdef HAS_ENDSERVENT_R
d896b068 910# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 911# undef endservent
31ee0cb7 912# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 913# define endservent() (endservent_r(&PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
d4222de0 914# endif
31ee0cb7 915# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 916# define endservent() endservent_r(&PL_reentrant_buffer->_servent_data)
d4222de0
RGS
917# endif
918# endif
7c1815b7 919# endif /* HAS_ENDSERVENT_R */
10bc17b6 920
7c1815b7
KW
921
922# ifdef HAS_GETGRENT_R
d896b068 923# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
924# undef getgrent
925# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 926# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0 927# endif
10bc17b6 928# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
b8dcbfa5 929# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0 930# endif
10bc17b6 931# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
f6f0b69b 932# define getgrent() (getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0 933# endif
10bc17b6 934# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 935# define getgrent() (getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0 936# endif
10bc17b6 937# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 938# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0 939# endif
10bc17b6 940# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
b8dcbfa5 941# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_fptr)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
d4222de0
RGS
942# endif
943# endif
7c1815b7
KW
944# endif /* HAS_GETGRENT_R */
945
10bc17b6 946
7c1815b7 947# ifdef HAS_GETGRGID_R
d896b068 948# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
949# undef getgrgid
950# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
b8dcbfa5 951# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
d4222de0 952# endif
10bc17b6 953# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
b8dcbfa5 954# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
d4222de0 955# endif
10bc17b6 956# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
b8dcbfa5 957# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
d4222de0 958# endif
10bc17b6 959# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
f6f0b69b 960# define getgrgid(a) (getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
d4222de0
RGS
961# endif
962# endif
7c1815b7
KW
963# endif /* HAS_GETGRGID_R */
964
10bc17b6 965
7c1815b7 966# ifdef HAS_GETGRNAM_R
d896b068 967# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
968# undef getgrnam
969# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 970# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
d4222de0 971# endif
10bc17b6 972# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
b8dcbfa5 973# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
d4222de0 974# endif
10bc17b6 975# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
f6f0b69b 976# define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? PL_reentrant_buffer->_grent_buffer : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
d4222de0 977# endif
10bc17b6 978# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 979# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
d4222de0 980# endif
10bc17b6 981# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 982# define getgrnam(a) (getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
d4222de0
RGS
983# endif
984# endif
7c1815b7 985# endif /* HAS_GETGRNAM_R */
10bc17b6 986
7c1815b7
KW
987
988# ifdef HAS_GETHOSTBYADDR_R
d896b068 989# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
990# undef gethostbyaddr
991# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
b8dcbfa5 992# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 993# endif
10bc17b6 994# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
f6f0b69b 995# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 996# endif
10bc17b6 997# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
f6f0b69b 998# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 999# endif
10bc17b6 1000# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
f6f0b69b 1001# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1002# endif
10bc17b6 1003# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
f6f0b69b 1004# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1005# endif
10bc17b6 1006# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
f6f0b69b 1007# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? 1 : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1008# endif
10bc17b6 1009# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
f6f0b69b 1010# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? 1 : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1011# endif
10bc17b6 1012# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
b8dcbfa5 1013# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1014# endif
10bc17b6 1015# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
b8dcbfa5 1016# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1017# endif
10bc17b6 1018# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
b8dcbfa5 1019# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c)) == 0 ? 1 : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0 1020# endif
a845a0d4 1021# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE
b8dcbfa5 1022# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
d4222de0
RGS
1023# endif
1024# endif
7c1815b7
KW
1025# endif /* HAS_GETHOSTBYADDR_R */
1026
10bc17b6 1027
7c1815b7 1028# ifdef HAS_GETHOSTBYNAME_R
d896b068 1029# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1030# undef gethostbyname
1031# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
b8dcbfa5 1032# define gethostbyname(a) ((PL_reentrant_retint = gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
d4222de0 1033# endif
10bc17b6 1034# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
f6f0b69b 1035# define gethostbyname(a) (gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
d4222de0 1036# endif
10bc17b6 1037# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
b8dcbfa5 1038# define gethostbyname(a) ((PL_reentrant_retint = gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
d4222de0
RGS
1039# endif
1040# endif
7c1815b7
KW
1041# endif /* HAS_GETHOSTBYNAME_R */
1042
10bc17b6 1043
7c1815b7 1044# ifdef HAS_GETHOSTENT_R
d896b068 1045# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1046# undef gethostent
1047# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
b8dcbfa5 1048# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0 1049# endif
10bc17b6 1050# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
b8dcbfa5 1051# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0 1052# endif
10bc17b6 1053# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
f6f0b69b 1054# define gethostent() (gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0 1055# endif
10bc17b6 1056# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1057# define gethostent() (gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0 1058# endif
10bc17b6 1059# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1060# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0 1061# endif
10bc17b6 1062# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
b8dcbfa5 1063# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
d4222de0
RGS
1064# endif
1065# endif
7c1815b7 1066# endif /* HAS_GETHOSTENT_R */
10bc17b6 1067
7c1815b7
KW
1068
1069# ifdef HAS_GETLOGIN_R
d896b068 1070# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1071# undef getlogin
1072# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
b8dcbfa5 1073# define getlogin() ((PL_reentrant_retint = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)) == 0 ? PL_reentrant_buffer->_getlogin_buffer : ((PL_reentrant_retint == ERANGE) ? (char *) Perl_reentrant_retry("getlogin") : 0))
d4222de0 1074# endif
10bc17b6 1075# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
b8dcbfa5 1076# define getlogin() ((PL_reentrant_retint = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)) == 0 ? PL_reentrant_buffer->_getlogin_buffer : ((PL_reentrant_retint == ERANGE) ? (char *) Perl_reentrant_retry("getlogin") : 0))
d4222de0 1077# endif
10bc17b6
JH
1078# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
1079# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
d4222de0 1080# endif
10bc17b6
JH
1081# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
1082# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
d4222de0
RGS
1083# endif
1084# endif
7c1815b7
KW
1085# endif /* HAS_GETLOGIN_R */
1086
10bc17b6 1087
7c1815b7 1088# ifdef HAS_GETNETBYADDR_R
d896b068 1089# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1090# undef getnetbyaddr
1091# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
b8dcbfa5 1092# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1093# endif
10bc17b6 1094# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
b8dcbfa5 1095# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1096# endif
10bc17b6 1097# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
f6f0b69b 1098# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1099# endif
10bc17b6 1100# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
f6f0b69b 1101# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1102# endif
10bc17b6 1103# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
b8dcbfa5 1104# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1105# endif
10bc17b6 1106# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
b8dcbfa5 1107# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1108# endif
10bc17b6 1109# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
b8dcbfa5 1110# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0 1111# endif
a845a0d4 1112# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE
b8dcbfa5 1113# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
d4222de0
RGS
1114# endif
1115# endif
7c1815b7 1116# endif /* HAS_GETNETBYADDR_R */
10bc17b6 1117
7c1815b7
KW
1118
1119# ifdef HAS_GETNETBYNAME_R
d896b068 1120# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1121# undef getnetbyname
1122# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
b8dcbfa5 1123# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
d4222de0 1124# endif
10bc17b6 1125# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 1126# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
d4222de0 1127# endif
10bc17b6 1128# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1129# define getnetbyname(a) (getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
d4222de0 1130# endif
10bc17b6 1131# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
b8dcbfa5 1132# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
d4222de0
RGS
1133# endif
1134# endif
7c1815b7
KW
1135# endif /* HAS_GETNETBYNAME_R */
1136
10bc17b6 1137
7c1815b7 1138# ifdef HAS_GETNETENT_R
d896b068 1139# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1140# undef getnetent
1141# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
b8dcbfa5 1142# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0 1143# endif
10bc17b6 1144# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
b8dcbfa5 1145# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_errno)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0 1146# endif
10bc17b6 1147# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
f6f0b69b 1148# define getnetent() (getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_errno) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0 1149# endif
10bc17b6 1150# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1151# define getnetent() (getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0 1152# endif
10bc17b6 1153# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1154# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0 1155# endif
10bc17b6 1156# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
b8dcbfa5 1157# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
d4222de0
RGS
1158# endif
1159# endif
7c1815b7 1160# endif /* HAS_GETNETENT_R */
10bc17b6 1161
7c1815b7
KW
1162
1163# ifdef HAS_GETPROTOBYNAME_R
d896b068 1164# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1165# undef getprotobyname
1166# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1167# define getprotobyname(a) ((PL_reentrant_retint = getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
d4222de0 1168# endif
10bc17b6 1169# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1170# define getprotobyname(a) (getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
d4222de0 1171# endif
10bc17b6 1172# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
3fb2f3ac 1173# define getprotobyname(a) (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data)),(PL_reentrant_retint = getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
d4222de0
RGS
1174# endif
1175# endif
7c1815b7
KW
1176# endif /* HAS_GETPROTOBYNAME_R */
1177
10bc17b6 1178
7c1815b7 1179# ifdef HAS_GETPROTOBYNUMBER_R
d896b068 1180# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1181# undef getprotobynumber
1182# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
b8dcbfa5 1183# define getprotobynumber(a) ((PL_reentrant_retint = getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
d4222de0 1184# endif
10bc17b6 1185# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
f6f0b69b 1186# define getprotobynumber(a) (getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
d4222de0 1187# endif
10bc17b6 1188# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
3fb2f3ac 1189# define getprotobynumber(a) (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data)),(PL_reentrant_retint = getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
d4222de0
RGS
1190# endif
1191# endif
7c1815b7
KW
1192# endif /* HAS_GETPROTOBYNUMBER_R */
1193
10bc17b6 1194
7c1815b7 1195# ifdef HAS_GETPROTOENT_R
d896b068 1196# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1197# undef getprotoent
1198# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1199# define getprotoent() ((PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
d4222de0 1200# endif
10bc17b6 1201# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1202# define getprotoent() ((PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
d4222de0 1203# endif
10bc17b6 1204# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1205# define getprotoent() (getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
d4222de0 1206# endif
10bc17b6 1207# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
3fb2f3ac 1208# define getprotoent() (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data)),(PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
d4222de0
RGS
1209# endif
1210# endif
7c1815b7 1211# endif /* HAS_GETPROTOENT_R */
10bc17b6 1212
7c1815b7
KW
1213
1214# ifdef HAS_GETPWENT_R
d896b068 1215# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1216# undef getpwent
1217# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1218# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0 1219# endif
10bc17b6 1220# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
b8dcbfa5 1221# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0 1222# endif
10bc17b6 1223# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
f6f0b69b 1224# define getpwent() (getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0 1225# endif
10bc17b6 1226# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1227# define getpwent() (getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0 1228# endif
10bc17b6 1229# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1230# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0 1231# endif
10bc17b6 1232# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
b8dcbfa5 1233# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_fptr)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
d4222de0
RGS
1234# endif
1235# endif
7c1815b7
KW
1236# endif /* HAS_GETPWENT_R */
1237
10bc17b6 1238
7c1815b7 1239# ifdef HAS_GETPWNAM_R
d896b068 1240# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1241# undef getpwnam
1242# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1243# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
d4222de0 1244# endif
10bc17b6 1245# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
b8dcbfa5 1246# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
d4222de0 1247# endif
10bc17b6 1248# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1249# define getpwnam(a) (getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
d4222de0 1250# endif
10bc17b6 1251# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 1252# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
d4222de0
RGS
1253# endif
1254# endif
7c1815b7 1255# endif /* HAS_GETPWNAM_R */
10bc17b6 1256
7c1815b7
KW
1257
1258# ifdef HAS_GETPWUID_R
d896b068 1259# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1260# undef getpwuid
1261# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
b8dcbfa5 1262# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
d4222de0 1263# endif
10bc17b6 1264# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
b8dcbfa5 1265# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
d4222de0 1266# endif
10bc17b6 1267# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
b8dcbfa5 1268# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
d4222de0 1269# endif
10bc17b6 1270# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
f6f0b69b 1271# define getpwuid(a) (getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
d4222de0
RGS
1272# endif
1273# endif
7c1815b7
KW
1274# endif /* HAS_GETPWUID_R */
1275
10bc17b6 1276
7c1815b7 1277# ifdef HAS_GETSERVBYNAME_R
d896b068 1278# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1279# undef getservbyname
1280# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
b8dcbfa5 1281# define getservbyname(a, b) ((PL_reentrant_retint = getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
d4222de0 1282# endif
10bc17b6 1283# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
f6f0b69b 1284# define getservbyname(a, b) (getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
d4222de0 1285# endif
10bc17b6 1286# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
3fb2f3ac 1287# define getservbyname(a, b) (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data)),(PL_reentrant_retint = getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
d4222de0
RGS
1288# endif
1289# endif
7c1815b7 1290# endif /* HAS_GETSERVBYNAME_R */
10bc17b6 1291
7c1815b7
KW
1292
1293# ifdef HAS_GETSERVBYPORT_R
d896b068 1294# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1295# undef getservbyport
1296# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
b8dcbfa5 1297# define getservbyport(a, b) ((PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
d4222de0 1298# endif
10bc17b6 1299# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
f6f0b69b 1300# define getservbyport(a, b) (getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
d4222de0 1301# endif
10bc17b6 1302# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
3fb2f3ac 1303# define getservbyport(a, b) (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data)),(PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
d4222de0
RGS
1304# endif
1305# endif
7c1815b7
KW
1306# endif /* HAS_GETSERVBYPORT_R */
1307
10bc17b6 1308
7c1815b7 1309# ifdef HAS_GETSERVENT_R
d896b068 1310# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1311# undef getservent
1312# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1313# define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
d4222de0 1314# endif
10bc17b6 1315# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1316# define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
d4222de0 1317# endif
10bc17b6 1318# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1319# define getservent() (getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
d4222de0 1320# endif
10bc17b6 1321# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
3fb2f3ac 1322# define getservent() (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data)),(PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
d4222de0
RGS
1323# endif
1324# endif
7c1815b7
KW
1325# endif /* HAS_GETSERVENT_R */
1326
10bc17b6 1327
7c1815b7 1328# ifdef HAS_GETSPNAM_R
d896b068 1329# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1330# undef getspnam
1331# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1332# define getspnam(a) ((PL_reentrant_retint = getspnam_r(a, &PL_reentrant_buffer->_spent_struct, PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size, &PL_reentrant_buffer->_spent_ptr)) == 0 ? PL_reentrant_buffer->_spent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct spwd *) Perl_reentrant_retry("getspnam", a) : 0))
d4222de0 1333# endif
10bc17b6 1334# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1335# define getspnam(a) (getspnam_r(a, &PL_reentrant_buffer->_spent_struct, PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size) ? &PL_reentrant_buffer->_spent_struct : ((errno == ERANGE) ? (struct spwd *) Perl_reentrant_retry("getspnam", a) : 0))
d4222de0
RGS
1336# endif
1337# endif
7c1815b7 1338# endif /* HAS_GETSPNAM_R */
10bc17b6 1339
7c1815b7
KW
1340
1341# ifdef HAS_READDIR_R
d896b068 1342# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1343# undef readdir
1344# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
b3b3b51f 1345# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
d4222de0 1346# endif
10bc17b6 1347# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
b3b3b51f 1348# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
d4222de0
RGS
1349# endif
1350# endif
7c1815b7
KW
1351# endif /* HAS_READDIR_R */
1352
10bc17b6 1353
7c1815b7 1354# ifdef HAS_READDIR64_R
d896b068 1355# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1356# undef readdir64
1357# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
b3b3b51f 1358# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
d4222de0 1359# endif
10bc17b6 1360# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
b3b3b51f 1361# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
d4222de0
RGS
1362# endif
1363# endif
7c1815b7 1364# endif /* HAS_READDIR64_R */
10bc17b6 1365
7c1815b7
KW
1366
1367# ifdef HAS_SETGRENT_R
d896b068 1368# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1369# undef setgrent
1370# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 1371# define setgrent() (setgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
d4222de0 1372# endif
10bc17b6 1373# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 1374# define setgrent() setgrent_r(&PL_reentrant_buffer->_grent_fptr)
d4222de0
RGS
1375# endif
1376# endif
7c1815b7
KW
1377# endif /* HAS_SETGRENT_R */
1378
10bc17b6 1379
7c1815b7 1380# ifdef HAS_SETHOSTENT_R
d896b068 1381# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1382# undef sethostent
1383# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1384# define sethostent(a) (sethostent_r(a, &PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
d4222de0 1385# endif
10bc17b6 1386# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1387# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_hostent_data)
d4222de0
RGS
1388# endif
1389# endif
7c1815b7 1390# endif /* HAS_SETHOSTENT_R */
10bc17b6 1391
7c1815b7
KW
1392
1393# ifdef HAS_SETLOCALE_R
d896b068 1394# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1395# undef setlocale
1396# if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
b3b3b51f 1397# define setlocale(a, b) (setlocale_r(a, b, PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size) == 0 ? PL_reentrant_buffer->_setlocale_buffer : 0)
d4222de0
RGS
1398# endif
1399# endif
7c1815b7
KW
1400# endif /* HAS_SETLOCALE_R */
1401
10bc17b6 1402
7c1815b7 1403# ifdef HAS_SETNETENT_R
d896b068 1404# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1405# undef setnetent
1406# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1407# define setnetent(a) (setnetent_r(a, &PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
d4222de0 1408# endif
10bc17b6 1409# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1410# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_netent_data)
d4222de0
RGS
1411# endif
1412# endif
7c1815b7
KW
1413# endif /* HAS_SETNETENT_R */
1414
10bc17b6 1415
7c1815b7 1416# ifdef HAS_SETPROTOENT_R
d896b068 1417# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1418# undef setprotoent
1419# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1420# define setprotoent(a) (setprotoent_r(a, &PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
d4222de0 1421# endif
10bc17b6 1422# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1423# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_protoent_data)
d4222de0
RGS
1424# endif
1425# endif
7c1815b7 1426# endif /* HAS_SETPROTOENT_R */
10bc17b6 1427
7c1815b7
KW
1428
1429# ifdef HAS_SETPWENT_R
d896b068 1430# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1431# undef setpwent
1432# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 1433# define setpwent() (setpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
d4222de0 1434# endif
10bc17b6 1435# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 1436# define setpwent() setpwent_r(&PL_reentrant_buffer->_pwent_fptr)
d4222de0
RGS
1437# endif
1438# endif
7c1815b7
KW
1439# endif /* HAS_SETPWENT_R */
1440
10bc17b6 1441
7c1815b7 1442# ifdef HAS_SETSERVENT_R
d896b068 1443# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1444# undef setservent
1445# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1446# define setservent(a) (setservent_r(a, &PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
d4222de0 1447# endif
10bc17b6 1448# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1449# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_servent_data)
d4222de0
RGS
1450# endif
1451# endif
7c1815b7
KW
1452# endif /* HAS_SETSERVENT_R */
1453
10bc17b6 1454
7c1815b7 1455# ifdef HAS_STRERROR_R
d896b068 1456# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1457# undef strerror
1458# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
b3b3b51f 1459# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
d4222de0 1460# endif
10bc17b6 1461# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
b3b3b51f 1462# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
d4222de0 1463# endif
10bc17b6
JH
1464# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
1465# define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
d4222de0
RGS
1466# endif
1467# endif
7c1815b7 1468# endif /* HAS_STRERROR_R */
10bc17b6 1469
7c1815b7
KW
1470
1471# ifdef HAS_TMPNAM_R
d896b068 1472# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1473# undef tmpnam
1474# if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
1475# define tmpnam(a) tmpnam_r(a)
d4222de0
RGS
1476# endif
1477# endif
7c1815b7
KW
1478# endif /* HAS_TMPNAM_R */
1479
10bc17b6 1480
7c1815b7 1481# ifdef HAS_TTYNAME_R
d896b068 1482# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1483# undef ttyname
1484# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
b3b3b51f 1485# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
d4222de0 1486# endif
10bc17b6 1487# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
b3b3b51f 1488# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
d4222de0 1489# endif
10bc17b6
JH
1490# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
1491# define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
d4222de0
RGS
1492# endif
1493# endif
7c1815b7 1494# endif /* HAS_TTYNAME_R */
10bc17b6
JH
1495
1496
0891a229 1497
10bc17b6 1498#endif /* USE_REENTRANT_API */
7c1815b7 1499
10bc17b6
JH
1500#endif
1501
37442d52 1502/* ex: set ro: */