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