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