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