This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The I_CSD, I_S, and V_S had wrong recepting datatype.
[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))
186# define USE_GETGRENT_BUFFER
187#else
188# undef USE_GETGRENT_BUFFER
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))
212# define USE_GETGRENT_PTR
213#else
214# undef USE_GETGRENT_PTR
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))
238# define USE_GETPWENT_PTR
239#else
240# undef USE_GETPWENT_PTR
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))
254# define USE_GETSPENT_PTR
255#else
256# undef USE_GETSPENT_PTR
257#endif
258
259/* The getgrent getgrgid getgrnam using fptr? */
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
266
267/* Any of the getgrent getgrgid getgrnam using fptr? */
268
269#if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR))
270# define USE_GETGRENT_FPTR
271#else
272# undef USE_GETGRENT_FPTR
273#endif
274
275/* The getpwent getpwnam getpwuid using fptr? */
276
09310450 277#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
10bc17b6
JH
278# define GETPWENT_R_HAS_FPTR
279#else
280# undef GETPWENT_R_HAS_FPTR
281#endif
282
283/* Any of the getpwent getpwnam getpwuid using fptr? */
284
285#if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR))
286# define USE_GETPWENT_FPTR
287#else
288# undef USE_GETPWENT_FPTR
289#endif
290
edd309b7
JH
291/* The getpwent getpwgid getpwnam using buffer? */
292
293#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)
294# define GETPWENT_R_HAS_BUFFER
295#else
296# undef GETPWENT_R_HAS_BUFFER
297#endif
298#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)
299# define GETPWNAM_R_HAS_BUFFER
300#else
301# undef GETPWNAM_R_HAS_BUFFER
302#endif
303
304/* Any of the getpwent getpwgid getpwnam using buffer? */
305
306#if (defined(GETPWENT_R_HAS_BUFFER) || defined(GETPWGID_R_HAS_BUFFER) || defined(GETPWNAM_R_HAS_BUFFER))
307# define USE_GETPWENT_BUFFER
308#else
309# undef USE_GETPWENT_BUFFER
310#endif
311
10bc17b6
JH
312/* The gethostent gethostbyaddr gethostbyname using ptr? */
313
09310450 314#if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
315# define GETHOSTENT_R_HAS_PTR
316#else
317# undef GETHOSTENT_R_HAS_PTR
318#endif
09310450 319#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE)
10bc17b6
JH
320# define GETHOSTBYADDR_R_HAS_PTR
321#else
322# undef GETHOSTBYADDR_R_HAS_PTR
323#endif
09310450 324#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
325# define GETHOSTBYNAME_R_HAS_PTR
326#else
327# undef GETHOSTBYNAME_R_HAS_PTR
328#endif
329
330/* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
331
332#if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
333# define USE_GETHOSTENT_PTR
334#else
335# undef USE_GETHOSTENT_PTR
336#endif
337
338/* The getnetent getnetbyaddr getnetbyname using ptr? */
339
09310450 340#if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
341# define GETNETENT_R_HAS_PTR
342#else
343# undef GETNETENT_R_HAS_PTR
344#endif
09310450 345#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
10bc17b6
JH
346# define GETNETBYADDR_R_HAS_PTR
347#else
348# undef GETNETBYADDR_R_HAS_PTR
349#endif
09310450 350#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
351# define GETNETBYNAME_R_HAS_PTR
352#else
353# undef GETNETBYNAME_R_HAS_PTR
354#endif
355
356/* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
357
358#if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
359# define USE_GETNETENT_PTR
360#else
361# undef USE_GETNETENT_PTR
362#endif
363
364/* The getprotoent getprotobyname getprotobynumber using ptr? */
365
09310450 366#if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
367# define GETPROTOENT_R_HAS_PTR
368#else
369# undef GETPROTOENT_R_HAS_PTR
370#endif
09310450 371#if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
10bc17b6
JH
372# define GETPROTOBYNAME_R_HAS_PTR
373#else
374# undef GETPROTOBYNAME_R_HAS_PTR
375#endif
09310450 376#if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
10bc17b6
JH
377# define GETPROTOBYNUMBER_R_HAS_PTR
378#else
379# undef GETPROTOBYNUMBER_R_HAS_PTR
380#endif
381
382/* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
383
384#if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
385# define USE_GETPROTOENT_PTR
386#else
387# undef USE_GETPROTOENT_PTR
388#endif
389
390/* The getservent getservbyname getservbyport using ptr? */
391
09310450 392#if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
393# define GETSERVENT_R_HAS_PTR
394#else
395# undef GETSERVENT_R_HAS_PTR
396#endif
09310450 397#if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
10bc17b6
JH
398# define GETSERVBYNAME_R_HAS_PTR
399#else
400# undef GETSERVBYNAME_R_HAS_PTR
401#endif
09310450 402#if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
10bc17b6
JH
403# define GETSERVBYPORT_R_HAS_PTR
404#else
405# undef GETSERVBYPORT_R_HAS_PTR
406#endif
407
408/* Any of the getservent getservbyname getservbyport using ptr? */
409
410#if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
411# define USE_GETSERVENT_PTR
412#else
413# undef USE_GETSERVENT_PTR
414#endif
415
edd309b7
JH
416/* The gethostent gethostbyaddr gethostbyname using buffer? */
417
418#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)
419# define GETHOSTENT_R_HAS_BUFFER
420#else
421# undef GETHOSTENT_R_HAS_BUFFER
422#endif
423#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)
424# define GETHOSTBYADDR_R_HAS_BUFFER
425#else
426# undef GETHOSTBYADDR_R_HAS_BUFFER
427#endif
428#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
429# define GETHOSTBYNAME_R_HAS_BUFFER
430#else
431# undef GETHOSTBYNAME_R_HAS_BUFFER
432#endif
433
434/* Any of the gethostent gethostbyaddr gethostbyname using buffer? */
435
436#if (defined(GETHOSTENT_R_HAS_BUFFER) || defined(GETHOSTBYADDR_R_HAS_BUFFER) || defined(GETHOSTBYNAME_R_HAS_BUFFER))
437# define USE_GETHOSTENT_BUFFER
438#else
439# undef USE_GETHOSTENT_BUFFER
440#endif
441
442/* The getnetent getnetbyaddr getnetbyname using buffer? */
443
444#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)
445# define GETNETENT_R_HAS_BUFFER
446#else
447# undef GETNETENT_R_HAS_BUFFER
448#endif
449#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)
450# define GETNETBYADDR_R_HAS_BUFFER
451#else
452# undef GETNETBYADDR_R_HAS_BUFFER
453#endif
454#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)
455# define GETNETBYNAME_R_HAS_BUFFER
456#else
457# undef GETNETBYNAME_R_HAS_BUFFER
458#endif
459
460/* Any of the getnetent getnetbyaddr getnetbyname using buffer? */
461
462#if (defined(GETNETENT_R_HAS_BUFFER) || defined(GETNETBYADDR_R_HAS_BUFFER) || defined(GETNETBYNAME_R_HAS_BUFFER))
463# define USE_GETNETENT_BUFFER
464#else
465# undef USE_GETNETENT_BUFFER
466#endif
467
468/* The getprotoent getprotobyname getprotobynumber using buffer? */
469
470#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)
471# define GETPROTOENT_R_HAS_BUFFER
472#else
473# undef GETPROTOENT_R_HAS_BUFFER
474#endif
475#if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
476# define GETPROTOBYNAME_R_HAS_BUFFER
477#else
478# undef GETPROTOBYNAME_R_HAS_BUFFER
479#endif
480#if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR || GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI)
481# define GETPROTOBYNUMBER_R_HAS_BUFFER
482#else
483# undef GETPROTOBYNUMBER_R_HAS_BUFFER
484#endif
485
486/* Any of the getprotoent getprotobyname getprotobynumber using buffer? */
487
488#if (defined(GETPROTOENT_R_HAS_BUFFER) || defined(GETPROTOBYNAME_R_HAS_BUFFER) || defined(GETPROTOBYNUMBER_R_HAS_BUFFER))
489# define USE_GETPROTOENT_BUFFER
490#else
491# undef USE_GETPROTOENT_BUFFER
492#endif
493
494/* The getservent getservbyname getservbyport using buffer? */
495
496#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)
497# define GETSERVENT_R_HAS_BUFFER
498#else
499# undef GETSERVENT_R_HAS_BUFFER
500#endif
501#if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR || GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI)
502# define GETSERVBYNAME_R_HAS_BUFFER
503#else
504# undef GETSERVBYNAME_R_HAS_BUFFER
505#endif
506#if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR || GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI)
507# define GETSERVBYPORT_R_HAS_BUFFER
508#else
509# undef GETSERVBYPORT_R_HAS_BUFFER
510#endif
511
512/* Any of the getservent getservbyname getservbyport using buffer? */
513
514#if (defined(GETSERVENT_R_HAS_BUFFER) || defined(GETSERVBYNAME_R_HAS_BUFFER) || defined(GETSERVBYPORT_R_HAS_BUFFER))
515# define USE_GETSERVENT_BUFFER
516#else
517# undef USE_GETSERVENT_BUFFER
518#endif
519
10bc17b6
JH
520/* The gethostent gethostbyaddr gethostbyname using errno? */
521
09310450 522#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
523# define GETHOSTENT_R_HAS_ERRNO
524#else
525# undef GETHOSTENT_R_HAS_ERRNO
526#endif
09310450 527#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
528# define GETHOSTBYADDR_R_HAS_ERRNO
529#else
530# undef GETHOSTBYADDR_R_HAS_ERRNO
531#endif
09310450 532#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
10bc17b6
JH
533# define GETHOSTBYNAME_R_HAS_ERRNO
534#else
535# undef GETHOSTBYNAME_R_HAS_ERRNO
536#endif
537
538/* Any of the gethostent gethostbyaddr gethostbyname using errno? */
539
540#if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
541# define USE_GETHOSTENT_ERRNO
542#else
543# undef USE_GETHOSTENT_ERRNO
544#endif
545
546/* The getnetent getnetbyaddr getnetbyname using errno? */
547
09310450 548#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
549# define GETNETENT_R_HAS_ERRNO
550#else
551# undef GETNETENT_R_HAS_ERRNO
552#endif
09310450 553#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
10bc17b6
JH
554# define GETNETBYADDR_R_HAS_ERRNO
555#else
556# undef GETNETBYADDR_R_HAS_ERRNO
557#endif
09310450 558#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
559# define GETNETBYNAME_R_HAS_ERRNO
560#else
561# undef GETNETBYNAME_R_HAS_ERRNO
562#endif
563
564/* Any of the getnetent getnetbyaddr getnetbyname using errno? */
565
566#if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
567# define USE_GETNETENT_ERRNO
568#else
569# undef USE_GETNETENT_ERRNO
570#endif
571
572
573typedef struct {
574#ifdef HAS_ASCTIME_R
575 char* _asctime_buffer;
576 size_t _asctime_size;
577#endif /* HAS_ASCTIME_R */
578#ifdef HAS_CRYPT_R
b430fd04
JH
579#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
580 CRYPTD* _crypt_data;
581#else
10bc17b6 582 struct crypt_data _crypt_struct;
b430fd04 583#endif
10bc17b6
JH
584#endif /* HAS_CRYPT_R */
585#ifdef HAS_CTIME_R
586 char* _ctime_buffer;
587 size_t _ctime_size;
588#endif /* HAS_CTIME_R */
589#ifdef HAS_DRAND48_R
590 struct drand48_data _drand48_struct;
591 double _drand48_double;
592#endif /* HAS_DRAND48_R */
593#ifdef HAS_GETGRNAM_R
594 struct group _getgrent_struct;
595 char* _getgrent_buffer;
596 size_t _getgrent_size;
597# ifdef USE_GETGRENT_PTR
598 struct group* _getgrent_ptr;
599# endif
600# ifdef USE_GETGRENT_FPTR
601 FILE* _getgrent_fptr;
602# endif
603#endif /* HAS_GETGRNAM_R */
604#ifdef HAS_GETHOSTBYNAME_R
605 struct hostent _gethostent_struct;
606# if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
31ee0cb7 607 struct hostent_data _gethostent_data;
10bc17b6
JH
608# else
609 char* _gethostent_buffer;
610 size_t _gethostent_size;
611# endif
612# ifdef USE_GETHOSTENT_PTR
613 struct hostent* _gethostent_ptr;
614# endif
615# ifdef USE_GETHOSTENT_ERRNO
616 int _gethostent_errno;
617# endif
618#endif /* HAS_GETHOSTBYNAME_R */
619#ifdef HAS_GETLOGIN_R
620 char* _getlogin_buffer;
621 size_t _getlogin_size;
622#endif /* HAS_GETLOGIN_R */
623#ifdef HAS_GETNETBYNAME_R
624 struct netent _getnetent_struct;
625# if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
31ee0cb7 626 struct netent_data _getnetent_data;
10bc17b6
JH
627# else
628 char* _getnetent_buffer;
629 size_t _getnetent_size;
630# endif
631# ifdef USE_GETNETENT_PTR
632 struct netent* _getnetent_ptr;
633# endif
634# ifdef USE_GETNETENT_ERRNO
635 int _getnetent_errno;
636# endif
637#endif /* HAS_GETNETBYNAME_R */
638#ifdef HAS_GETPROTOBYNAME_R
639 struct protoent _getprotoent_struct;
640# if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
31ee0cb7 641 struct protoent_data _getprotoent_data;
10bc17b6
JH
642# else
643 char* _getprotoent_buffer;
644 size_t _getprotoent_size;
645# endif
646# ifdef USE_GETPROTOENT_PTR
647 struct protoent* _getprotoent_ptr;
648# endif
649# ifdef USE_GETPROTOENT_ERRNO
650 int _getprotoent_errno;
651# endif
652#endif /* HAS_GETPROTOBYNAME_R */
653#ifdef HAS_GETPWNAM_R
654 struct passwd _getpwent_struct;
655 char* _getpwent_buffer;
656 size_t _getpwent_size;
657# ifdef USE_GETPWENT_PTR
658 struct passwd* _getpwent_ptr;
659# endif
660# ifdef USE_GETPWENT_FPTR
661 FILE* _getpwent_fptr;
662# endif
663#endif /* HAS_GETPWNAM_R */
664#ifdef HAS_GETSERVBYNAME_R
665 struct servent _getservent_struct;
666# if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
31ee0cb7 667 struct servent_data _getservent_data;
10bc17b6
JH
668# else
669 char* _getservent_buffer;
670 size_t _getservent_size;
671# endif
672# ifdef USE_GETSERVENT_PTR
673 struct servent* _getservent_ptr;
674# endif
675# ifdef USE_GETSERVENT_ERRNO
676 int _getservent_errno;
677# endif
678#endif /* HAS_GETSERVBYNAME_R */
679#ifdef HAS_GETSPNAM_R
680 struct spwd _getspent_struct;
681 char* _getspent_buffer;
682 size_t _getspent_size;
683# ifdef USE_GETSPENT_PTR
684 struct spwd* _getspent_ptr;
685# endif
686#endif /* HAS_GETSPNAM_R */
687#ifdef HAS_GMTIME_R
688 struct tm _gmtime_struct;
689#endif /* HAS_GMTIME_R */
690#ifdef HAS_LOCALTIME_R
691 struct tm _localtime_struct;
692#endif /* HAS_LOCALTIME_R */
693#ifdef HAS_RANDOM_R
694 struct random_data _random_struct;
695#endif /* HAS_RANDOM_R */
696#ifdef HAS_READDIR_R
697 struct dirent* _readdir_struct;
698 size_t _readdir_size;
699# if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
700 struct dirent* _readdir_ptr;
701# endif
702#endif /* HAS_READDIR_R */
703#ifdef HAS_READDIR64_R
704 struct dirent64* _readdir64_struct;
705 size_t _readdir64_size;
706# if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
707 struct dirent64* _readdir64_ptr;
708# endif
709#endif /* HAS_READDIR64_R */
710#ifdef HAS_SETLOCALE_R
711 char* _setlocale_buffer;
712 size_t _setlocale_size;
713#endif /* HAS_SETLOCALE_R */
714#ifdef HAS_STRERROR_R
715 char* _strerror_buffer;
716 size_t _strerror_size;
717#endif /* HAS_STRERROR_R */
718#ifdef HAS_TTYNAME_R
719 char* _ttyname_buffer;
720 size_t _ttyname_size;
721#endif /* HAS_TTYNAME_R */
722
723} REENTR;
724
725/* The wrappers. */
726
727#ifdef HAS_ASCTIME_R
728# undef asctime
729# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
730# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
731# endif
732# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
733# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
734# endif
735# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
736# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
737# endif
738# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
739# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
740# endif
741#endif /* HAS_ASCTIME_R */
742
743#ifdef HAS_CRYPT_R
744# undef crypt
745# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
746# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_struct)
747# endif
b430fd04
JH
748# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
749# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_data)
750# endif
10bc17b6
JH
751#endif /* HAS_CRYPT_R */
752
753#ifdef HAS_CTERMID_R
754# undef ctermid
755# if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
756# define ctermid(a) ctermid_r(a)
757# endif
758#endif /* HAS_CTERMID_R */
759
760#ifdef HAS_CTIME_R
761# undef ctime
762# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
763# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
764# endif
765# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
766# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
767# endif
768# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
769# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
770# endif
771# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
772# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
773# endif
774#endif /* HAS_CTIME_R */
775
776#ifdef HAS_DRAND48_R
777# undef drand48
778# if !defined(drand48) && DRAND48_R_PROTO == REENTRANT_PROTO_I_ST
779# define drand48() (((errno = drand48_r(&PL_reentrant_buffer->_drand48_struct, &PL_reentrant_buffer->_drand48_double))) == 0 ? PL_reentrant_buffer->_drand48_double : 0)
780# endif
781#endif /* HAS_DRAND48_R */
782
783#ifdef HAS_ENDGRENT_R
784# undef endgrent
785# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
786# define endgrent() (((errno = endgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
787# endif
788# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
789# define endgrent() endgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
790# endif
791#endif /* HAS_ENDGRENT_R */
792
793#ifdef HAS_ENDHOSTENT_R
794# undef endhostent
31ee0cb7
JH
795# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_D
796# define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0)
10bc17b6 797# endif
31ee0cb7
JH
798# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_D
799# define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_data)
10bc17b6
JH
800# endif
801#endif /* HAS_ENDHOSTENT_R */
802
803#ifdef HAS_ENDNETENT_R
804# undef endnetent
31ee0cb7
JH
805# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_D
806# define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0)
10bc17b6 807# endif
31ee0cb7
JH
808# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_D
809# define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_data)
10bc17b6
JH
810# endif
811#endif /* HAS_ENDNETENT_R */
812
813#ifdef HAS_ENDPROTOENT_R
814# undef endprotoent
31ee0cb7
JH
815# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_D
816# define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0)
10bc17b6 817# endif
31ee0cb7
JH
818# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_D
819# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_data)
10bc17b6
JH
820# endif
821#endif /* HAS_ENDPROTOENT_R */
822
823#ifdef HAS_ENDPWENT_R
824# undef endpwent
825# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
826# define endpwent() (((errno = endpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
827# endif
828# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
829# define endpwent() endpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
830# endif
831#endif /* HAS_ENDPWENT_R */
832
833#ifdef HAS_ENDSERVENT_R
834# undef endservent
31ee0cb7
JH
835# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_D
836# define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0)
10bc17b6 837# endif
31ee0cb7
JH
838# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_D
839# define endservent() endservent_r(&PL_reentrant_buffer->_getservent_data)
10bc17b6
JH
840# endif
841#endif /* HAS_ENDSERVENT_R */
842
843#ifdef HAS_GETGRENT_R
844# undef getgrent
845# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
edd309b7 846# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
847# endif
848# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
edd309b7 849# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
850# endif
851# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
edd309b7 852# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
853# endif
854# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 855# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
856# endif
857# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 858# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
859# endif
860# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
edd309b7 861# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_fptr))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrent") : 0))
10bc17b6
JH
862# endif
863#endif /* HAS_GETGRENT_R */
864
865#ifdef HAS_GETGRGID_R
866# undef getgrgid
867# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
edd309b7 868# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrgid", a) : 0))
10bc17b6
JH
869# endif
870# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
edd309b7 871# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrgid", a) : 0))
10bc17b6
JH
872# endif
873# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
edd309b7 874# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrgid", a) : 0))
10bc17b6
JH
875# endif
876# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
edd309b7 877# define getgrgid(a) (getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrgid", a) : 0))
10bc17b6
JH
878# endif
879#endif /* HAS_GETGRGID_R */
880
881#ifdef HAS_GETGRNAM_R
882# undef getgrnam
883# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
edd309b7 884# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrnam", a) : 0))
10bc17b6
JH
885# endif
886# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
edd309b7 887# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getgrnam", a) : 0))
10bc17b6
JH
888# endif
889# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
edd309b7 890# define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? PL_reentrant_buffer->_getgrent_buffer : (errno == ERANGE ? Perl_reentrant_retry("getgrnam", a) : 0))
10bc17b6
JH
891# endif
892# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
edd309b7 893# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrnam", a) : 0))
10bc17b6
JH
894# endif
895# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
edd309b7 896# define getgrnam(a) (getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : (errno == ERANGE ? Perl_reentrant_retry("getgrnam", a) : 0))
10bc17b6
JH
897# endif
898#endif /* HAS_GETGRNAM_R */
899
900#ifdef HAS_GETHOSTBYADDR_R
901# undef gethostbyaddr
902# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
edd309b7 903# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
904# endif
905# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
edd309b7 906# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
907# endif
908# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
edd309b7 909# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
910# endif
911# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
edd309b7 912# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
913# endif
914# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
edd309b7 915# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
916# endif
917# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
edd309b7 918# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
919# endif
920# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
edd309b7 921# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
922# endif
923# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
edd309b7 924# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
925# endif
926# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
edd309b7 927# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
10bc17b6
JH
928# endif
929# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
edd309b7 930# 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
931# endif
932#endif /* HAS_GETHOSTBYADDR_R */
933
934#ifdef HAS_GETHOSTBYNAME_R
935# undef gethostbyname
936# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
edd309b7 937# define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : (errno == ERANGE ? Perl_reentrant_retry("gethostbyname", a) : 0))
10bc17b6
JH
938# endif
939# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
edd309b7 940# define gethostbyname(a) (gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyname", a) : 0))
10bc17b6
JH
941# endif
942# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
edd309b7 943# define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostbyname", a) : 0))
10bc17b6
JH
944# endif
945#endif /* HAS_GETHOSTBYNAME_R */
946
947#ifdef HAS_GETHOSTENT_R
948# undef gethostent
949# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
edd309b7 950# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
951# endif
952# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
edd309b7 953# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
954# endif
955# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
edd309b7 956# define gethostent() (gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
957# endif
958# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 959# define gethostent() (gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size) ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
960# endif
961# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 962# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
963# endif
964# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
edd309b7 965# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : (errno == ERANGE ? Perl_reentrant_retry("gethostent") : 0))
10bc17b6
JH
966# endif
967#endif /* HAS_GETHOSTENT_R */
968
969#ifdef HAS_GETLOGIN_R
970# undef getlogin
971# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
edd309b7 972# 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
973# endif
974# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
edd309b7 975# 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
976# endif
977# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
978# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
979# endif
980# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
981# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
982# endif
983#endif /* HAS_GETLOGIN_R */
984
985#ifdef HAS_GETNETBYADDR_R
986# undef getnetbyaddr
987# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
edd309b7 988# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
989# endif
990# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
edd309b7 991# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
992# endif
993# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
edd309b7 994# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
995# endif
996# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
edd309b7 997# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
998# endif
999# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
edd309b7 1000# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
1001# endif
1002# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
edd309b7 1003# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
1004# endif
1005# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
edd309b7 1006# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
10bc17b6
JH
1007# endif
1008#endif /* HAS_GETNETBYADDR_R */
1009
1010#ifdef HAS_GETNETBYNAME_R
1011# undef getnetbyname
1012# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
edd309b7 1013# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getnetbyname", a) : 0))
10bc17b6
JH
1014# endif
1015# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
edd309b7 1016# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyname", a) : 0))
10bc17b6
JH
1017# endif
1018# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
edd309b7 1019# define getnetbyname(a) (getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyname", a) : 0))
10bc17b6
JH
1020# endif
1021# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
edd309b7 1022# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetbyname", a) : 0))
10bc17b6
JH
1023# endif
1024#endif /* HAS_GETNETBYNAME_R */
1025
1026#ifdef HAS_GETNETENT_R
1027# undef getnetent
1028# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
edd309b7 1029# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1030# endif
1031# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
edd309b7 1032# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1033# endif
1034# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
edd309b7 1035# define getnetent() (getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_errno) ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1036# endif
1037# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 1038# define getnetent() (getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1039# endif
1040# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 1041# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1042# endif
1043# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
edd309b7 1044# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : (errno == ERANGE ? Perl_reentrant_retry("getnetent") : 0))
10bc17b6
JH
1045# endif
1046#endif /* HAS_GETNETENT_R */
1047
1048#ifdef HAS_GETPROTOBYNAME_R
1049# undef getprotobyname
1050# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
edd309b7 1051# define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getprotobyname", a) : 0))
10bc17b6
JH
1052# endif
1053# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
edd309b7 1054# define getprotobyname(a) (getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotobyname", a) : 0))
10bc17b6
JH
1055# endif
1056# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
edd309b7 1057# define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotobyname", a) : 0))
10bc17b6
JH
1058# endif
1059#endif /* HAS_GETPROTOBYNAME_R */
1060
1061#ifdef HAS_GETPROTOBYNUMBER_R
1062# undef getprotobynumber
1063# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
edd309b7 1064# define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getprotobynumber", a) : 0))
10bc17b6
JH
1065# endif
1066# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
edd309b7 1067# define getprotobynumber(a) (getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotobynumber", a) : 0))
10bc17b6
JH
1068# endif
1069# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
edd309b7 1070# define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotobynumber", a) : 0))
10bc17b6
JH
1071# endif
1072#endif /* HAS_GETPROTOBYNUMBER_R */
1073
1074#ifdef HAS_GETPROTOENT_R
1075# undef getprotoent
1076# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
edd309b7 1077# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getprotoent") : 0))
10bc17b6
JH
1078# endif
1079# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 1080# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotoent") : 0))
10bc17b6
JH
1081# endif
1082# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 1083# define getprotoent() (getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotoent") : 0))
10bc17b6
JH
1084# endif
1085# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
edd309b7 1086# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : (errno == ERANGE ? Perl_reentrant_retry("getprotoent") : 0))
10bc17b6
JH
1087# endif
1088#endif /* HAS_GETPROTOENT_R */
1089
1090#ifdef HAS_GETPWENT_R
1091# undef getpwent
1092# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
edd309b7 1093# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1094# endif
1095# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
edd309b7 1096# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1097# endif
1098# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
edd309b7 1099# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1100# endif
1101# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 1102# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1103# endif
1104# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 1105# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1106# endif
1107# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
edd309b7 1108# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_fptr))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwent") : 0))
10bc17b6
JH
1109# endif
1110#endif /* HAS_GETPWENT_R */
1111
1112#ifdef HAS_GETPWNAM_R
1113# undef getpwnam
1114# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
edd309b7 1115# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwnam", a) : 0))
10bc17b6
JH
1116# endif
1117# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
edd309b7 1118# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwnam", a) : 0))
10bc17b6
JH
1119# endif
1120# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
edd309b7 1121# define getpwnam(a) (getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwnam", a) : 0))
10bc17b6
JH
1122# endif
1123# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
edd309b7 1124# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwnam", a) : 0))
10bc17b6
JH
1125# endif
1126#endif /* HAS_GETPWNAM_R */
1127
1128#ifdef HAS_GETPWUID_R
1129# undef getpwuid
1130# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
edd309b7 1131# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwuid", a) : 0))
10bc17b6
JH
1132# endif
1133# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
edd309b7 1134# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getpwuid", a) : 0))
10bc17b6
JH
1135# endif
1136# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
edd309b7 1137# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwuid", a) : 0))
10bc17b6
JH
1138# endif
1139# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
edd309b7 1140# define getpwuid(a) (getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : (errno == ERANGE ? Perl_reentrant_retry("getpwuid", a) : 0))
10bc17b6
JH
1141# endif
1142#endif /* HAS_GETPWUID_R */
1143
1144#ifdef HAS_GETSERVBYNAME_R
1145# undef getservbyname
1146# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
edd309b7 1147# define getservbyname(a, b) (((errno = getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getservbyname", a, b) : 0))
10bc17b6
JH
1148# endif
1149# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
edd309b7 1150# define getservbyname(a, b) (getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservbyname", a, b) : 0))
10bc17b6
JH
1151# endif
1152# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
edd309b7 1153# define getservbyname(a, b) (((errno = getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservbyname", a, b) : 0))
10bc17b6
JH
1154# endif
1155#endif /* HAS_GETSERVBYNAME_R */
1156
1157#ifdef HAS_GETSERVBYPORT_R
1158# undef getservbyport
1159# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
edd309b7 1160# define getservbyport(a, b) (((errno = getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getservbyport", a, b) : 0))
10bc17b6
JH
1161# endif
1162# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
edd309b7 1163# define getservbyport(a, b) (getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservbyport", a, b) : 0))
10bc17b6
JH
1164# endif
1165# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
edd309b7 1166# define getservbyport(a, b) (((errno = getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservbyport", a, b) : 0))
10bc17b6
JH
1167# endif
1168#endif /* HAS_GETSERVBYPORT_R */
1169
1170#ifdef HAS_GETSERVENT_R
1171# undef getservent
1172# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
edd309b7 1173# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getservent") : 0))
10bc17b6
JH
1174# endif
1175# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
edd309b7 1176# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size))) == 0 ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservent") : 0))
10bc17b6
JH
1177# endif
1178# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
edd309b7 1179# define getservent() (getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservent") : 0))
10bc17b6
JH
1180# endif
1181# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
edd309b7 1182# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : (errno == ERANGE ? Perl_reentrant_retry("getservent") : 0))
10bc17b6
JH
1183# endif
1184#endif /* HAS_GETSERVENT_R */
1185
1186#ifdef HAS_GETSPNAM_R
1187# undef getspnam
1188# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
edd309b7 1189# define getspnam(a) (((errno = getspnam_r(a, &PL_reentrant_buffer->_getspent_struct, PL_reentrant_buffer->_getspent_buffer, PL_reentrant_buffer->_getspent_size, &PL_reentrant_buffer->_getspent_ptr))) == 0 ? PL_reentrant_buffer->_getspent_ptr : (errno == ERANGE ? Perl_reentrant_retry("getspnam", a) : 0))
10bc17b6
JH
1190# endif
1191# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
edd309b7 1192# define getspnam(a) (getspnam_r(a, &PL_reentrant_buffer->_getspent_struct, PL_reentrant_buffer->_getspent_buffer, PL_reentrant_buffer->_getspent_size) ? &PL_reentrant_buffer->_getspent_struct : (errno == ERANGE ? Perl_reentrant_retry("getspnam", a) : 0))
10bc17b6
JH
1193# endif
1194#endif /* HAS_GETSPNAM_R */
1195
1196#ifdef HAS_GMTIME_R
1197# undef gmtime
1198# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_S_TS
1199# define gmtime(a) (gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct) ? &PL_reentrant_buffer->_gmtime_struct : 0)
1200# endif
1201# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_I_TS
1202# define gmtime(a) (((errno = gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct))) == 0 ? &PL_reentrant_buffer->_gmtime_struct : 0)
1203# endif
1204#endif /* HAS_GMTIME_R */
1205
1206#ifdef HAS_LOCALTIME_R
1207# undef localtime
1208# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_S_TS
1209# define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
1210# endif
1211# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_I_TS
1212# define localtime(a) (((errno = localtime_r(a, &PL_reentrant_buffer->_localtime_struct))) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
1213# endif
1214#endif /* HAS_LOCALTIME_R */
1215
1216#ifdef HAS_RANDOM_R
1217# undef random
1218# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1219# define random() (((errno = random_r(T, &PL_reentrant_buffer->_random_struct))) == 0 ? &PL_reentrant_buffer->_random_struct : 0)
1220# endif
1221#endif /* HAS_RANDOM_R */
1222
1223#ifdef HAS_READDIR_R
1224# undef readdir
1225# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
1226# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr))) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
1227# endif
1228# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
1229# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct))) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
1230# endif
1231#endif /* HAS_READDIR_R */
1232
1233#ifdef HAS_READDIR64_R
1234# undef readdir64
1235# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
1236# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr))) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
1237# endif
1238# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
1239# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct))) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
1240# endif
1241#endif /* HAS_READDIR64_R */
1242
1243#ifdef HAS_SETGRENT_R
1244# undef setgrent
1245# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
1246# define setgrent() (((errno = setgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
1247# endif
1248# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
1249# define setgrent() setgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
1250# endif
1251#endif /* HAS_SETGRENT_R */
1252
1253#ifdef HAS_SETHOSTENT_R
1254# undef sethostent
1255# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
1256# define sethostent(a) (((errno = sethostent_r(a, &PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0)
1257# endif
1258# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
1259# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_gethostent_data)
1260# endif
1261#endif /* HAS_SETHOSTENT_R */
1262
1263#ifdef HAS_SETLOCALE_R
1264# undef setlocale
1265# if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
1266# 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)
1267# endif
1268#endif /* HAS_SETLOCALE_R */
1269
1270#ifdef HAS_SETNETENT_R
1271# undef setnetent
1272# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
1273# define setnetent(a) (((errno = setnetent_r(a, &PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0)
1274# endif
1275# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
1276# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_getnetent_data)
1277# endif
1278#endif /* HAS_SETNETENT_R */
1279
1280#ifdef HAS_SETPROTOENT_R
1281# undef setprotoent
1282# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
1283# define setprotoent(a) (((errno = setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0)
1284# endif
1285# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
1286# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data)
1287# endif
1288#endif /* HAS_SETPROTOENT_R */
1289
1290#ifdef HAS_SETPWENT_R
1291# undef setpwent
1292# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
1293# define setpwent() (((errno = setpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
1294# endif
1295# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
1296# define setpwent() setpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
1297# endif
1298#endif /* HAS_SETPWENT_R */
1299
1300#ifdef HAS_SETSERVENT_R
1301# undef setservent
1302# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
1303# define setservent(a) (((errno = setservent_r(a, &PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0)
1304# endif
1305# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
1306# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_getservent_data)
1307# endif
1308#endif /* HAS_SETSERVENT_R */
1309
1310#ifdef HAS_SRAND48_R
1311# undef srand48
1312# if !defined(srand48) && SRAND48_R_PROTO == REENTRANT_PROTO_I_LS
1313# define srand48(a) (((errno = srand48_r(a, &PL_reentrant_buffer->_drand48_struct))) == 0 ? &PL_reentrant_buffer->_drand48_struct : 0)
1314# endif
1315#endif /* HAS_SRAND48_R */
1316
1317#ifdef HAS_SRANDOM_R
1318# undef srandom
1319# if !defined(srandom) && SRANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1320# define srandom(a) (((errno = srandom_r(a, &PL_reentrant_buffer->_srandom_struct))) == 0 ? &PL_reentrant_buffer->_srandom_struct : 0)
1321# endif
1322#endif /* HAS_SRANDOM_R */
1323
1324#ifdef HAS_STRERROR_R
1325# undef strerror
1326# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
1327# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1328# endif
1329# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
1330# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1331# endif
1332# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
1333# define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
1334# endif
1335#endif /* HAS_STRERROR_R */
1336
1337#ifdef HAS_TMPNAM_R
1338# undef tmpnam
1339# if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
1340# define tmpnam(a) tmpnam_r(a)
1341# endif
1342#endif /* HAS_TMPNAM_R */
1343
1344#ifdef HAS_TTYNAME_R
1345# undef ttyname
1346# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
1347# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1348# endif
1349# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
1350# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1351# endif
1352# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
1353# define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
1354# endif
1355#endif /* HAS_TTYNAME_R */
1356
1357
1358#endif /* USE_REENTRANT_API */
1359
1360#endif
1361