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