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