4 * Copyright (c) 1997-2002, Larry Wall
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.
9 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
10 * This file is built by reentrl.pl from data in reentr.pl.
16 #ifdef USE_REENTRANT_API
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. */
27 # undef HAS_GETGRENT_R
28 # undef HAS_GETPWENT_R
29 # undef HAS_SETLOCALE_R
31 # undef HAS_STRERROR_R
32 # define NETDB_R_OBSOLETE
35 #if defined(__osf__) && defined(__alpha) /* Tru64 aka Digital UNIX */
37 # undef HAS_STRERROR_R
38 # define NETDB_R_OBSOLETE
41 #ifdef NETDB_R_OBSOLETE
42 # undef HAS_ENDHOSTENT_R
43 # undef HAS_ENDNETENT_R
44 # undef HAS_ENDPROTOENT_R
45 # undef HAS_ENDSERVENT_R
46 # undef HAS_GETHOSTBYADDR_R
47 # undef HAS_GETHOSTBYNAME_R
48 # undef HAS_GETHOSTENT_R
49 # undef HAS_GETNETBYADDR_R
50 # undef HAS_GETNETBYNAME_R
51 # undef HAS_GETNETENT_R
52 # undef HAS_GETPROTOBYNAME_R
53 # undef HAS_GETPROTOBYNUMBER_R
54 # undef HAS_GETPROTOENT_R
55 # undef HAS_GETSERVBYNAME_R
56 # undef HAS_GETSERVBYPORT_R
57 # undef HAS_GETSERVENT_R
58 # undef HAS_SETHOSTENT_R
59 # undef HAS_SETNETENT_R
60 # undef HAS_SETPROTOENT_R
61 # undef HAS_SETSERVENT_R
74 # include <stdlib.h> /* drand48_data */
87 #define REENTRANT_PROTO_B_B 1
88 #define REENTRANT_PROTO_B_BI 2
89 #define REENTRANT_PROTO_B_BW 3
90 #define REENTRANT_PROTO_B_CCS 4
91 #define REENTRANT_PROTO_B_IBI 5
92 #define REENTRANT_PROTO_B_IBW 6
93 #define REENTRANT_PROTO_B_SB 7
94 #define REENTRANT_PROTO_B_SBI 8
95 #define REENTRANT_PROTO_I_BI 9
96 #define REENTRANT_PROTO_I_BW 10
97 #define REENTRANT_PROTO_I_CCSBWR 11
98 #define REENTRANT_PROTO_I_CCSD 12
99 #define REENTRANT_PROTO_I_CII 13
100 #define REENTRANT_PROTO_I_CIISD 14
101 #define REENTRANT_PROTO_I_CSBI 15
102 #define REENTRANT_PROTO_I_CSBIR 16
103 #define REENTRANT_PROTO_I_CSBWR 17
104 #define REENTRANT_PROTO_I_CSBWRE 18
105 #define REENTRANT_PROTO_I_CSD 19
106 #define REENTRANT_PROTO_I_CWISBWRE 20
107 #define REENTRANT_PROTO_I_CWISD 21
108 #define REENTRANT_PROTO_I_H 22
109 #define REENTRANT_PROTO_I_IBI 23
110 #define REENTRANT_PROTO_I_IBW 24
111 #define REENTRANT_PROTO_I_ICBI 25
112 #define REENTRANT_PROTO_I_ICSBWR 26
113 #define REENTRANT_PROTO_I_ICSD 27
114 #define REENTRANT_PROTO_I_ID 28
115 #define REENTRANT_PROTO_I_IISD 29
116 #define REENTRANT_PROTO_I_ISBWR 30
117 #define REENTRANT_PROTO_I_ISD 31
118 #define REENTRANT_PROTO_I_LISBI 32
119 #define REENTRANT_PROTO_I_LISD 33
120 #define REENTRANT_PROTO_I_LS 34
121 #define REENTRANT_PROTO_I_S 35
122 #define REENTRANT_PROTO_I_SB 36
123 #define REENTRANT_PROTO_I_SBI 37
124 #define REENTRANT_PROTO_I_SBIE 38
125 #define REENTRANT_PROTO_I_SBIH 39
126 #define REENTRANT_PROTO_I_SBIR 40
127 #define REENTRANT_PROTO_I_SBWR 41
128 #define REENTRANT_PROTO_I_SBWRE 42
129 #define REENTRANT_PROTO_I_SD 43
130 #define REENTRANT_PROTO_I_ST 44
131 #define REENTRANT_PROTO_I_TISD 45
132 #define REENTRANT_PROTO_I_TS 46
133 #define REENTRANT_PROTO_I_TSBI 47
134 #define REENTRANT_PROTO_I_TSBIR 48
135 #define REENTRANT_PROTO_I_TSBWR 49
136 #define REENTRANT_PROTO_I_TSR 50
137 #define REENTRANT_PROTO_I_UISBWRE 51
138 #define REENTRANT_PROTO_S_CBI 52
139 #define REENTRANT_PROTO_S_CCSBI 53
140 #define REENTRANT_PROTO_S_CIISBIE 54
141 #define REENTRANT_PROTO_S_CSBI 55
142 #define REENTRANT_PROTO_S_CSBIE 56
143 #define REENTRANT_PROTO_S_CWISBIE 57
144 #define REENTRANT_PROTO_S_CWISBWIE 58
145 #define REENTRANT_PROTO_S_ICSBI 59
146 #define REENTRANT_PROTO_S_ISBI 60
147 #define REENTRANT_PROTO_S_LISBI 61
148 #define REENTRANT_PROTO_S_SBI 62
149 #define REENTRANT_PROTO_S_SBIE 63
150 #define REENTRANT_PROTO_S_SBW 64
151 #define REENTRANT_PROTO_S_TISBI 65
152 #define REENTRANT_PROTO_S_TS 66
153 #define REENTRANT_PROTO_S_TSBI 67
154 #define REENTRANT_PROTO_S_TSBIE 68
155 #define REENTRANT_PROTO_S_TWISBIE 69
156 #define REENTRANT_PROTO_V_H 70
157 #define REENTRANT_PROTO_V_ID 71
158 #define REENTRANT_PROTO_V_S 72
160 /* Defines for indicating which special features are supported. */
162 /* The getgrent getgrgid getgrnam using ptr? */
164 #if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
165 # define GETGRENT_R_HAS_PTR
167 # undef GETGRENT_R_HAS_PTR
169 #if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
170 # define GETGRGID_R_HAS_PTR
172 # undef GETGRGID_R_HAS_PTR
174 #if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
175 # define GETGRNAM_R_HAS_PTR
177 # undef GETGRNAM_R_HAS_PTR
180 /* Any of the getgrent getgrgid getgrnam using ptr? */
182 #if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
183 # define USE_GETGRENT_PTR
185 # undef USE_GETGRENT_PTR
188 /* The getpwent getpwnam getpwuid using ptr? */
190 #if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
191 # define GETPWENT_R_HAS_PTR
193 # undef GETPWENT_R_HAS_PTR
195 #if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR)
196 # define GETPWNAM_R_HAS_PTR
198 # undef GETPWNAM_R_HAS_PTR
200 #if defined(HAS_GETPWUID_R) && (GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR)
201 # define GETPWUID_R_HAS_PTR
203 # undef GETPWUID_R_HAS_PTR
206 /* Any of the getpwent getpwnam getpwuid using ptr? */
208 #if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
209 # define USE_GETPWENT_PTR
211 # undef USE_GETPWENT_PTR
214 /* The getspent getspnam using ptr? */
216 #if defined(HAS_GETSPNAM_R) && (GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR)
217 # define GETSPNAM_R_HAS_PTR
219 # undef GETSPNAM_R_HAS_PTR
222 /* Any of the getspent getspnam using ptr? */
224 #if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
225 # define USE_GETSPENT_PTR
227 # undef USE_GETSPENT_PTR
230 /* The getgrent getgrgid getgrnam using fptr? */
232 #if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
233 # define GETGRENT_R_HAS_FPTR
235 # undef GETGRENT_R_HAS_FPTR
238 /* Any of the getgrent getgrgid getgrnam using fptr? */
240 #if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR))
241 # define USE_GETGRENT_FPTR
243 # undef USE_GETGRENT_FPTR
246 /* The getpwent getpwnam getpwuid using fptr? */
248 #if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
249 # define GETPWENT_R_HAS_FPTR
251 # undef GETPWENT_R_HAS_FPTR
254 /* Any of the getpwent getpwnam getpwuid using fptr? */
256 #if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR))
257 # define USE_GETPWENT_FPTR
259 # undef USE_GETPWENT_FPTR
262 /* The gethostent gethostbyaddr gethostbyname using ptr? */
264 #if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
265 # define GETHOSTENT_R_HAS_PTR
267 # undef GETHOSTENT_R_HAS_PTR
269 #if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE)
270 # define GETHOSTBYADDR_R_HAS_PTR
272 # undef GETHOSTBYADDR_R_HAS_PTR
274 #if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
275 # define GETHOSTBYNAME_R_HAS_PTR
277 # undef GETHOSTBYNAME_R_HAS_PTR
280 /* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
282 #if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
283 # define USE_GETHOSTENT_PTR
285 # undef USE_GETHOSTENT_PTR
288 /* The getnetent getnetbyaddr getnetbyname using ptr? */
290 #if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE)
291 # define GETNETENT_R_HAS_PTR
293 # undef GETNETENT_R_HAS_PTR
295 #if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
296 # define GETNETBYADDR_R_HAS_PTR
298 # undef GETNETBYADDR_R_HAS_PTR
300 #if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
301 # define GETNETBYNAME_R_HAS_PTR
303 # undef GETNETBYNAME_R_HAS_PTR
306 /* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
308 #if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
309 # define USE_GETNETENT_PTR
311 # undef USE_GETNETENT_PTR
314 /* The getprotoent getprotobyname getprotobynumber using ptr? */
316 #if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
317 # define GETPROTOENT_R_HAS_PTR
319 # undef GETPROTOENT_R_HAS_PTR
321 #if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR)
322 # define GETPROTOBYNAME_R_HAS_PTR
324 # undef GETPROTOBYNAME_R_HAS_PTR
326 #if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR)
327 # define GETPROTOBYNUMBER_R_HAS_PTR
329 # undef GETPROTOBYNUMBER_R_HAS_PTR
332 /* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
334 #if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
335 # define USE_GETPROTOENT_PTR
337 # undef USE_GETPROTOENT_PTR
340 /* The getservent getservbyname getservbyport using ptr? */
342 #if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR)
343 # define GETSERVENT_R_HAS_PTR
345 # undef GETSERVENT_R_HAS_PTR
347 #if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR)
348 # define GETSERVBYNAME_R_HAS_PTR
350 # undef GETSERVBYNAME_R_HAS_PTR
352 #if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR)
353 # define GETSERVBYPORT_R_HAS_PTR
355 # undef GETSERVBYPORT_R_HAS_PTR
358 /* Any of the getservent getservbyname getservbyport using ptr? */
360 #if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
361 # define USE_GETSERVENT_PTR
363 # undef USE_GETSERVENT_PTR
366 /* The gethostent gethostbyaddr gethostbyname using errno? */
368 #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)
369 # define GETHOSTENT_R_HAS_ERRNO
371 # undef GETHOSTENT_R_HAS_ERRNO
373 #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)
374 # define GETHOSTBYADDR_R_HAS_ERRNO
376 # undef GETHOSTBYADDR_R_HAS_ERRNO
378 #if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
379 # define GETHOSTBYNAME_R_HAS_ERRNO
381 # undef GETHOSTBYNAME_R_HAS_ERRNO
384 /* Any of the gethostent gethostbyaddr gethostbyname using errno? */
386 #if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
387 # define USE_GETHOSTENT_ERRNO
389 # undef USE_GETHOSTENT_ERRNO
392 /* The getnetent getnetbyaddr getnetbyname using errno? */
394 #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)
395 # define GETNETENT_R_HAS_ERRNO
397 # undef GETNETENT_R_HAS_ERRNO
399 #if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
400 # define GETNETBYADDR_R_HAS_ERRNO
402 # undef GETNETBYADDR_R_HAS_ERRNO
404 #if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE)
405 # define GETNETBYNAME_R_HAS_ERRNO
407 # undef GETNETBYNAME_R_HAS_ERRNO
410 /* Any of the getnetent getnetbyaddr getnetbyname using errno? */
412 #if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
413 # define USE_GETNETENT_ERRNO
415 # undef USE_GETNETENT_ERRNO
421 char* _asctime_buffer;
422 size_t _asctime_size;
423 #endif /* HAS_ASCTIME_R */
425 struct crypt_data _crypt_struct;
426 #endif /* HAS_CRYPT_R */
430 #endif /* HAS_CTIME_R */
432 struct drand48_data _drand48_struct;
433 double _drand48_double;
434 #endif /* HAS_DRAND48_R */
435 #ifdef HAS_GETGRNAM_R
436 struct group _getgrent_struct;
437 char* _getgrent_buffer;
438 size_t _getgrent_size;
439 # ifdef USE_GETGRENT_PTR
440 struct group* _getgrent_ptr;
442 # ifdef USE_GETGRENT_FPTR
443 FILE* _getgrent_fptr;
445 #endif /* HAS_GETGRNAM_R */
446 #ifdef HAS_GETHOSTBYNAME_R
447 struct hostent _gethostent_struct;
448 # if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
449 struct hostent_data* _gethostent_data;
451 char* _gethostent_buffer;
452 size_t _gethostent_size;
454 # ifdef USE_GETHOSTENT_PTR
455 struct hostent* _gethostent_ptr;
457 # ifdef USE_GETHOSTENT_ERRNO
458 int _gethostent_errno;
460 #endif /* HAS_GETHOSTBYNAME_R */
461 #ifdef HAS_GETLOGIN_R
462 char* _getlogin_buffer;
463 size_t _getlogin_size;
464 #endif /* HAS_GETLOGIN_R */
465 #ifdef HAS_GETNETBYNAME_R
466 struct netent _getnetent_struct;
467 # if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
468 struct netent_data* _getnetent_data;
470 char* _getnetent_buffer;
471 size_t _getnetent_size;
473 # ifdef USE_GETNETENT_PTR
474 struct netent* _getnetent_ptr;
476 # ifdef USE_GETNETENT_ERRNO
477 int _getnetent_errno;
479 #endif /* HAS_GETNETBYNAME_R */
480 #ifdef HAS_GETPROTOBYNAME_R
481 struct protoent _getprotoent_struct;
482 # if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
483 struct protoent_data* _getprotoent_data;
485 char* _getprotoent_buffer;
486 size_t _getprotoent_size;
488 # ifdef USE_GETPROTOENT_PTR
489 struct protoent* _getprotoent_ptr;
491 # ifdef USE_GETPROTOENT_ERRNO
492 int _getprotoent_errno;
494 #endif /* HAS_GETPROTOBYNAME_R */
495 #ifdef HAS_GETPWNAM_R
496 struct passwd _getpwent_struct;
497 char* _getpwent_buffer;
498 size_t _getpwent_size;
499 # ifdef USE_GETPWENT_PTR
500 struct passwd* _getpwent_ptr;
502 # ifdef USE_GETPWENT_FPTR
503 FILE* _getpwent_fptr;
505 #endif /* HAS_GETPWNAM_R */
506 #ifdef HAS_GETSERVBYNAME_R
507 struct servent _getservent_struct;
508 # if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
509 struct servent_data* _getservent_data;
511 char* _getservent_buffer;
512 size_t _getservent_size;
514 # ifdef USE_GETSERVENT_PTR
515 struct servent* _getservent_ptr;
517 # ifdef USE_GETSERVENT_ERRNO
518 int _getservent_errno;
520 #endif /* HAS_GETSERVBYNAME_R */
521 #ifdef HAS_GETSPNAM_R
522 struct spwd _getspent_struct;
523 char* _getspent_buffer;
524 size_t _getspent_size;
525 # ifdef USE_GETSPENT_PTR
526 struct spwd* _getspent_ptr;
528 #endif /* HAS_GETSPNAM_R */
530 struct tm _gmtime_struct;
531 #endif /* HAS_GMTIME_R */
532 #ifdef HAS_LOCALTIME_R
533 struct tm _localtime_struct;
534 #endif /* HAS_LOCALTIME_R */
536 struct random_data _random_struct;
537 #endif /* HAS_RANDOM_R */
539 struct dirent* _readdir_struct;
540 size_t _readdir_size;
541 # if READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
542 struct dirent* _readdir_ptr;
544 #endif /* HAS_READDIR_R */
545 #ifdef HAS_READDIR64_R
546 struct dirent64* _readdir64_struct;
547 size_t _readdir64_size;
548 # if READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
549 struct dirent64* _readdir64_ptr;
551 #endif /* HAS_READDIR64_R */
552 #ifdef HAS_SETLOCALE_R
553 char* _setlocale_buffer;
554 size_t _setlocale_size;
555 #endif /* HAS_SETLOCALE_R */
556 #ifdef HAS_STRERROR_R
557 char* _strerror_buffer;
558 size_t _strerror_size;
559 #endif /* HAS_STRERROR_R */
561 char* _ttyname_buffer;
562 size_t _ttyname_size;
563 #endif /* HAS_TTYNAME_R */
571 # if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
572 # define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
574 # if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
575 # define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
577 # if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
578 # define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
580 # if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
581 # define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
583 #endif /* HAS_ASCTIME_R */
587 # if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
588 # define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_struct)
590 #endif /* HAS_CRYPT_R */
594 # if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
595 # define ctermid(a) ctermid_r(a)
597 #endif /* HAS_CTERMID_R */
601 # if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
602 # define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
604 # if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
605 # define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
607 # if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
608 # define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
610 # if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
611 # define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
613 #endif /* HAS_CTIME_R */
617 # if !defined(drand48) && DRAND48_R_PROTO == REENTRANT_PROTO_I_ST
618 # define drand48() (((errno = drand48_r(&PL_reentrant_buffer->_drand48_struct, &PL_reentrant_buffer->_drand48_double))) == 0 ? PL_reentrant_buffer->_drand48_double : 0)
620 #endif /* HAS_DRAND48_R */
622 #ifdef HAS_ENDGRENT_R
624 # if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
625 # define endgrent() (((errno = endgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
627 # if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
628 # define endgrent() endgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
630 #endif /* HAS_ENDGRENT_R */
632 #ifdef HAS_ENDHOSTENT_R
634 # if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_S
635 # define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_struct))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
637 # if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_S
638 # define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_struct)
640 #endif /* HAS_ENDHOSTENT_R */
642 #ifdef HAS_ENDNETENT_R
644 # if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_S
645 # define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_struct))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
647 # if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_S
648 # define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_struct)
650 #endif /* HAS_ENDNETENT_R */
652 #ifdef HAS_ENDPROTOENT_R
654 # if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_S
655 # define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
657 # if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_S
658 # define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct)
660 #endif /* HAS_ENDPROTOENT_R */
662 #ifdef HAS_ENDPWENT_R
664 # if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
665 # define endpwent() (((errno = endpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
667 # if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
668 # define endpwent() endpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
670 #endif /* HAS_ENDPWENT_R */
672 #ifdef HAS_ENDSERVENT_R
674 # if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_S
675 # define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_struct))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
677 # if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_S
678 # define endservent() endservent_r(&PL_reentrant_buffer->_getservent_struct)
680 #endif /* HAS_ENDSERVENT_R */
682 #ifdef HAS_GETGRENT_R
684 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
685 # 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)
687 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
688 # 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)
690 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
691 # 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)
693 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
694 # 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)
696 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
697 # 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)
699 # if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
700 # 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)
702 #endif /* HAS_GETGRENT_R */
704 #ifdef HAS_GETGRGID_R
706 # if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
707 # 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)
709 # if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
710 # 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)
712 # if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
713 # 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)
715 # if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
716 # 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)
718 #endif /* HAS_GETGRGID_R */
720 #ifdef HAS_GETGRNAM_R
722 # if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
723 # 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)
725 # if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
726 # 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)
728 # if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
729 # define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? PL_reentrant_buffer->_getgrent_buffer : 0)
731 # if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
732 # 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)
734 # if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
735 # 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)
737 #endif /* HAS_GETGRNAM_R */
739 #ifdef HAS_GETHOSTBYADDR_R
740 # undef gethostbyaddr
741 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
742 # 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)
744 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
745 # 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)
747 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
748 # 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)
750 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
751 # 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)
753 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
754 # 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)
756 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
757 # define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
759 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
760 # define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
762 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
763 # 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)
765 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
766 # 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)
768 # if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
769 # define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c))) == 0 ? 1 : 0)
771 #endif /* HAS_GETHOSTBYADDR_R */
773 #ifdef HAS_GETHOSTBYNAME_R
774 # undef gethostbyname
775 # if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
776 # 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)
778 # if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
779 # 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)
781 # if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
782 # define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
784 #endif /* HAS_GETHOSTBYNAME_R */
786 #ifdef HAS_GETHOSTENT_R
788 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
789 # 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)
791 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
792 # 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)
794 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
795 # 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)
797 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
798 # 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)
800 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
801 # 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)
803 # if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
804 # define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
806 #endif /* HAS_GETHOSTENT_R */
808 #ifdef HAS_GETLOGIN_R
810 # if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
811 # define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
813 # if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
814 # define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
816 # if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
817 # define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
819 # if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
820 # define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
822 #endif /* HAS_GETLOGIN_R */
824 #ifdef HAS_GETNETBYADDR_R
826 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
827 # 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)
829 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
830 # 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)
832 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
833 # 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)
835 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
836 # 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)
838 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
839 # 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)
841 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
842 # 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)
844 # if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
845 # 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)
847 #endif /* HAS_GETNETBYADDR_R */
849 #ifdef HAS_GETNETBYNAME_R
851 # if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
852 # 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)
854 # if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
855 # 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)
857 # if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
858 # 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)
860 # if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
861 # define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
863 #endif /* HAS_GETNETBYNAME_R */
865 #ifdef HAS_GETNETENT_R
867 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
868 # 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)
870 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
871 # 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)
873 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
874 # 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)
876 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
877 # 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)
879 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
880 # 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)
882 # if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
883 # define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
885 #endif /* HAS_GETNETENT_R */
887 #ifdef HAS_GETPROTOBYNAME_R
888 # undef getprotobyname
889 # if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
890 # 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)
892 # if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
893 # 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)
895 # if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
896 # define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
898 #endif /* HAS_GETPROTOBYNAME_R */
900 #ifdef HAS_GETPROTOBYNUMBER_R
901 # undef getprotobynumber
902 # if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
903 # 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)
905 # if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
906 # 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)
908 # if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
909 # define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
911 #endif /* HAS_GETPROTOBYNUMBER_R */
913 #ifdef HAS_GETPROTOENT_R
915 # if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
916 # 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)
918 # if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
919 # 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)
921 # if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
922 # 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)
924 # if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
925 # define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
927 #endif /* HAS_GETPROTOENT_R */
929 #ifdef HAS_GETPWENT_R
931 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
932 # 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)
934 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
935 # 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)
937 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
938 # 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)
940 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
941 # 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)
943 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
944 # 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)
946 # if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
947 # 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)
949 #endif /* HAS_GETPWENT_R */
951 #ifdef HAS_GETPWNAM_R
953 # if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
954 # 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)
956 # if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
957 # 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)
959 # if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
960 # 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)
962 # if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
963 # 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)
965 #endif /* HAS_GETPWNAM_R */
967 #ifdef HAS_GETPWUID_R
969 # if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
970 # 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)
972 # if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
973 # 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)
975 # if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
976 # 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)
978 # if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
979 # 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)
981 #endif /* HAS_GETPWUID_R */
983 #ifdef HAS_GETSERVBYNAME_R
984 # undef getservbyname
985 # if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
986 # 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)
988 # if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
989 # 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)
991 # if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
992 # 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)
994 #endif /* HAS_GETSERVBYNAME_R */
996 #ifdef HAS_GETSERVBYPORT_R
997 # undef getservbyport
998 # if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
999 # 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)
1001 # if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
1002 # 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)
1004 # if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
1005 # 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)
1007 #endif /* HAS_GETSERVBYPORT_R */
1009 #ifdef HAS_GETSERVENT_R
1011 # if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
1012 # 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)
1014 # if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
1015 # 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)
1017 # if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
1018 # 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)
1020 # if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
1021 # define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
1023 #endif /* HAS_GETSERVENT_R */
1025 #ifdef HAS_GETSPNAM_R
1027 # if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
1028 # 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)
1030 # if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
1031 # 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)
1033 #endif /* HAS_GETSPNAM_R */
1037 # if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_S_TS
1038 # define gmtime(a) (gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct) ? &PL_reentrant_buffer->_gmtime_struct : 0)
1040 # if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_I_TS
1041 # define gmtime(a) (((errno = gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct))) == 0 ? &PL_reentrant_buffer->_gmtime_struct : 0)
1043 #endif /* HAS_GMTIME_R */
1045 #ifdef HAS_LOCALTIME_R
1047 # if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_S_TS
1048 # define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
1050 # if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_I_TS
1051 # define localtime(a) (((errno = localtime_r(a, &PL_reentrant_buffer->_localtime_struct))) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
1053 #endif /* HAS_LOCALTIME_R */
1057 # if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1058 # define random() (((errno = random_r(T, &PL_reentrant_buffer->_random_struct))) == 0 ? &PL_reentrant_buffer->_random_struct : 0)
1060 #endif /* HAS_RANDOM_R */
1062 #ifdef HAS_READDIR_R
1064 # if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
1065 # define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr))) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
1067 # if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
1068 # define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct))) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
1070 #endif /* HAS_READDIR_R */
1072 #ifdef HAS_READDIR64_R
1074 # if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
1075 # define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr))) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
1077 # if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
1078 # define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct))) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
1080 #endif /* HAS_READDIR64_R */
1082 #ifdef HAS_SETGRENT_R
1084 # if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
1085 # define setgrent() (((errno = setgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
1087 # if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
1088 # define setgrent() setgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
1090 #endif /* HAS_SETGRENT_R */
1092 #ifdef HAS_SETHOSTENT_R
1094 # if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
1095 # define sethostent(a) (((errno = sethostent_r(a, &PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0)
1097 # if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
1098 # define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_gethostent_data)
1100 #endif /* HAS_SETHOSTENT_R */
1102 #ifdef HAS_SETLOCALE_R
1104 # if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
1105 # 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)
1107 #endif /* HAS_SETLOCALE_R */
1109 #ifdef HAS_SETNETENT_R
1111 # if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
1112 # define setnetent(a) (((errno = setnetent_r(a, &PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0)
1114 # if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
1115 # define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_getnetent_data)
1117 #endif /* HAS_SETNETENT_R */
1119 #ifdef HAS_SETPROTOENT_R
1121 # if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
1122 # define setprotoent(a) (((errno = setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0)
1124 # if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
1125 # define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data)
1127 #endif /* HAS_SETPROTOENT_R */
1129 #ifdef HAS_SETPWENT_R
1131 # if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
1132 # define setpwent() (((errno = setpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
1134 # if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
1135 # define setpwent() setpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
1137 #endif /* HAS_SETPWENT_R */
1139 #ifdef HAS_SETSERVENT_R
1141 # if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
1142 # define setservent(a) (((errno = setservent_r(a, &PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0)
1144 # if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
1145 # define setservent(a) setservent_r(a, &PL_reentrant_buffer->_getservent_data)
1147 #endif /* HAS_SETSERVENT_R */
1149 #ifdef HAS_SRAND48_R
1151 # if !defined(srand48) && SRAND48_R_PROTO == REENTRANT_PROTO_I_LS
1152 # define srand48(a) (((errno = srand48_r(a, &PL_reentrant_buffer->_drand48_struct))) == 0 ? &PL_reentrant_buffer->_drand48_struct : 0)
1154 #endif /* HAS_SRAND48_R */
1156 #ifdef HAS_SRANDOM_R
1158 # if !defined(srandom) && SRANDOM_R_PROTO == REENTRANT_PROTO_I_TS
1159 # define srandom(a) (((errno = srandom_r(a, &PL_reentrant_buffer->_srandom_struct))) == 0 ? &PL_reentrant_buffer->_srandom_struct : 0)
1161 #endif /* HAS_SRANDOM_R */
1163 #ifdef HAS_STRERROR_R
1165 # if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
1166 # define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1168 # if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
1169 # define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
1171 # if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
1172 # define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
1174 #endif /* HAS_STRERROR_R */
1178 # if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
1179 # define tmpnam(a) tmpnam_r(a)
1181 #endif /* HAS_TMPNAM_R */
1183 #ifdef HAS_TTYNAME_R
1185 # if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
1186 # define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1188 # if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
1189 # define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
1191 # if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
1192 # define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
1194 #endif /* HAS_TTYNAME_R */
1197 #endif /* USE_REENTRANT_API */