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