This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Disable readdir_r and readdir64_r on glibc >= 2.24
[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
15#ifndef REENTR_H
37442d52 16#define 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
26# if defined(PERL_CORE) || defined(PERL_EXT)
27# define PERL_REENTR_API 1
28# else
29# define PERL_REENTR_API 0
30# endif
31#endif
32
10bc17b6
JH
33#ifdef USE_REENTRANT_API
34
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
JH
41
42#ifdef __hpux
43# undef HAS_CRYPT_R
efa45b01
JH
44# undef HAS_ENDGRENT_R
45# undef HAS_ENDPWENT_R
10bc17b6
JH
46# undef HAS_GETGRENT_R
47# undef HAS_GETPWENT_R
48# undef HAS_SETLOCALE_R
10bc17b6
JH
49# undef HAS_STRERROR_R
50# define NETDB_R_OBSOLETE
51#endif
52
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
58
c6709bf9
MB
59#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 24))
60# undef HAS_READDIR_R
61# undef HAS_READDIR64_R
62#endif
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 */
69#if defined(__OpenBSD__)
3fb2f3ac 70# define REENTR_MEMZERO(a,b) memzero(a,b)
d4b8ffd7 71#else
3fb2f3ac 72# define REENTR_MEMZERO(a,b) 0
d4b8ffd7
RGS
73#endif
74
10bc17b6
JH
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
10bc17b6
JH
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
117
118#define REENTRANT_PROTO_B_B 1
119#define REENTRANT_PROTO_B_BI 2
120#define REENTRANT_PROTO_B_BW 3
b430fd04
JH
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
31ee0cb7
JH
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
a7f3e46a
TC
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
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
210
211/* Any of the getgrent getgrgid getgrnam using buffer? */
212
213#if (defined(GETGRENT_R_HAS_BUFFER) || defined(GETGRGID_R_HAS_BUFFER) || defined(GETGRNAM_R_HAS_BUFFER))
f7937171 214# define USE_GRENT_BUFFER
edd309b7 215#else
f7937171 216# undef USE_GRENT_BUFFER
edd309b7
JH
217#endif
218
10bc17b6
JH
219/* The getgrent getgrgid getgrnam using ptr? */
220
09310450 221#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
10bc17b6
JH
222# define GETGRENT_R_HAS_PTR
223#else
224# undef GETGRENT_R_HAS_PTR
225#endif
09310450 226#if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
10bc17b6
JH
227# define GETGRGID_R_HAS_PTR
228#else
229# undef GETGRGID_R_HAS_PTR
230#endif
09310450 231#if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
10bc17b6
JH
232# define GETGRNAM_R_HAS_PTR
233#else
234# undef GETGRNAM_R_HAS_PTR
235#endif
236
237/* Any of the getgrent getgrgid getgrnam using ptr? */
238
239#if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
f7937171 240# define USE_GRENT_PTR
10bc17b6 241#else
f7937171 242# undef USE_GRENT_PTR
10bc17b6
JH
243#endif
244
245/* The getpwent getpwnam getpwuid using ptr? */
246
09310450 247#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
10bc17b6
JH
248# define GETPWENT_R_HAS_PTR
249#else
250# undef GETPWENT_R_HAS_PTR
251#endif
09310450 252#if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
10bc17b6
JH
253# define GETPWNAM_R_HAS_PTR
254#else
255# undef GETPWNAM_R_HAS_PTR
256#endif
09310450 257#if defined(HAS_GETPWUID_R) && (GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
10bc17b6
JH
258# define GETPWUID_R_HAS_PTR
259#else
260# undef GETPWUID_R_HAS_PTR
261#endif
262
263/* Any of the getpwent getpwnam getpwuid using ptr? */
264
265#if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
f7937171 266# define USE_PWENT_PTR
10bc17b6 267#else
f7937171 268# undef USE_PWENT_PTR
10bc17b6
JH
269#endif
270
271/* The getspent getspnam using ptr? */
272
09310450 273#if defined(HAS_GETSPNAM_R) && (GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR)
10bc17b6
JH
274# define GETSPNAM_R_HAS_PTR
275#else
276# undef GETSPNAM_R_HAS_PTR
277#endif
278
279/* Any of the getspent getspnam using ptr? */
280
281#if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
f7937171 282# define USE_SPENT_PTR
10bc17b6 283#else
f7937171 284# undef USE_SPENT_PTR
10bc17b6
JH
285#endif
286
f7937171 287/* The getgrent getgrgid getgrnam setgrent endgrent using fptr? */
10bc17b6 288
09310450 289#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
10bc17b6
JH
290# define GETGRENT_R_HAS_FPTR
291#else
292# undef GETGRENT_R_HAS_FPTR
293#endif
f7937171
JH
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
f7937171
JH
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
10bc17b6 309#else
f7937171 310# undef USE_GRENT_FPTR
10bc17b6
JH
311#endif
312
f7937171 313/* The getpwent getpwnam getpwuid setpwent endpwent using fptr? */
10bc17b6 314
09310450 315#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
10bc17b6
JH
316# define GETPWENT_R_HAS_FPTR
317#else
318# undef GETPWENT_R_HAS_FPTR
319#endif
f7937171
JH
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
f7937171
JH
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
10bc17b6 335#else
f7937171 336# undef USE_PWENT_FPTR
10bc17b6
JH
337#endif
338
edd309b7
JH
339/* The getpwent getpwgid getpwnam using buffer? */
340
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
351
352/* Any of the getpwent getpwgid getpwnam using buffer? */
353
354#if (defined(GETPWENT_R_HAS_BUFFER) || defined(GETPWGID_R_HAS_BUFFER) || defined(GETPWNAM_R_HAS_BUFFER))
f7937171 355# define USE_PWENT_BUFFER
edd309b7 356#else
f7937171 357# undef USE_PWENT_BUFFER
edd309b7
JH
358#endif
359
10bc17b6
JH
360/* The gethostent gethostbyaddr gethostbyname using ptr? */
361
09310450 362#if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
363# define GETHOSTENT_R_HAS_PTR
364#else
365# undef GETHOSTENT_R_HAS_PTR
366#endif
a845a0d4 367#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
10bc17b6
JH
368# define GETHOSTBYADDR_R_HAS_PTR
369#else
370# undef GETHOSTBYADDR_R_HAS_PTR
371#endif
09310450 372#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
373# define GETHOSTBYNAME_R_HAS_PTR
374#else
375# undef GETHOSTBYNAME_R_HAS_PTR
376#endif
377
378/* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
379
380#if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
f7937171 381# define USE_HOSTENT_PTR
10bc17b6 382#else
f7937171 383# undef USE_HOSTENT_PTR
10bc17b6
JH
384#endif
385
386/* The getnetent getnetbyaddr getnetbyname using ptr? */
387
09310450 388#if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
389# define GETNETENT_R_HAS_PTR
390#else
391# undef GETNETENT_R_HAS_PTR
392#endif
a845a0d4 393#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
10bc17b6
JH
394# define GETNETBYADDR_R_HAS_PTR
395#else
396# undef GETNETBYADDR_R_HAS_PTR
397#endif
09310450 398#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
399# define GETNETBYNAME_R_HAS_PTR
400#else
401# undef GETNETBYNAME_R_HAS_PTR
402#endif
403
404/* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
405
406#if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
f7937171 407# define USE_NETENT_PTR
10bc17b6 408#else
f7937171 409# undef USE_NETENT_PTR
10bc17b6
JH
410#endif
411
412/* The getprotoent getprotobyname getprotobynumber using ptr? */
413
09310450 414#if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
415# define GETPROTOENT_R_HAS_PTR
416#else
417# undef GETPROTOENT_R_HAS_PTR
418#endif
09310450 419#if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
10bc17b6
JH
420# define GETPROTOBYNAME_R_HAS_PTR
421#else
422# undef GETPROTOBYNAME_R_HAS_PTR
423#endif
09310450 424#if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
10bc17b6
JH
425# define GETPROTOBYNUMBER_R_HAS_PTR
426#else
427# undef GETPROTOBYNUMBER_R_HAS_PTR
428#endif
429
430/* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
431
432#if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
f7937171 433# define USE_PROTOENT_PTR
10bc17b6 434#else
f7937171 435# undef USE_PROTOENT_PTR
10bc17b6
JH
436#endif
437
438/* The getservent getservbyname getservbyport using ptr? */
439
09310450 440#if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
441# define GETSERVENT_R_HAS_PTR
442#else
443# undef GETSERVENT_R_HAS_PTR
444#endif
09310450 445#if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
10bc17b6
JH
446# define GETSERVBYNAME_R_HAS_PTR
447#else
448# undef GETSERVBYNAME_R_HAS_PTR
449#endif
09310450 450#if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
10bc17b6
JH
451# define GETSERVBYPORT_R_HAS_PTR
452#else
453# undef GETSERVBYPORT_R_HAS_PTR
454#endif
455
456/* Any of the getservent getservbyname getservbyport using ptr? */
457
458#if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
f7937171 459# define USE_SERVENT_PTR
10bc17b6 460#else
f7937171 461# undef USE_SERVENT_PTR
10bc17b6
JH
462#endif
463
edd309b7
JH
464/* The gethostent gethostbyaddr gethostbyname using buffer? */
465
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
a845a0d4 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)
edd309b7
JH
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
481
482/* Any of the gethostent gethostbyaddr gethostbyname using buffer? */
483
484#if (defined(GETHOSTENT_R_HAS_BUFFER) || defined(GETHOSTBYADDR_R_HAS_BUFFER) || defined(GETHOSTBYNAME_R_HAS_BUFFER))
f7937171 485# define USE_HOSTENT_BUFFER
edd309b7 486#else
f7937171 487# undef USE_HOSTENT_BUFFER
edd309b7
JH
488#endif
489
490/* The getnetent getnetbyaddr getnetbyname using buffer? */
491
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
a845a0d4 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)
edd309b7
JH
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
507
508/* Any of the getnetent getnetbyaddr getnetbyname using buffer? */
509
510#if (defined(GETNETENT_R_HAS_BUFFER) || defined(GETNETBYADDR_R_HAS_BUFFER) || defined(GETNETBYNAME_R_HAS_BUFFER))
f7937171 511# define USE_NETENT_BUFFER
edd309b7 512#else
f7937171 513# undef USE_NETENT_BUFFER
edd309b7
JH
514#endif
515
516/* The getprotoent getprotobyname getprotobynumber using buffer? */
517
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
533
534/* Any of the getprotoent getprotobyname getprotobynumber using buffer? */
535
536#if (defined(GETPROTOENT_R_HAS_BUFFER) || defined(GETPROTOBYNAME_R_HAS_BUFFER) || defined(GETPROTOBYNUMBER_R_HAS_BUFFER))
f7937171 537# define USE_PROTOENT_BUFFER
edd309b7 538#else
f7937171 539# undef USE_PROTOENT_BUFFER
edd309b7
JH
540#endif
541
542/* The getservent getservbyname getservbyport using buffer? */
543
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
559
560/* Any of the getservent getservbyname getservbyport using buffer? */
561
562#if (defined(GETSERVENT_R_HAS_BUFFER) || defined(GETSERVBYNAME_R_HAS_BUFFER) || defined(GETSERVBYPORT_R_HAS_BUFFER))
f7937171 563# define USE_SERVENT_BUFFER
edd309b7 564#else
f7937171 565# undef USE_SERVENT_BUFFER
edd309b7
JH
566#endif
567
10bc17b6
JH
568/* The gethostent gethostbyaddr gethostbyname using errno? */
569
09310450 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)
10bc17b6
JH
571# define GETHOSTENT_R_HAS_ERRNO
572#else
573# undef GETHOSTENT_R_HAS_ERRNO
574#endif
a845a0d4 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)
10bc17b6
JH
576# define GETHOSTBYADDR_R_HAS_ERRNO
577#else
578# undef GETHOSTBYADDR_R_HAS_ERRNO
579#endif
09310450 580#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
10bc17b6
JH
581# define GETHOSTBYNAME_R_HAS_ERRNO
582#else
583# undef GETHOSTBYNAME_R_HAS_ERRNO
584#endif
585
586/* Any of the gethostent gethostbyaddr gethostbyname using errno? */
587
588#if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
f7937171 589# define USE_HOSTENT_ERRNO
10bc17b6 590#else
f7937171 591# undef USE_HOSTENT_ERRNO
10bc17b6
JH
592#endif
593
594/* The getnetent getnetbyaddr getnetbyname using errno? */
595
09310450 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)
10bc17b6
JH
597# define GETNETENT_R_HAS_ERRNO
598#else
599# undef GETNETENT_R_HAS_ERRNO
600#endif
a845a0d4 601#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
10bc17b6
JH
602# define GETNETBYADDR_R_HAS_ERRNO
603#else
604# undef GETNETBYADDR_R_HAS_ERRNO
605#endif
09310450 606#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
607# define GETNETBYNAME_R_HAS_ERRNO
608#else
609# undef GETNETBYNAME_R_HAS_ERRNO
610#endif
611
612/* Any of the getnetent getnetbyaddr getnetbyname using errno? */
613
614#if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
f7937171 615# define USE_NETENT_ERRNO
10bc17b6 616#else
f7937171 617# undef USE_NETENT_ERRNO
10bc17b6
JH
618#endif
619
620
621typedef struct {
622#ifdef HAS_ASCTIME_R
623 char* _asctime_buffer;
624 size_t _asctime_size;
625#endif /* HAS_ASCTIME_R */
626#ifdef HAS_CRYPT_R
b430fd04
JH
627#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
628 CRYPTD* _crypt_data;
629#else
05404ffe 630 struct crypt_data *_crypt_struct_buffer;
b430fd04 631#endif
10bc17b6
JH
632#endif /* HAS_CRYPT_R */
633#ifdef HAS_CTIME_R
634 char* _ctime_buffer;
635 size_t _ctime_size;
636#endif /* HAS_CTIME_R */
10bc17b6 637#ifdef HAS_GETGRNAM_R
f7937171
JH
638 struct group _grent_struct;
639 char* _grent_buffer;
640 size_t _grent_size;
641# ifdef USE_GRENT_PTR
642 struct group* _grent_ptr;
10bc17b6 643# endif
f7937171
JH
644# ifdef USE_GRENT_FPTR
645 FILE* _grent_fptr;
10bc17b6
JH
646# endif
647#endif /* HAS_GETGRNAM_R */
648#ifdef HAS_GETHOSTBYNAME_R
f7937171 649 struct hostent _hostent_struct;
10bc17b6 650# if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 651 struct hostent_data _hostent_data;
10bc17b6 652# else
f7937171
JH
653 char* _hostent_buffer;
654 size_t _hostent_size;
10bc17b6 655# endif
f7937171
JH
656# ifdef USE_HOSTENT_PTR
657 struct hostent* _hostent_ptr;
10bc17b6 658# endif
f7937171
JH
659# ifdef USE_HOSTENT_ERRNO
660 int _hostent_errno;
10bc17b6
JH
661# endif
662#endif /* HAS_GETHOSTBYNAME_R */
663#ifdef HAS_GETLOGIN_R
664 char* _getlogin_buffer;
665 size_t _getlogin_size;
666#endif /* HAS_GETLOGIN_R */
667#ifdef HAS_GETNETBYNAME_R
f7937171 668 struct netent _netent_struct;
10bc17b6 669# if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 670 struct netent_data _netent_data;
10bc17b6 671# else
f7937171
JH
672 char* _netent_buffer;
673 size_t _netent_size;
10bc17b6 674# endif
f7937171
JH
675# ifdef USE_NETENT_PTR
676 struct netent* _netent_ptr;
10bc17b6 677# endif
f7937171
JH
678# ifdef USE_NETENT_ERRNO
679 int _netent_errno;
10bc17b6
JH
680# endif
681#endif /* HAS_GETNETBYNAME_R */
682#ifdef HAS_GETPROTOBYNAME_R
f7937171 683 struct protoent _protoent_struct;
10bc17b6 684# if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
f7937171 685 struct protoent_data _protoent_data;
10bc17b6 686# else
f7937171
JH
687 char* _protoent_buffer;
688 size_t _protoent_size;
10bc17b6 689# endif
f7937171
JH
690# ifdef USE_PROTOENT_PTR
691 struct protoent* _protoent_ptr;
10bc17b6 692# endif
f7937171
JH
693# ifdef USE_PROTOENT_ERRNO
694 int _protoent_errno;
10bc17b6
JH
695# endif
696#endif /* HAS_GETPROTOBYNAME_R */
697#ifdef HAS_GETPWNAM_R
f7937171
JH
698 struct passwd _pwent_struct;
699 char* _pwent_buffer;
700 size_t _pwent_size;
701# ifdef USE_PWENT_PTR
702 struct passwd* _pwent_ptr;
10bc17b6 703# endif
f7937171
JH
704# ifdef USE_PWENT_FPTR
705 FILE* _pwent_fptr;
10bc17b6
JH
706# endif
707#endif /* HAS_GETPWNAM_R */
708#ifdef HAS_GETSERVBYNAME_R
f7937171 709 struct servent _servent_struct;
10bc17b6 710# if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
f7937171 711 struct servent_data _servent_data;
10bc17b6 712# else
f7937171
JH
713 char* _servent_buffer;
714 size_t _servent_size;
10bc17b6 715# endif
f7937171
JH
716# ifdef USE_SERVENT_PTR
717 struct servent* _servent_ptr;
10bc17b6 718# endif
f7937171
JH
719# ifdef USE_SERVENT_ERRNO
720 int _servent_errno;
10bc17b6
JH
721# endif
722#endif /* HAS_GETSERVBYNAME_R */
723#ifdef HAS_GETSPNAM_R
f7937171
JH
724 struct spwd _spent_struct;
725 char* _spent_buffer;
726 size_t _spent_size;
727# ifdef USE_SPENT_PTR
728 struct spwd* _spent_ptr;
729# endif
730# ifdef USE_SPENT_FPTR
731 FILE* _spent_fptr;
10bc17b6
JH
732# endif
733#endif /* HAS_GETSPNAM_R */
10bc17b6
JH
734#ifdef HAS_READDIR_R
735 struct dirent* _readdir_struct;
736 size_t _readdir_size;
737# if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
738 struct dirent* _readdir_ptr;
739# endif
740#endif /* HAS_READDIR_R */
741#ifdef HAS_READDIR64_R
742 struct dirent64* _readdir64_struct;
743 size_t _readdir64_size;
744# if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
745 struct dirent64* _readdir64_ptr;
746# endif
747#endif /* HAS_READDIR64_R */
748#ifdef HAS_SETLOCALE_R
749 char* _setlocale_buffer;
750 size_t _setlocale_size;
751#endif /* HAS_SETLOCALE_R */
752#ifdef HAS_STRERROR_R
753 char* _strerror_buffer;
754 size_t _strerror_size;
755#endif /* HAS_STRERROR_R */
756#ifdef HAS_TTYNAME_R
757 char* _ttyname_buffer;
758 size_t _ttyname_size;
759#endif /* HAS_TTYNAME_R */
760
aa418cf1 761 int dummy; /* cannot have empty structs */
10bc17b6
JH
762} REENTR;
763
764/* The wrappers. */
765
766#ifdef HAS_ASCTIME_R
d896b068 767# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
768# undef asctime
769# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
770# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
d4222de0 771# endif
10bc17b6
JH
772# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
773# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
d4222de0 774# endif
10bc17b6 775# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
b3b3b51f 776# define asctime(a) (asctime_r(a, PL_reentrant_buffer->_asctime_buffer) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
d4222de0 777# endif
10bc17b6 778# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
b3b3b51f 779# 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
780# endif
781# endif
10bc17b6
JH
782#endif /* HAS_ASCTIME_R */
783
784#ifdef HAS_CRYPT_R
d896b068 785# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
786# undef crypt
787# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
05404ffe 788# define crypt(a, b) crypt_r(a, b, PL_reentrant_buffer->_crypt_struct_buffer)
d4222de0 789# endif
b430fd04
JH
790# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
791# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_data)
d4222de0
RGS
792# endif
793# endif
10bc17b6
JH
794#endif /* HAS_CRYPT_R */
795
796#ifdef HAS_CTERMID_R
d896b068 797# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
798# undef ctermid
799# if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
800# define ctermid(a) ctermid_r(a)
d4222de0
RGS
801# endif
802# endif
10bc17b6
JH
803#endif /* HAS_CTERMID_R */
804
805#ifdef HAS_CTIME_R
d896b068 806# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
807# undef ctime
808# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
809# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
d4222de0 810# endif
10bc17b6
JH
811# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
812# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
d4222de0 813# endif
10bc17b6 814# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
b3b3b51f 815# define ctime(a) (ctime_r(a, PL_reentrant_buffer->_ctime_buffer) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
d4222de0 816# endif
10bc17b6 817# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
b3b3b51f 818# 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
819# endif
820# endif
10bc17b6
JH
821#endif /* HAS_CTIME_R */
822
10bc17b6 823#ifdef HAS_ENDGRENT_R
d896b068 824# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
825# undef endgrent
826# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 827# define endgrent() (endgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
d4222de0 828# endif
10bc17b6 829# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 830# define endgrent() endgrent_r(&PL_reentrant_buffer->_grent_fptr)
d4222de0
RGS
831# endif
832# endif
10bc17b6
JH
833#endif /* HAS_ENDGRENT_R */
834
835#ifdef HAS_ENDHOSTENT_R
d896b068 836# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 837# undef endhostent
31ee0cb7 838# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 839# define endhostent() (endhostent_r(&PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
d4222de0 840# endif
31ee0cb7 841# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 842# define endhostent() endhostent_r(&PL_reentrant_buffer->_hostent_data)
d4222de0
RGS
843# endif
844# endif
10bc17b6
JH
845#endif /* HAS_ENDHOSTENT_R */
846
847#ifdef HAS_ENDNETENT_R
d896b068 848# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 849# undef endnetent
31ee0cb7 850# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 851# define endnetent() (endnetent_r(&PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
d4222de0 852# endif
31ee0cb7 853# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 854# define endnetent() endnetent_r(&PL_reentrant_buffer->_netent_data)
d4222de0
RGS
855# endif
856# endif
10bc17b6
JH
857#endif /* HAS_ENDNETENT_R */
858
859#ifdef HAS_ENDPROTOENT_R
d896b068 860# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 861# undef endprotoent
31ee0cb7 862# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 863# define endprotoent() (endprotoent_r(&PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
d4222de0 864# endif
31ee0cb7 865# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 866# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_protoent_data)
d4222de0
RGS
867# endif
868# endif
10bc17b6
JH
869#endif /* HAS_ENDPROTOENT_R */
870
871#ifdef HAS_ENDPWENT_R
d896b068 872# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
873# undef endpwent
874# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 875# define endpwent() (endpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
d4222de0 876# endif
10bc17b6 877# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 878# define endpwent() endpwent_r(&PL_reentrant_buffer->_pwent_fptr)
d4222de0
RGS
879# endif
880# endif
10bc17b6
JH
881#endif /* HAS_ENDPWENT_R */
882
883#ifdef HAS_ENDSERVENT_R
d896b068 884# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6 885# undef endservent
31ee0cb7 886# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_D
b3b3b51f 887# define endservent() (endservent_r(&PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
d4222de0 888# endif
31ee0cb7 889# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_D
f7937171 890# define endservent() endservent_r(&PL_reentrant_buffer->_servent_data)
d4222de0
RGS
891# endif
892# endif
10bc17b6
JH
893#endif /* HAS_ENDSERVENT_R */
894
895#ifdef HAS_GETGRENT_R
d896b068 896# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
897# undef getgrent
898# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 899# 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 900# endif
10bc17b6 901# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
b8dcbfa5 902# 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 903# endif
10bc17b6 904# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
f6f0b69b 905# 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 906# endif
10bc17b6 907# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 908# 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 909# endif
10bc17b6 910# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 911# 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 912# endif
10bc17b6 913# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
b8dcbfa5 914# 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
915# endif
916# endif
10bc17b6
JH
917#endif /* HAS_GETGRENT_R */
918
919#ifdef HAS_GETGRGID_R
d896b068 920# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
921# undef getgrgid
922# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
b8dcbfa5 923# 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 924# endif
10bc17b6 925# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
b8dcbfa5 926# 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 927# endif
10bc17b6 928# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
b8dcbfa5 929# 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 930# endif
10bc17b6 931# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
f6f0b69b 932# 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
933# endif
934# endif
10bc17b6
JH
935#endif /* HAS_GETGRGID_R */
936
937#ifdef HAS_GETGRNAM_R
d896b068 938# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
939# undef getgrnam
940# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 941# 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 942# endif
10bc17b6 943# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
b8dcbfa5 944# 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 945# endif
10bc17b6 946# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
f6f0b69b 947# 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 948# endif
10bc17b6 949# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 950# 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 951# endif
10bc17b6 952# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 953# 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
954# endif
955# endif
10bc17b6
JH
956#endif /* HAS_GETGRNAM_R */
957
958#ifdef HAS_GETHOSTBYADDR_R
d896b068 959# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
960# undef gethostbyaddr
961# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
b8dcbfa5 962# 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 963# endif
10bc17b6 964# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
f6f0b69b 965# 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 966# endif
10bc17b6 967# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
f6f0b69b 968# 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 969# endif
10bc17b6 970# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
f6f0b69b 971# 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 972# endif
10bc17b6 973# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
f6f0b69b 974# 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 975# endif
10bc17b6 976# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
f6f0b69b 977# 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 978# endif
10bc17b6 979# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
f6f0b69b 980# 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 981# endif
10bc17b6 982# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
b8dcbfa5 983# 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 984# endif
10bc17b6 985# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
b8dcbfa5 986# 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 987# endif
10bc17b6 988# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
b8dcbfa5 989# 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 990# endif
a845a0d4 991# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE
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
RGS
993# endif
994# endif
10bc17b6
JH
995#endif /* HAS_GETHOSTBYADDR_R */
996
997#ifdef HAS_GETHOSTBYNAME_R
d896b068 998# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
999# undef gethostbyname
1000# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
b8dcbfa5 1001# 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 1002# endif
10bc17b6 1003# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
f6f0b69b 1004# 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 1005# endif
10bc17b6 1006# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
b8dcbfa5 1007# 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
1008# endif
1009# endif
10bc17b6
JH
1010#endif /* HAS_GETHOSTBYNAME_R */
1011
1012#ifdef HAS_GETHOSTENT_R
d896b068 1013# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1014# undef gethostent
1015# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
b8dcbfa5 1016# 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 1017# endif
10bc17b6 1018# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
b8dcbfa5 1019# 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 1020# endif
10bc17b6 1021# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
f6f0b69b 1022# 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 1023# endif
10bc17b6 1024# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1025# 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 1026# endif
10bc17b6 1027# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1028# 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 1029# endif
10bc17b6 1030# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
b8dcbfa5 1031# 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
1032# endif
1033# endif
10bc17b6
JH
1034#endif /* HAS_GETHOSTENT_R */
1035
1036#ifdef HAS_GETLOGIN_R
d896b068 1037# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1038# undef getlogin
1039# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
b8dcbfa5 1040# 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 1041# endif
10bc17b6 1042# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
b8dcbfa5 1043# 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 1044# endif
10bc17b6
JH
1045# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
1046# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
d4222de0 1047# endif
10bc17b6
JH
1048# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
1049# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
d4222de0
RGS
1050# endif
1051# endif
10bc17b6
JH
1052#endif /* HAS_GETLOGIN_R */
1053
1054#ifdef HAS_GETNETBYADDR_R
d896b068 1055# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1056# undef getnetbyaddr
1057# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
b8dcbfa5 1058# 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 1059# endif
10bc17b6 1060# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
b8dcbfa5 1061# 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 1062# endif
10bc17b6 1063# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
f6f0b69b 1064# 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 1065# endif
10bc17b6 1066# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
f6f0b69b 1067# 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 1068# endif
10bc17b6 1069# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
b8dcbfa5 1070# 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 1071# endif
10bc17b6 1072# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
b8dcbfa5 1073# 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 1074# endif
10bc17b6 1075# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
b8dcbfa5 1076# 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 1077# endif
a845a0d4 1078# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE
b8dcbfa5 1079# 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
1080# endif
1081# endif
10bc17b6
JH
1082#endif /* HAS_GETNETBYADDR_R */
1083
1084#ifdef HAS_GETNETBYNAME_R
d896b068 1085# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1086# undef getnetbyname
1087# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
b8dcbfa5 1088# 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 1089# endif
10bc17b6 1090# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 1091# 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 1092# endif
10bc17b6 1093# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1094# 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 1095# endif
10bc17b6 1096# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
b8dcbfa5 1097# 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
1098# endif
1099# endif
10bc17b6
JH
1100#endif /* HAS_GETNETBYNAME_R */
1101
1102#ifdef HAS_GETNETENT_R
d896b068 1103# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1104# undef getnetent
1105# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
b8dcbfa5 1106# 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 1107# endif
10bc17b6 1108# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
b8dcbfa5 1109# 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 1110# endif
10bc17b6 1111# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
f6f0b69b 1112# 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 1113# endif
10bc17b6 1114# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1115# 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 1116# endif
10bc17b6 1117# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1118# 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 1119# endif
10bc17b6 1120# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
b8dcbfa5 1121# 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
1122# endif
1123# endif
10bc17b6
JH
1124#endif /* HAS_GETNETENT_R */
1125
1126#ifdef HAS_GETPROTOBYNAME_R
d896b068 1127# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1128# undef getprotobyname
1129# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1130# 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 1131# endif
10bc17b6 1132# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1133# 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 1134# endif
10bc17b6 1135# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
3fb2f3ac 1136# 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
1137# endif
1138# endif
10bc17b6
JH
1139#endif /* HAS_GETPROTOBYNAME_R */
1140
1141#ifdef HAS_GETPROTOBYNUMBER_R
d896b068 1142# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1143# undef getprotobynumber
1144# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
b8dcbfa5 1145# 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 1146# endif
10bc17b6 1147# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
f6f0b69b 1148# 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 1149# endif
10bc17b6 1150# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
3fb2f3ac 1151# 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
1152# endif
1153# endif
10bc17b6
JH
1154#endif /* HAS_GETPROTOBYNUMBER_R */
1155
1156#ifdef HAS_GETPROTOENT_R
d896b068 1157# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1158# undef getprotoent
1159# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1160# 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 1161# endif
10bc17b6 1162# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1163# 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 1164# endif
10bc17b6 1165# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1166# 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 1167# endif
10bc17b6 1168# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
3fb2f3ac 1169# 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
1170# endif
1171# endif
10bc17b6
JH
1172#endif /* HAS_GETPROTOENT_R */
1173
1174#ifdef HAS_GETPWENT_R
d896b068 1175# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1176# undef getpwent
1177# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1178# 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 1179# endif
10bc17b6 1180# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
b8dcbfa5 1181# 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 1182# endif
10bc17b6 1183# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
f6f0b69b 1184# 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 1185# endif
10bc17b6 1186# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1187# 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 1188# endif
10bc17b6 1189# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1190# 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 1191# endif
10bc17b6 1192# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
b8dcbfa5 1193# 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
1194# endif
1195# endif
10bc17b6
JH
1196#endif /* HAS_GETPWENT_R */
1197
1198#ifdef HAS_GETPWNAM_R
d896b068 1199# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1200# undef getpwnam
1201# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1202# 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 1203# endif
10bc17b6 1204# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
b8dcbfa5 1205# 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 1206# endif
10bc17b6 1207# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1208# 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 1209# endif
10bc17b6 1210# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
b8dcbfa5 1211# 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
1212# endif
1213# endif
10bc17b6
JH
1214#endif /* HAS_GETPWNAM_R */
1215
1216#ifdef HAS_GETPWUID_R
d896b068 1217# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1218# undef getpwuid
1219# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
b8dcbfa5 1220# 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 1221# endif
10bc17b6 1222# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
b8dcbfa5 1223# 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 1224# endif
10bc17b6 1225# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
b8dcbfa5 1226# 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 1227# endif
10bc17b6 1228# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
f6f0b69b 1229# 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
1230# endif
1231# endif
10bc17b6
JH
1232#endif /* HAS_GETPWUID_R */
1233
1234#ifdef HAS_GETSERVBYNAME_R
d896b068 1235# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1236# undef getservbyname
1237# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
b8dcbfa5 1238# 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 1239# endif
10bc17b6 1240# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
f6f0b69b 1241# 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 1242# endif
10bc17b6 1243# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
3fb2f3ac 1244# 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
1245# endif
1246# endif
10bc17b6
JH
1247#endif /* HAS_GETSERVBYNAME_R */
1248
1249#ifdef HAS_GETSERVBYPORT_R
d896b068 1250# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1251# undef getservbyport
1252# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
b8dcbfa5 1253# 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 1254# endif
10bc17b6 1255# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
f6f0b69b 1256# 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 1257# endif
10bc17b6 1258# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
3fb2f3ac 1259# 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
1260# endif
1261# endif
10bc17b6
JH
1262#endif /* HAS_GETSERVBYPORT_R */
1263
1264#ifdef HAS_GETSERVENT_R
d896b068 1265# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1266# undef getservent
1267# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
b8dcbfa5 1268# 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 1269# endif
10bc17b6 1270# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
b8dcbfa5 1271# 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 1272# endif
10bc17b6 1273# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
f6f0b69b 1274# 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 1275# endif
10bc17b6 1276# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
3fb2f3ac 1277# 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
1278# endif
1279# endif
10bc17b6
JH
1280#endif /* HAS_GETSERVENT_R */
1281
1282#ifdef HAS_GETSPNAM_R
d896b068 1283# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1284# undef getspnam
1285# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
b8dcbfa5 1286# 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 1287# endif
10bc17b6 1288# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
f6f0b69b 1289# 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
1290# endif
1291# endif
10bc17b6
JH
1292#endif /* HAS_GETSPNAM_R */
1293
10bc17b6 1294#ifdef HAS_READDIR_R
d896b068 1295# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1296# undef readdir
1297# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
b3b3b51f 1298# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
d4222de0 1299# endif
10bc17b6 1300# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
b3b3b51f 1301# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
d4222de0
RGS
1302# endif
1303# endif
10bc17b6
JH
1304#endif /* HAS_READDIR_R */
1305
1306#ifdef HAS_READDIR64_R
d896b068 1307# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1308# undef readdir64
1309# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
b3b3b51f 1310# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
d4222de0 1311# endif
10bc17b6 1312# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
b3b3b51f 1313# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
d4222de0
RGS
1314# endif
1315# endif
10bc17b6
JH
1316#endif /* HAS_READDIR64_R */
1317
1318#ifdef HAS_SETGRENT_R
d896b068 1319# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1320# undef setgrent
1321# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 1322# define setgrent() (setgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
d4222de0 1323# endif
10bc17b6 1324# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 1325# define setgrent() setgrent_r(&PL_reentrant_buffer->_grent_fptr)
d4222de0
RGS
1326# endif
1327# endif
10bc17b6
JH
1328#endif /* HAS_SETGRENT_R */
1329
1330#ifdef HAS_SETHOSTENT_R
d896b068 1331# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1332# undef sethostent
1333# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1334# define sethostent(a) (sethostent_r(a, &PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
d4222de0 1335# endif
10bc17b6 1336# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1337# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_hostent_data)
d4222de0
RGS
1338# endif
1339# endif
10bc17b6
JH
1340#endif /* HAS_SETHOSTENT_R */
1341
1342#ifdef HAS_SETLOCALE_R
d896b068 1343# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1344# undef setlocale
1345# if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
b3b3b51f 1346# 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
1347# endif
1348# endif
10bc17b6
JH
1349#endif /* HAS_SETLOCALE_R */
1350
1351#ifdef HAS_SETNETENT_R
d896b068 1352# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1353# undef setnetent
1354# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1355# define setnetent(a) (setnetent_r(a, &PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
d4222de0 1356# endif
10bc17b6 1357# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1358# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_netent_data)
d4222de0
RGS
1359# endif
1360# endif
10bc17b6
JH
1361#endif /* HAS_SETNETENT_R */
1362
1363#ifdef HAS_SETPROTOENT_R
d896b068 1364# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1365# undef setprotoent
1366# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1367# define setprotoent(a) (setprotoent_r(a, &PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
d4222de0 1368# endif
10bc17b6 1369# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1370# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_protoent_data)
d4222de0
RGS
1371# endif
1372# endif
10bc17b6
JH
1373#endif /* HAS_SETPROTOENT_R */
1374
1375#ifdef HAS_SETPWENT_R
d896b068 1376# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1377# undef setpwent
1378# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
b3b3b51f 1379# define setpwent() (setpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
d4222de0 1380# endif
10bc17b6 1381# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
f7937171 1382# define setpwent() setpwent_r(&PL_reentrant_buffer->_pwent_fptr)
d4222de0
RGS
1383# endif
1384# endif
10bc17b6
JH
1385#endif /* HAS_SETPWENT_R */
1386
1387#ifdef HAS_SETSERVENT_R
d896b068 1388# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1389# undef setservent
1390# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
b3b3b51f 1391# define setservent(a) (setservent_r(a, &PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
d4222de0 1392# endif
10bc17b6 1393# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
f7937171 1394# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_servent_data)
d4222de0
RGS
1395# endif
1396# endif
10bc17b6
JH
1397#endif /* HAS_SETSERVENT_R */
1398
10bc17b6 1399#ifdef HAS_STRERROR_R
d896b068 1400# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1401# undef strerror
1402# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
b3b3b51f 1403# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
d4222de0 1404# endif
10bc17b6 1405# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
b3b3b51f 1406# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
d4222de0 1407# endif
10bc17b6
JH
1408# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
1409# define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
d4222de0
RGS
1410# endif
1411# endif
10bc17b6
JH
1412#endif /* HAS_STRERROR_R */
1413
1414#ifdef HAS_TMPNAM_R
d896b068 1415# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1416# undef tmpnam
1417# if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
1418# define tmpnam(a) tmpnam_r(a)
d4222de0
RGS
1419# endif
1420# endif
10bc17b6
JH
1421#endif /* HAS_TMPNAM_R */
1422
1423#ifdef HAS_TTYNAME_R
d896b068 1424# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
10bc17b6
JH
1425# undef ttyname
1426# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
b3b3b51f 1427# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
d4222de0 1428# endif
10bc17b6 1429# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
b3b3b51f 1430# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
d4222de0 1431# endif
10bc17b6
JH
1432# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
1433# define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
d4222de0
RGS
1434# endif
1435# endif
10bc17b6
JH
1436#endif /* HAS_TTYNAME_R */
1437
1438
0891a229 1439
10bc17b6
JH
1440#endif /* USE_REENTRANT_API */
1441
1442#endif
1443
37442d52 1444/* ex: set ro: */