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