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