This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
HP-UX has also endgrent_r/endpwent_r marked obsolete.
[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
92#define REENTRANT_PROTO_B_CCS 4
93#define REENTRANT_PROTO_B_IBI 5
94#define REENTRANT_PROTO_B_IBW 6
95#define REENTRANT_PROTO_B_SB 7
96#define REENTRANT_PROTO_B_SBI 8
97#define REENTRANT_PROTO_I_BI 9
98#define REENTRANT_PROTO_I_BW 10
99#define REENTRANT_PROTO_I_CCSBWR 11
100#define REENTRANT_PROTO_I_CCSD 12
101#define REENTRANT_PROTO_I_CII 13
102#define REENTRANT_PROTO_I_CIISD 14
103#define REENTRANT_PROTO_I_CSBI 15
104#define REENTRANT_PROTO_I_CSBIR 16
105#define REENTRANT_PROTO_I_CSBWR 17
106#define REENTRANT_PROTO_I_CSBWRE 18
107#define REENTRANT_PROTO_I_CSD 19
108#define REENTRANT_PROTO_I_CWISBWRE 20
109#define REENTRANT_PROTO_I_CWISD 21
110#define REENTRANT_PROTO_I_H 22
111#define REENTRANT_PROTO_I_IBI 23
112#define REENTRANT_PROTO_I_IBW 24
113#define REENTRANT_PROTO_I_ICBI 25
114#define REENTRANT_PROTO_I_ICSBWR 26
115#define REENTRANT_PROTO_I_ICSD 27
116#define REENTRANT_PROTO_I_ID 28
117#define REENTRANT_PROTO_I_IISD 29
118#define REENTRANT_PROTO_I_ISBWR 30
119#define REENTRANT_PROTO_I_ISD 31
120#define REENTRANT_PROTO_I_LISBI 32
121#define REENTRANT_PROTO_I_LISD 33
122#define REENTRANT_PROTO_I_LS 34
123#define REENTRANT_PROTO_I_S 35
124#define REENTRANT_PROTO_I_SB 36
125#define REENTRANT_PROTO_I_SBI 37
126#define REENTRANT_PROTO_I_SBIE 38
127#define REENTRANT_PROTO_I_SBIH 39
128#define REENTRANT_PROTO_I_SBIR 40
129#define REENTRANT_PROTO_I_SBWR 41
130#define REENTRANT_PROTO_I_SBWRE 42
131#define REENTRANT_PROTO_I_SD 43
132#define REENTRANT_PROTO_I_ST 44
133#define REENTRANT_PROTO_I_TISD 45
134#define REENTRANT_PROTO_I_TS 46
135#define REENTRANT_PROTO_I_TSBI 47
136#define REENTRANT_PROTO_I_TSBIR 48
137#define REENTRANT_PROTO_I_TSBWR 49
138#define REENTRANT_PROTO_I_TSR 50
139#define REENTRANT_PROTO_I_UISBWRE 51
140#define REENTRANT_PROTO_S_CBI 52
141#define REENTRANT_PROTO_S_CCSBI 53
142#define REENTRANT_PROTO_S_CIISBIE 54
143#define REENTRANT_PROTO_S_CSBI 55
144#define REENTRANT_PROTO_S_CSBIE 56
145#define REENTRANT_PROTO_S_CWISBIE 57
146#define REENTRANT_PROTO_S_CWISBWIE 58
147#define REENTRANT_PROTO_S_ICSBI 59
148#define REENTRANT_PROTO_S_ISBI 60
149#define REENTRANT_PROTO_S_LISBI 61
150#define REENTRANT_PROTO_S_SBI 62
151#define REENTRANT_PROTO_S_SBIE 63
152#define REENTRANT_PROTO_S_SBW 64
153#define REENTRANT_PROTO_S_TISBI 65
154#define REENTRANT_PROTO_S_TS 66
155#define REENTRANT_PROTO_S_TSBI 67
156#define REENTRANT_PROTO_S_TSBIE 68
157#define REENTRANT_PROTO_S_TWISBIE 69
158#define REENTRANT_PROTO_V_H 70
159#define REENTRANT_PROTO_V_ID 71
160#define REENTRANT_PROTO_V_S 72
161
162/* Defines for indicating which special features are supported. */
163
164/* The getgrent getgrgid getgrnam using ptr? */
165
09310450 166#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
10bc17b6
JH
167# define GETGRENT_R_HAS_PTR
168#else
169# undef GETGRENT_R_HAS_PTR
170#endif
09310450 171#if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
10bc17b6
JH
172# define GETGRGID_R_HAS_PTR
173#else
174# undef GETGRGID_R_HAS_PTR
175#endif
09310450 176#if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
10bc17b6
JH
177# define GETGRNAM_R_HAS_PTR
178#else
179# undef GETGRNAM_R_HAS_PTR
180#endif
181
182/* Any of the getgrent getgrgid getgrnam using ptr? */
183
184#if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
185# define USE_GETGRENT_PTR
186#else
187# undef USE_GETGRENT_PTR
188#endif
189
190/* The getpwent getpwnam getpwuid using ptr? */
191
09310450 192#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
10bc17b6
JH
193# define GETPWENT_R_HAS_PTR
194#else
195# undef GETPWENT_R_HAS_PTR
196#endif
09310450 197#if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
10bc17b6
JH
198# define GETPWNAM_R_HAS_PTR
199#else
200# undef GETPWNAM_R_HAS_PTR
201#endif
09310450 202#if defined(HAS_GETPWUID_R) && (GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
10bc17b6
JH
203# define GETPWUID_R_HAS_PTR
204#else
205# undef GETPWUID_R_HAS_PTR
206#endif
207
208/* Any of the getpwent getpwnam getpwuid using ptr? */
209
210#if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
211# define USE_GETPWENT_PTR
212#else
213# undef USE_GETPWENT_PTR
214#endif
215
216/* The getspent getspnam using ptr? */
217
09310450 218#if defined(HAS_GETSPNAM_R) && (GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR)
10bc17b6
JH
219# define GETSPNAM_R_HAS_PTR
220#else
221# undef GETSPNAM_R_HAS_PTR
222#endif
223
224/* Any of the getspent getspnam using ptr? */
225
226#if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
227# define USE_GETSPENT_PTR
228#else
229# undef USE_GETSPENT_PTR
230#endif
231
232/* The getgrent getgrgid getgrnam using fptr? */
233
09310450 234#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
10bc17b6
JH
235# define GETGRENT_R_HAS_FPTR
236#else
237# undef GETGRENT_R_HAS_FPTR
238#endif
239
240/* Any of the getgrent getgrgid getgrnam using fptr? */
241
242#if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR))
243# define USE_GETGRENT_FPTR
244#else
245# undef USE_GETGRENT_FPTR
246#endif
247
248/* The getpwent getpwnam getpwuid using fptr? */
249
09310450 250#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
10bc17b6
JH
251# define GETPWENT_R_HAS_FPTR
252#else
253# undef GETPWENT_R_HAS_FPTR
254#endif
255
256/* Any of the getpwent getpwnam getpwuid using fptr? */
257
258#if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR))
259# define USE_GETPWENT_FPTR
260#else
261# undef USE_GETPWENT_FPTR
262#endif
263
264/* The gethostent gethostbyaddr gethostbyname using ptr? */
265
09310450 266#if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
267# define GETHOSTENT_R_HAS_PTR
268#else
269# undef GETHOSTENT_R_HAS_PTR
270#endif
09310450 271#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE)
10bc17b6
JH
272# define GETHOSTBYADDR_R_HAS_PTR
273#else
274# undef GETHOSTBYADDR_R_HAS_PTR
275#endif
09310450 276#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
277# define GETHOSTBYNAME_R_HAS_PTR
278#else
279# undef GETHOSTBYNAME_R_HAS_PTR
280#endif
281
282/* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
283
284#if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
285# define USE_GETHOSTENT_PTR
286#else
287# undef USE_GETHOSTENT_PTR
288#endif
289
290/* The getnetent getnetbyaddr getnetbyname using ptr? */
291
09310450 292#if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
10bc17b6
JH
293# define GETNETENT_R_HAS_PTR
294#else
295# undef GETNETENT_R_HAS_PTR
296#endif
09310450 297#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
10bc17b6
JH
298# define GETNETBYADDR_R_HAS_PTR
299#else
300# undef GETNETBYADDR_R_HAS_PTR
301#endif
09310450 302#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
303# define GETNETBYNAME_R_HAS_PTR
304#else
305# undef GETNETBYNAME_R_HAS_PTR
306#endif
307
308/* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
309
310#if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
311# define USE_GETNETENT_PTR
312#else
313# undef USE_GETNETENT_PTR
314#endif
315
316/* The getprotoent getprotobyname getprotobynumber using ptr? */
317
09310450 318#if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
319# define GETPROTOENT_R_HAS_PTR
320#else
321# undef GETPROTOENT_R_HAS_PTR
322#endif
09310450 323#if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
10bc17b6
JH
324# define GETPROTOBYNAME_R_HAS_PTR
325#else
326# undef GETPROTOBYNAME_R_HAS_PTR
327#endif
09310450 328#if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
10bc17b6
JH
329# define GETPROTOBYNUMBER_R_HAS_PTR
330#else
331# undef GETPROTOBYNUMBER_R_HAS_PTR
332#endif
333
334/* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
335
336#if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
337# define USE_GETPROTOENT_PTR
338#else
339# undef USE_GETPROTOENT_PTR
340#endif
341
342/* The getservent getservbyname getservbyport using ptr? */
343
09310450 344#if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
10bc17b6
JH
345# define GETSERVENT_R_HAS_PTR
346#else
347# undef GETSERVENT_R_HAS_PTR
348#endif
09310450 349#if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
10bc17b6
JH
350# define GETSERVBYNAME_R_HAS_PTR
351#else
352# undef GETSERVBYNAME_R_HAS_PTR
353#endif
09310450 354#if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
10bc17b6
JH
355# define GETSERVBYPORT_R_HAS_PTR
356#else
357# undef GETSERVBYPORT_R_HAS_PTR
358#endif
359
360/* Any of the getservent getservbyname getservbyport using ptr? */
361
362#if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
363# define USE_GETSERVENT_PTR
364#else
365# undef USE_GETSERVENT_PTR
366#endif
367
368/* The gethostent gethostbyaddr gethostbyname using errno? */
369
09310450 370#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
371# define GETHOSTENT_R_HAS_ERRNO
372#else
373# undef GETHOSTENT_R_HAS_ERRNO
374#endif
09310450 375#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
376# define GETHOSTBYADDR_R_HAS_ERRNO
377#else
378# undef GETHOSTBYADDR_R_HAS_ERRNO
379#endif
09310450 380#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
10bc17b6
JH
381# define GETHOSTBYNAME_R_HAS_ERRNO
382#else
383# undef GETHOSTBYNAME_R_HAS_ERRNO
384#endif
385
386/* Any of the gethostent gethostbyaddr gethostbyname using errno? */
387
388#if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
389# define USE_GETHOSTENT_ERRNO
390#else
391# undef USE_GETHOSTENT_ERRNO
392#endif
393
394/* The getnetent getnetbyaddr getnetbyname using errno? */
395
09310450 396#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
397# define GETNETENT_R_HAS_ERRNO
398#else
399# undef GETNETENT_R_HAS_ERRNO
400#endif
09310450 401#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
10bc17b6
JH
402# define GETNETBYADDR_R_HAS_ERRNO
403#else
404# undef GETNETBYADDR_R_HAS_ERRNO
405#endif
09310450 406#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
10bc17b6
JH
407# define GETNETBYNAME_R_HAS_ERRNO
408#else
409# undef GETNETBYNAME_R_HAS_ERRNO
410#endif
411
412/* Any of the getnetent getnetbyaddr getnetbyname using errno? */
413
414#if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
415# define USE_GETNETENT_ERRNO
416#else
417# undef USE_GETNETENT_ERRNO
418#endif
419
420
421typedef struct {
422#ifdef HAS_ASCTIME_R
423 char* _asctime_buffer;
424 size_t _asctime_size;
425#endif /* HAS_ASCTIME_R */
426#ifdef HAS_CRYPT_R
427 struct crypt_data _crypt_struct;
428#endif /* HAS_CRYPT_R */
429#ifdef HAS_CTIME_R
430 char* _ctime_buffer;
431 size_t _ctime_size;
432#endif /* HAS_CTIME_R */
433#ifdef HAS_DRAND48_R
434 struct drand48_data _drand48_struct;
435 double _drand48_double;
436#endif /* HAS_DRAND48_R */
437#ifdef HAS_GETGRNAM_R
438 struct group _getgrent_struct;
439 char* _getgrent_buffer;
440 size_t _getgrent_size;
441# ifdef USE_GETGRENT_PTR
442 struct group* _getgrent_ptr;
443# endif
444# ifdef USE_GETGRENT_FPTR
445 FILE* _getgrent_fptr;
446# endif
447#endif /* HAS_GETGRNAM_R */
448#ifdef HAS_GETHOSTBYNAME_R
449 struct hostent _gethostent_struct;
450# if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
451 struct hostent_data* _gethostent_data;
452# else
453 char* _gethostent_buffer;
454 size_t _gethostent_size;
455# endif
456# ifdef USE_GETHOSTENT_PTR
457 struct hostent* _gethostent_ptr;
458# endif
459# ifdef USE_GETHOSTENT_ERRNO
460 int _gethostent_errno;
461# endif
462#endif /* HAS_GETHOSTBYNAME_R */
463#ifdef HAS_GETLOGIN_R
464 char* _getlogin_buffer;
465 size_t _getlogin_size;
466#endif /* HAS_GETLOGIN_R */
467#ifdef HAS_GETNETBYNAME_R
468 struct netent _getnetent_struct;
469# if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
470 struct netent_data* _getnetent_data;
471# else
472 char* _getnetent_buffer;
473 size_t _getnetent_size;
474# endif
475# ifdef USE_GETNETENT_PTR
476 struct netent* _getnetent_ptr;
477# endif
478# ifdef USE_GETNETENT_ERRNO
479 int _getnetent_errno;
480# endif
481#endif /* HAS_GETNETBYNAME_R */
482#ifdef HAS_GETPROTOBYNAME_R
483 struct protoent _getprotoent_struct;
484# if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
485 struct protoent_data* _getprotoent_data;
486# else
487 char* _getprotoent_buffer;
488 size_t _getprotoent_size;
489# endif
490# ifdef USE_GETPROTOENT_PTR
491 struct protoent* _getprotoent_ptr;
492# endif
493# ifdef USE_GETPROTOENT_ERRNO
494 int _getprotoent_errno;
495# endif
496#endif /* HAS_GETPROTOBYNAME_R */
497#ifdef HAS_GETPWNAM_R
498 struct passwd _getpwent_struct;
499 char* _getpwent_buffer;
500 size_t _getpwent_size;
501# ifdef USE_GETPWENT_PTR
502 struct passwd* _getpwent_ptr;
503# endif
504# ifdef USE_GETPWENT_FPTR
505 FILE* _getpwent_fptr;
506# endif
507#endif /* HAS_GETPWNAM_R */
508#ifdef HAS_GETSERVBYNAME_R
509 struct servent _getservent_struct;
510# if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
511 struct servent_data* _getservent_data;
512# else
513 char* _getservent_buffer;
514 size_t _getservent_size;
515# endif
516# ifdef USE_GETSERVENT_PTR
517 struct servent* _getservent_ptr;
518# endif
519# ifdef USE_GETSERVENT_ERRNO
520 int _getservent_errno;
521# endif
522#endif /* HAS_GETSERVBYNAME_R */
523#ifdef HAS_GETSPNAM_R
524 struct spwd _getspent_struct;
525 char* _getspent_buffer;
526 size_t _getspent_size;
527# ifdef USE_GETSPENT_PTR
528 struct spwd* _getspent_ptr;
529# endif
530#endif /* HAS_GETSPNAM_R */
531#ifdef HAS_GMTIME_R
532 struct tm _gmtime_struct;
533#endif /* HAS_GMTIME_R */
534#ifdef HAS_LOCALTIME_R
535 struct tm _localtime_struct;
536#endif /* HAS_LOCALTIME_R */
537#ifdef HAS_RANDOM_R
538 struct random_data _random_struct;
539#endif /* HAS_RANDOM_R */
540#ifdef HAS_READDIR_R
541 struct dirent* _readdir_struct;
542 size_t _readdir_size;
543# if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
544 struct dirent* _readdir_ptr;
545# endif
546#endif /* HAS_READDIR_R */
547#ifdef HAS_READDIR64_R
548 struct dirent64* _readdir64_struct;
549 size_t _readdir64_size;
550# if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
551 struct dirent64* _readdir64_ptr;
552# endif
553#endif /* HAS_READDIR64_R */
554#ifdef HAS_SETLOCALE_R
555 char* _setlocale_buffer;
556 size_t _setlocale_size;
557#endif /* HAS_SETLOCALE_R */
558#ifdef HAS_STRERROR_R
559 char* _strerror_buffer;
560 size_t _strerror_size;
561#endif /* HAS_STRERROR_R */
562#ifdef HAS_TTYNAME_R
563 char* _ttyname_buffer;
564 size_t _ttyname_size;
565#endif /* HAS_TTYNAME_R */
566
567} REENTR;
568
569/* The wrappers. */
570
571#ifdef HAS_ASCTIME_R
572# undef asctime
573# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
574# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
575# endif
576# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
577# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
578# endif
579# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
580# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
581# endif
582# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
583# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
584# endif
585#endif /* HAS_ASCTIME_R */
586
587#ifdef HAS_CRYPT_R
588# undef crypt
589# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
590# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_struct)
591# endif
592#endif /* HAS_CRYPT_R */
593
594#ifdef HAS_CTERMID_R
595# undef ctermid
596# if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
597# define ctermid(a) ctermid_r(a)
598# endif
599#endif /* HAS_CTERMID_R */
600
601#ifdef HAS_CTIME_R
602# undef ctime
603# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
604# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
605# endif
606# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
607# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
608# endif
609# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
610# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
611# endif
612# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
613# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
614# endif
615#endif /* HAS_CTIME_R */
616
617#ifdef HAS_DRAND48_R
618# undef drand48
619# if !defined(drand48) && DRAND48_R_PROTO == REENTRANT_PROTO_I_ST
620# define drand48() (((errno = drand48_r(&PL_reentrant_buffer->_drand48_struct, &PL_reentrant_buffer->_drand48_double))) == 0 ? PL_reentrant_buffer->_drand48_double : 0)
621# endif
622#endif /* HAS_DRAND48_R */
623
624#ifdef HAS_ENDGRENT_R
625# undef endgrent
626# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
627# define endgrent() (((errno = endgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
628# endif
629# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
630# define endgrent() endgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
631# endif
632#endif /* HAS_ENDGRENT_R */
633
634#ifdef HAS_ENDHOSTENT_R
635# undef endhostent
636# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_S
637# define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_struct))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
638# endif
639# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_S
640# define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_struct)
641# endif
642#endif /* HAS_ENDHOSTENT_R */
643
644#ifdef HAS_ENDNETENT_R
645# undef endnetent
646# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_S
647# define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_struct))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
648# endif
649# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_S
650# define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_struct)
651# endif
652#endif /* HAS_ENDNETENT_R */
653
654#ifdef HAS_ENDPROTOENT_R
655# undef endprotoent
656# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_S
657# define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
658# endif
659# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_S
660# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct)
661# endif
662#endif /* HAS_ENDPROTOENT_R */
663
664#ifdef HAS_ENDPWENT_R
665# undef endpwent
666# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
667# define endpwent() (((errno = endpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
668# endif
669# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
670# define endpwent() endpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
671# endif
672#endif /* HAS_ENDPWENT_R */
673
674#ifdef HAS_ENDSERVENT_R
675# undef endservent
676# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_S
677# define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_struct))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
678# endif
679# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_S
680# define endservent() endservent_r(&PL_reentrant_buffer->_getservent_struct)
681# endif
682#endif /* HAS_ENDSERVENT_R */
683
684#ifdef HAS_GETGRENT_R
685# undef getgrent
686# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
687# 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 : 0)
688# endif
689# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
690# 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 : 0)
691# endif
692# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
693# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
694# endif
695# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
696# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
697# endif
698# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
699# 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 : 0)
700# endif
701# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
702# 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 : 0)
703# endif
704#endif /* HAS_GETGRENT_R */
705
706#ifdef HAS_GETGRGID_R
707# undef getgrgid
708# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
709# 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 : 0)
710# endif
711# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
712# 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 : 0)
713# endif
714# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
715# 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 : 0)
716# endif
717# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
718# 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 : 0)
719# endif
720#endif /* HAS_GETGRGID_R */
721
722#ifdef HAS_GETGRNAM_R
723# undef getgrnam
724# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
725# 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 : 0)
726# endif
727# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
728# 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 : 0)
729# endif
730# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
731# define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? PL_reentrant_buffer->_getgrent_buffer : 0)
732# endif
733# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
734# 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 : 0)
735# endif
736# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
737# 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 : 0)
738# endif
739#endif /* HAS_GETGRNAM_R */
740
741#ifdef HAS_GETHOSTBYADDR_R
742# undef gethostbyaddr
743# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
744# 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 : 0)
745# endif
746# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
747# 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 : 0)
748# endif
749# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
750# 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 : 0)
751# endif
752# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
753# 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 : 0)
754# endif
755# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
756# 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 : 0)
757# endif
758# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
759# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
760# endif
761# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
762# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
763# endif
764# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
765# 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 : 0)
766# endif
767# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
768# 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 : 0)
769# endif
770# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
771# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c))) == 0 ? 1 : 0)
772# endif
773#endif /* HAS_GETHOSTBYADDR_R */
774
775#ifdef HAS_GETHOSTBYNAME_R
776# undef gethostbyname
777# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
778# 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 : 0)
779# endif
780# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
781# 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 : 0)
782# endif
783# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
784# define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
785# endif
786#endif /* HAS_GETHOSTBYNAME_R */
787
788#ifdef HAS_GETHOSTENT_R
789# undef gethostent
790# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
791# 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 : 0)
792# endif
793# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
794# 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 : 0)
795# endif
796# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
797# 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 : 0)
798# endif
799# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
800# define gethostent() (gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size) ? &PL_reentrant_buffer->_gethostent_struct : 0)
801# endif
802# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
803# 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 : 0)
804# endif
805# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
806# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
807# endif
808#endif /* HAS_GETHOSTENT_R */
809
810#ifdef HAS_GETLOGIN_R
811# undef getlogin
812# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
813# define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
814# endif
815# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
816# define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
817# endif
818# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
819# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
820# endif
821# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
822# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
823# endif
824#endif /* HAS_GETLOGIN_R */
825
826#ifdef HAS_GETNETBYADDR_R
827# undef getnetbyaddr
828# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
829# 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 : 0)
830# endif
831# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
832# 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 : 0)
833# endif
834# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
835# 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 : 0)
836# endif
837# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
838# 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 : 0)
839# endif
840# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
841# 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 : 0)
842# endif
843# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
844# 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 : 0)
845# endif
846# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
847# 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 : 0)
848# endif
849#endif /* HAS_GETNETBYADDR_R */
850
851#ifdef HAS_GETNETBYNAME_R
852# undef getnetbyname
853# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
854# 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 : 0)
855# endif
856# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
857# 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 : 0)
858# endif
859# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
860# 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 : 0)
861# endif
862# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
863# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
864# endif
865#endif /* HAS_GETNETBYNAME_R */
866
867#ifdef HAS_GETNETENT_R
868# undef getnetent
869# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
870# 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 : 0)
871# endif
872# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
873# 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 : 0)
874# endif
875# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
876# 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 : 0)
877# endif
878# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
879# define getnetent() (getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : 0)
880# endif
881# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
882# 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 : 0)
883# endif
884# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
885# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
886# endif
887#endif /* HAS_GETNETENT_R */
888
889#ifdef HAS_GETPROTOBYNAME_R
890# undef getprotobyname
891# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
892# 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 : 0)
893# endif
894# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
895# 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 : 0)
896# endif
897# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
898# define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
899# endif
900#endif /* HAS_GETPROTOBYNAME_R */
901
902#ifdef HAS_GETPROTOBYNUMBER_R
903# undef getprotobynumber
904# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
905# 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 : 0)
906# endif
907# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
908# 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 : 0)
909# endif
910# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
911# define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
912# endif
913#endif /* HAS_GETPROTOBYNUMBER_R */
914
915#ifdef HAS_GETPROTOENT_R
916# undef getprotoent
917# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
918# 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 : 0)
919# endif
920# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
921# 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 : 0)
922# endif
923# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
924# define getprotoent() (getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : 0)
925# endif
926# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
927# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
928# endif
929#endif /* HAS_GETPROTOENT_R */
930
931#ifdef HAS_GETPWENT_R
932# undef getpwent
933# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
934# 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 : 0)
935# endif
936# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
937# 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 : 0)
938# endif
939# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
940# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
941# endif
942# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
943# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
944# endif
945# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
946# 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 : 0)
947# endif
948# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
949# 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 : 0)
950# endif
951#endif /* HAS_GETPWENT_R */
952
953#ifdef HAS_GETPWNAM_R
954# undef getpwnam
955# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
956# 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 : 0)
957# endif
958# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
959# 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 : 0)
960# endif
961# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
962# 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 : 0)
963# endif
964# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
965# 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 : 0)
966# endif
967#endif /* HAS_GETPWNAM_R */
968
969#ifdef HAS_GETPWUID_R
970# undef getpwuid
971# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
972# 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 : 0)
973# endif
974# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
975# 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 : 0)
976# endif
977# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
978# 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 : 0)
979# endif
980# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
981# 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 : 0)
982# endif
983#endif /* HAS_GETPWUID_R */
984
985#ifdef HAS_GETSERVBYNAME_R
986# undef getservbyname
987# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
988# 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 : 0)
989# endif
990# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
991# 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 : 0)
992# endif
993# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
994# 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 : 0)
995# endif
996#endif /* HAS_GETSERVBYNAME_R */
997
998#ifdef HAS_GETSERVBYPORT_R
999# undef getservbyport
1000# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
1001# 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 : 0)
1002# endif
1003# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
1004# 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 : 0)
1005# endif
1006# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
1007# 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 : 0)
1008# endif
1009#endif /* HAS_GETSERVBYPORT_R */
1010
1011#ifdef HAS_GETSERVENT_R
1012# undef getservent
1013# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
1014# 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 : 0)
1015# endif
1016# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
1017# 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 : 0)
1018# endif
1019# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
1020# define getservent() (getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : 0)
1021# endif
1022# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
1023# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
1024# endif
1025#endif /* HAS_GETSERVENT_R */
1026
1027#ifdef HAS_GETSPNAM_R
1028# undef getspnam
1029# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
1030# 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 : 0)
1031# endif
1032# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
1033# 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 : 0)
1034# endif
1035#endif /* HAS_GETSPNAM_R */
1036
1037#ifdef HAS_GMTIME_R
1038# undef gmtime
1039# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_S_TS
1040# define gmtime(a) (gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct) ? &PL_reentrant_buffer->_gmtime_struct : 0)
1041# endif
1042# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_I_TS
1043# define gmtime(a) (((errno = gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct))) == 0 ? &PL_reentrant_buffer->_gmtime_struct : 0)
1044# endif
1045#endif /* HAS_GMTIME_R */
1046
1047#ifdef HAS_LOCALTIME_R
1048# undef localtime
1049# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_S_TS
1050# define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
1051# endif
1052# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_I_TS
1053# define localtime(a) (((errno = localtime_r(a, &PL_reentrant_buffer->_localtime_struct))) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
1054# endif
1055#endif /* HAS_LOCALTIME_R */
1056
1057#ifdef HAS_RANDOM_R
1058# undef random
1059# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1060# define random() (((errno = random_r(T, &PL_reentrant_buffer->_random_struct))) == 0 ? &PL_reentrant_buffer->_random_struct : 0)
1061# endif
1062#endif /* HAS_RANDOM_R */
1063
1064#ifdef HAS_READDIR_R
1065# undef readdir
1066# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
1067# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr))) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
1068# endif
1069# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
1070# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct))) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
1071# endif
1072#endif /* HAS_READDIR_R */
1073
1074#ifdef HAS_READDIR64_R
1075# undef readdir64
1076# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
1077# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr))) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
1078# endif
1079# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
1080# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct))) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
1081# endif
1082#endif /* HAS_READDIR64_R */
1083
1084#ifdef HAS_SETGRENT_R
1085# undef setgrent
1086# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
1087# define setgrent() (((errno = setgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
1088# endif
1089# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
1090# define setgrent() setgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
1091# endif
1092#endif /* HAS_SETGRENT_R */
1093
1094#ifdef HAS_SETHOSTENT_R
1095# undef sethostent
1096# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
1097# define sethostent(a) (((errno = sethostent_r(a, &PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0)
1098# endif
1099# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
1100# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_gethostent_data)
1101# endif
1102#endif /* HAS_SETHOSTENT_R */
1103
1104#ifdef HAS_SETLOCALE_R
1105# undef setlocale
1106# if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
1107# 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)
1108# endif
1109#endif /* HAS_SETLOCALE_R */
1110
1111#ifdef HAS_SETNETENT_R
1112# undef setnetent
1113# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
1114# define setnetent(a) (((errno = setnetent_r(a, &PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0)
1115# endif
1116# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
1117# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_getnetent_data)
1118# endif
1119#endif /* HAS_SETNETENT_R */
1120
1121#ifdef HAS_SETPROTOENT_R
1122# undef setprotoent
1123# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
1124# define setprotoent(a) (((errno = setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0)
1125# endif
1126# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
1127# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data)
1128# endif
1129#endif /* HAS_SETPROTOENT_R */
1130
1131#ifdef HAS_SETPWENT_R
1132# undef setpwent
1133# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
1134# define setpwent() (((errno = setpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
1135# endif
1136# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
1137# define setpwent() setpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
1138# endif
1139#endif /* HAS_SETPWENT_R */
1140
1141#ifdef HAS_SETSERVENT_R
1142# undef setservent
1143# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
1144# define setservent(a) (((errno = setservent_r(a, &PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0)
1145# endif
1146# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
1147# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_getservent_data)
1148# endif
1149#endif /* HAS_SETSERVENT_R */
1150
1151#ifdef HAS_SRAND48_R
1152# undef srand48
1153# if !defined(srand48) && SRAND48_R_PROTO == REENTRANT_PROTO_I_LS
1154# define srand48(a) (((errno = srand48_r(a, &PL_reentrant_buffer->_drand48_struct))) == 0 ? &PL_reentrant_buffer->_drand48_struct : 0)
1155# endif
1156#endif /* HAS_SRAND48_R */
1157
1158#ifdef HAS_SRANDOM_R
1159# undef srandom
1160# if !defined(srandom) && SRANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1161# define srandom(a) (((errno = srandom_r(a, &PL_reentrant_buffer->_srandom_struct))) == 0 ? &PL_reentrant_buffer->_srandom_struct : 0)
1162# endif
1163#endif /* HAS_SRANDOM_R */
1164
1165#ifdef HAS_STRERROR_R
1166# undef strerror
1167# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
1168# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1169# endif
1170# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
1171# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1172# endif
1173# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
1174# define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
1175# endif
1176#endif /* HAS_STRERROR_R */
1177
1178#ifdef HAS_TMPNAM_R
1179# undef tmpnam
1180# if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
1181# define tmpnam(a) tmpnam_r(a)
1182# endif
1183#endif /* HAS_TMPNAM_R */
1184
1185#ifdef HAS_TTYNAME_R
1186# undef ttyname
1187# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
1188# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1189# endif
1190# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
1191# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1192# endif
1193# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
1194# define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
1195# endif
1196#endif /* HAS_TTYNAME_R */
1197
1198
1199#endif /* USE_REENTRANT_API */
1200
1201#endif
1202